question

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT asked 69867136 commented

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
5 |1600 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
3 Votes"
YoungYang-MSFT answered 69867136 commented

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

· 1
5 |1600 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.

Thank you. It helped me to get the expected result.

2 Votes 2 ·