Advertisement
Merzavets

Find AD user with any attribute

Jun 26th, 2012
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Find active user with empty AD attribute named "ou", then export this list to CSV
  2. Get-QADUser -IncludedProperties ou | where { ($_.ou -eq $null) -and ( -not $_.AccountIsDisabled )} | select SamAccountName, name, Department | Export-Csv -Path c:\withoutOU.csv -Encoding utf8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement