I am new to scripting. I have tried this many ways I am now asking for help. What am I doing wrong? Thanks in advance.
I am using Active Roles AD Powershell one.
I am tring to create new users using a csv file. I would like to enable this accounts. set the passwords and password never expire and add these users to a group that is in the csv. I also have a few object attributes that are not listed in the default for new-QADuser description.
cn,samaccountname,givenName,sn,initials,description,department
,employeeNumber,employeeType,employeeID,objectClass,userpassword,memberof,userPrincipalName
$OU="OU=test,OU=AuxServices,OU=Staff,OU=testy,DC=com"
$file="c:\testing\test-import-w-pwd-222.csv"
IMPORT-CSV $file | where {new-QADuser -ParentContainer $OU -name $_.cn -sAMAccountName $_.samaccountname
-UserPassword $_.userpassword –FirstName $_.givenName –LastName $_.sn -Initials $_.initials
-Description $_.description -Department $_.department –DisplayName $Name -UserPrincipalName $_.userprincipalName
-ObjectAttributes @{employeeNumber=$_.employeeNumber;employeeType=$_.employeeType;employeeID=$_.employeeID;objectClass=$_.objectClass;memberOf=$_.memberof}
| enable-QADUser $_.cn}