Created
October 2, 2020 09:12
-
-
Save seanosullivanuk/95bc20648e12eaf0de56880ab5e5873d to your computer and use it in GitHub Desktop.
Export a list of Active Directory user accounts to a CSV, grabbing specific properties.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ADUser -Filter 'title -ne 0' -Properties givenName,sn,title,mail,sAMAccountName |select-object givenName,sn,title,mail,sAMAccountName | convertto-csv -Delimiter "`t" -NoTypeInformation | Select-Object -Skip 1 | % { $_ -replace '"', ""} | out-file "EmployeeExport.csv" -fo -en ascii |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment