Get-ADUser -Filter for blank Attribute

Anonymous
2020-07-16T03:18:53.427+00:00

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 for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Young Yang (Shanghai Wicresoft Co,.Ltd.) 661 Reputation points
    2020-07-16T06:04:36.197+00:00

    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

    9 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.