How to list all enabled user in active directory:
1 |
Get-ADUser -filter {Enabled -eq $True} -Properties "DisplayName","emailaddress" | select name,emailaddress |
How to list all enabled user in active directory, for a given OU:
1 |
Get-ADUser -SearchBase "OU=Accounts,OU=RootOU,DC=ChildDomain,DC=RootDomain,DC=com" -filter {Enabled -eq $True} -Properties "DisplayName","emailaddress","title" | select name,emailaddress |