Get-ADUser -Filter for blank Attribute

Ian Xue (Shanghai Wicresoft Co., Ltd.) 29,971 Reputation points Microsoft Vendor
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 Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,381 questions
0 comments No comments
{count} votes

Accepted answer
  1. 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

    6 people found this answer helpful.

0 additional answers

Sort by: Most helpful