Skip to content

null-valued expression error #1

@fd1911

Description

@fd1911

Hello there!
I'm developing a Dashboard where I query an Active Directory.
After the query the name and distinguishedname are passed to the -options of the New-UD Selector.
$arrayArgDistrolist= @( $grupo = get-adobject -Filter 'ObjectClass -eq "group"' -SearchBase "OU=Arg,OU=Distribution Groups,OU=Company,DC=company,DC=local" | Select-Object Name,DistinguishedName foreach ($grupos in $grupo) { $grupoArgDN= $grupos.DistinguishedName $grupoArgName = $grupos.Name New-Object psobject -Property @{label ="`"$grupoArgName`""; value ="`"$grupoArgDN`""} } ) New-UDSelector -id "selectorARG" -Options {$arrayArgDistrolist}
The $arrayArgDistrolist variable contains a lot of items like this example (write-host $arrayArgDistrolist) equals to "@{label="OfficeHQ"; value="CN=officeHQ,OU=Argentina,OU=Distribution Groups,OU=company,DC=Company,DC=local"} and a lot more of items.

I really don't know what I'm doing wrong here.

I've read the documentation and based on the examples this should work, given that $arrayArgDistrolist contains values like the examples.
I can't hardcode all the groups because it's from an AD and in the future, some will be added and maybe later some deleted. And also it will be a long script haha.

This is the second or third time I post an issue on GitHub, so... apologies if I misspell something. English is not my main language.
I'd appreciate the help!

Thanks!!!!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions