Skip to content

Instantly share code, notes, and snippets.

@ciphertxt
Created June 9, 2016 16:09
Show Gist options
  • Save ciphertxt/2e945848f384c025225b61df9586ecd3 to your computer and use it in GitHub Desktop.
Save ciphertxt/2e945848f384c025225b61df9586ecd3 to your computer and use it in GitHub Desktop.
Returns a listing of users from Active Directory with no employeeid (who are enabled)
get-aduser -filter {-not(employeeid -like "*") -and (enabled -eq $true)} -properties * | select userprincipalname, samaccountname, surname, givenname, sid, employeeid | export-csv ~\Downloads\ADUsersWithNoEmployeeID.csv -NoTypeInformation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment