Advertisement
goezler

Export Disabled AD Users

Jul 27th, 2021
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Export Disabled AD Users to CSV using Powershell
  2. 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.
  3.  
  4. Import-Module ActiveDirectory
  5. Search-ADAccount –AccountDisabled -UsersOnly |
  6.  Select -Property Name,DistinguishedName |
  7.  Export-CSV "C:\DisabledADUsers.csv" -NoTypeInformation -Encoding UTF8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement