Get a list of all domain users with attribute

Get-ADUser -Filter * -SearchBase “domain distingush name” -SearchScope Subtree -properties Name, SamAccountName, Enabled, description, Office | Select-Object Name, SamAccountName, Enabled, description, Office | export-csv -path C:\Users\xxxx\allusers.csv

Welcome to the forums :wave:

This is the third thread you have started with a code snippet. Do you have a question?

Also, when you post code, error messages, sample data or console output format it as code, please.

You may also want to redact the domain name you’ve posted in this thread.

2 Likes