New AD-User

I can set most attributes for a new AD user with the New-ADUser cmdlet including c which takes the -country parameter. However I have problems trying to set the co attribute in AD. i thought it would have been as simple as -co but it seems not so simple.

Many thanks

Trevor George

There may not be a parameter to New-ADUser that sets that attribute directly, but it does have a fallback option that allows you to set any LDAP attribute that you need: -OtherAttributes. This parameter takes a hashtable of ldap attribute names to values:

New-ADUser -OtherAttributes @{ 'co' = 'COValue' } # etc

Hi Dave. Thanks for that. i shall give it a go later