Wednesday, November 4, 2015

Active Directory: Find All Users with Specific UPN Suffix

$ou = "OU=Users,DC=mydomain,DC=local"
Get-ADUser -filter * -SearchBase $ou | Where-Object {$_.userprincipalname -like "*domain.com"} | Export-Csv C:\temp\UPN.csv

No comments:

Post a Comment