Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Export Disabled AD Users to CSV using Powershell
- We can export powershell output into CSV file using Export-CSV cmdlet. The following command export selected properties of all disabled Active Directory users to CSV file.
- Import-Module ActiveDirectory
- Search-ADAccount –AccountDisabled -UsersOnly |
- Select -Property Name,DistinguishedName |
- Export-CSV "C:\DisabledADUsers.csv" -NoTypeInformation -Encoding UTF8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement