Adding users to a domain using Import-CSV | new-qadUser cmdlet
Load the snap into the Powershell environment
set-Location c:\
Add-PSSnapin Quest.ActiveRoles.ADManagement
Get-PSsnapin
Set-QADPSSnapinSettings -DefaultSizeLimit 0
Get-Command Get-QAD*
Next, define the users domain into a CSV file. For example “USERS.csv”
name, displayName, givenName, sn, sAMAccountName, UserPassword
Troy Williams,Troy Williams (O),Troy,Williams,troy.williams,XXXXX
Beth Williams,Beth Williams (O),Beth,Williams,beth.williams,YYYYY
Note that the CSV file must be saved and encoded in Unicode format not in ANSI. Use the notepad to alter this feature.
Finally, load and pipe the CSV content using the Import-CSV to the new-qadUser cmdlet
Import-CSV .\USERS.csv | %{new-qadUser -ParentContainer ‘OU=PruebaSimon,DC=simonalsa,DC=com’ -DisplayName $_.’displayName’ -FirstName $_.’givenName’ -LastName $_.’sn’ -Name $_.’name’ -sAMAccountName $_.’sAMAccountName’ -UserPassword $_.’UserPassword’ }