Filter Active Directory users based on custom attribute and export to csv

Print Friendly
Get-ADUser -Filter {attribute -like 'Yes'} -Properties * | select attribute1, attribute2, attribute3, attribute4, attribute5, attribute5, attribute6 | Export-Csv -path 'd:\edu4.csv' -Encoding unicode

The attributes after the select are exported in the csv file.

If you want to find users with attribute not set you can use the following filter:

Get-ADUser -Filter {-not(extensionAttribute1 -like "*") }
This entry was posted in Windows. Bookmark the permalink.

Leave a Reply

Your email address will not be published.