Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2045
  • Last Modified:

How to modify telephoneNumber AD user property ?

Hello,

I am getting the following error once I changed the Telephone number for an AD user.

Type the new TELEPHONE Number:: 3034938004

Are you sure, you want to replace the following Title "303-493-8004" by "3034938004" (Y/N): y
Set-ADUser : A parameter cannot be found that matches parameter name 'telephoneNumber'.
At C:\scripts\AD\test.ps1:136 char:58
+                                 Get-ADUser $AD_User.sAMAccountName  | Set-ADUser -telephoneNumber $Input ...
+                                                                                  ~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Set-ADUser], ParameterBindingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory.Management.Commands.SetADUser

Thanks for your help,
0
namerg
Asked:
namerg
  • 3
  • 2
1 Solution
 
SubsunCommented:
Try with -OfficePhone parameter
Get-ADUser $AD_User.sAMAccountName  | Set-ADUser -OfficePhone $Input
0
 
namergSystems AdministratorAuthor Commented:
Perfect Subsun.

But, how did you know it was -OfficePhone ?

I go to the ADSI edit and do not see any OfficePhone.

Thanks,
0
 
SubsunCommented:
I would check with Get-Help or technet reference for parameters.. :-)
0
 
SubsunCommented:
Here is a good reference for all commands..
http://ss64.com/ps/
0
 
namergSystems AdministratorAuthor Commented:
Hmm ok. Thanks a million
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now