I have imported a few properties of an ADUser I want to create from a csv
DisplayName : JT_vNext mail : JT_vNext@co.com mailnickname : Ha5tv9x ProxyAddresses : SMTP:J_T_vNext@co.com targetaddress : smtp:Ha5tv9x@mgd.co.com extensionAttribute5 : MBX=25GB;TYPE=EP2D_Dumpster;
and have tried to pipe this into this bit of PS to create the user(s):
$newUsers | % {New-ADUser -Credential $creds -Path 'OU=vNext,DC=amer,DC=co,DC=com'-Name $_.DisplayName -samAccountName $_.mailnickname -DisplayName $_.DisplayName -EmailAddress $_.mail ` -OtherAttributes @{ProxyAddresses="$_.ProxyAddresses";mailnickname="$_.mailnickname";targetAddress="$_.targetaddress";extensionAttribute5="$_.extensionAttribute5"}` } # -Enabled $True -AccountPassword (ConvertTo-SecureString $_.Password -AsPlainText -force) -PasswordNeverExpires $True}
Error returned is:
New-ADUser : A value for the attribute was not in the acceptable range of values
At line:2 char:9
I have commented out the -Enabled True section until I can at least get some users in AD working first. NOt sure what attribute PS is balking at.
Thanks