Export Users
- Download the Export-ADUsers.ps1 script
- Move the script to C:\Scripts
- Edit the script to point to your domain and specific OU's (or domain root to export all users)
$DNs = @( "DC=DOMAIN,DC=LOCAL"
- Open Powershell ISE (run as administrator)
- File > Open and browse to C:\Scripts Select Export-ADUsers.ps1 and choose Open
- Click the Play button at the top to run the script
- Your users will be located in C:\Scripts as a .csv file
Import Users
- Download the Import-ADUsers.ps1 script
- Move the script to C:\Scripts
- Edit the script to point to your path and file name and change the the initial password (P@ssw0rd1234) to your preference
$Csvfile = "C:\scripts\AllUsers.csv"
AccountPassword = (ConvertTo-SecureString "P@ssw0rd1234" -AsPlainText -Force)
- Open Powershell ISE (run as administrator)
- File > Open and browse to C:\Scripts Select Import-ADUsers.ps1 and choose Open
- Click the Play button at the top to run the script
If there are errors please ensure that your initial password meets the password policy requirements. Remove users and groups from the csv file that already exist in AD.