# Powershell Script to Dump ALL domain users and associated attributes to CSV # Use Quest ActiveRoles Active Directory Powershell CMDLETs Add-PSSnapin Quest.ActiveRoles.ADManagement # Quest AD commandlet command # Dump All Users to CSV write-Host "Active Directory User Dump Script" -foregroundcolor "yellow" write-Host "Writing users to 'D:\Oracle\Backup\DumpAD.CSV'" -foregroundcolor "yellow" write-Host "Please wait...." -foregroundcolor "yellow" GET-QADUSER -sizelimit 0 | select-object dn,employeeNumber,sn,givenName,title,telephoneNumber,mobile,department,location,postalAddress,postalCode,mail,comment,manager | export-CSV "D:\Oracle\Backup\DumpAD.CSV" -noType cls write-Host "Active Directory User Dump Script Finished" -foregroundcolor "yellow" write-Host "Please review 'D:\Oracle\Backup\DumpAD.CSV' for full information..." -foregroundcolor "yellow" write-HOst "### END ###" -foregroundcolor "yellow" # # # #Email notification of run send-mailMessage -To email@example.com -From firstname.lastname@example.org -subject 'Active Directory User Dump Complete' -body 'Please note the Active Directory user dump has finished successfully . See attached copy of D:\Oracle\Backup\DumpAD.CSV for full information of dumped accounts' -attachments 'D:\Oracle\Backup\DUmpAD.CSV' -smtp smtpserver.dc.dc # #End of Powershell Script
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
8 Experts available now in Live!