1

My code:

New-ADUser -samaccountname first_last -Name "first last" -UserPrincipalName [email protected] -AccountPassword (ConvertTo-SecureString -AsPlainText "p@ssw0rd" -Force) -Enabled $true -PasswordNeverExpires $true -Path 'OU=EGC,DC=egc,DC=gov,DC=vm' -givenname 'first' -sn 'last' -displayname 'display name' -description 'IC NO' -title 'Job Title' -division '3' -physicaldeliveryofficename 'EGNC HQ' -telephonenumber '2424955' -mail '[email protected]' -department 'egnc hq' -company 'ministry PMO' -streetaddress 'Full Address Here' -postalcode 'BB3333'

One of the Error:

New-ADUser : A parameter cannot be found that matches parameter name 'telephonenumber'.

The error follows the the following LDAP attributes:

  • sn
  • physicalDeliveryOfficeName
  • telephonenumber
  • mail

User creation works if I remove the mentioned attributes.

Any fix for this?


Answer for:

  • sn is Surname
  • telephonenumber is officephone (Thanks to David Johnson)
  • physicalDeliveryOfficeName is office (Thanks to David Johnson)
  • mail is email

2 Answers 2

2

Which telephone number?

  • officephone
  • mobilephone
Sign up to request clarification or add additional context in comments.

4 Comments

you are right, it was -officephone! I found out sn is actually Surname.
Now i need to find 'physicalDeliveryOfficeName' which refers to 'Office' field and 'mail' which refers to 'E-mail' field in AD
physical Delivery Office name?
yes! physicalDeliveryOfficeName is office where as mail is just email! lol
0

I know this post is old but someone may actually need to amend the telephonenumber attribute or any other attribute that does not show up when you run get-aduser username properties *

Even though you receive the error when amending the telephoneNumber attribute using the syntax as attempted by the OP - you CAN actually amend the telephoneNumber attribute using the syntax below:

Set-ADUser username -add @{telephoneNumber="000 1111 1111"}

As the telephonenumber attribute is not a multivalue attribute If the attribute already has a value it will return an error. To amend the attribute regardless of whether there is a value or not - use -replace instead of -add

Set-ADUser username -replace @{telephoneNumber="000 1111 1111"}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.