question

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT asked ·

Get-ADUser -Filter for blank Attribute

I'm trying to export a list of users with various attributes which have a particular attribute set to <not set>,

I've tried various combinations such as below with no luck as yet

 Get-ADUser -Filter 'extensionAttribute1 -like ""' -SearchBase 'OU=Users,DC=domain,dc=com 

Can anyone point me in the right direction?

https://social.technet.microsoft.com/Forums/windowsserver/en-US/08ac8bd2-8b24-4458-b971-0ac7fa955657/getaduser-filter-for-blank-attribute?forum=winserverDS#92a81319-6e72-46a8-8468-fcbcb8d8a683

windows-server-powershell
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

YoungYang-MSFT avatar image
0 Votes"
YoungYang-MSFT answered ·

Hi,


Thanks for your question.


Get-ADUser -Filter {-not(extensionAttribute1 -like "*") } -SearchBase "OU=Users,DC=domain,dc=com"

You can try to filter the blank attribute by the script example above.


Best regards,


Young Yang

·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.