Reputation: 21
I want to find all users who do not have a value for the extended attribute manager
. Is this possible to do with the -Filter
parameter or must I pipe to Where-Object
?
I have tried all of the following:
$test = Get-ADUser -Filter 'Manager -notlike "*"'
$test = Get-ADUser -Filter 'Manager -ne "*"'
$test = Get-ADUser -Properties * -Filter 'Manager -notlike "*"'
$test = Get-ADUser -Properties * -Filter 'Manager -ne "*"'
Upvotes: 0
Views: 1960
Reputation: 200233
Not with -Filter
, but with -LDAPFilter
:
Get-ADUser -LDAPFilter '(!(manager=*))'
assuming that you want all users who don't have a manager assigned.
Upvotes: 2