Change Phone Nummber in Active Directory

Hy Experts

Is there a way to change the AD phone number from 0041xxxxxxx to +41xxxxxxxxx with PowerShell?

Or is the correct syntax for Lync / skype for business +41 xx xxx xxxx? How could i do that?

Is there a way to change it only for one OU. Example OU:IT_TEST

Thank you

seccho


  • Edited by Seccho Wednesday, July 08, 2015 12:51 PM
July 8th, 2015 12:46pm

Thank you for your help

Sorry me again...

For IPPhones it should work like this?

get-aduser -filter * -properties IPPhone | where {$_.IPPhone -ne $null} | % { set-aduser $_ -IPPhone $(($_.IPPhone).Replace("0041","+41")) }

Sorry i'm new with powershell :-( And have 2 fix my coworkers failure

And is it possible to test it with some users like this:

get-aduser -Identity user -properties IPPhone ....


  • Edited by Seccho Wednesday, July 08, 2015 3:09 PM
Free Windows Admin Tool Kit Click here and download it now
July 8th, 2015 3:09pm

Hi

I tried it with this:

Get-ADUser -SearchBase "OU=IT_TEST,OU=_Benutzer,DC=xxx,DC=local" -Filter * -properties IPPhone | where {$_.IPPhone -ne $null} | % { set-aduser $_ -IPPhone $(($_.IPPhone).Replace("0041","+41")) }

but i get the error

Set-ADUser : A parameter cannot be found that matches parameter name 'IPPhone'.
At line:1 char:157
+ Get-ADUser -SearchBase "OU=IT_TEST,OU=_Benutzer,DC=xxx,DC=local" -Filter *
-properties IPPhone | where {$_.IPPhone -ne $null} | % { set-aduser $_ -IPPhone
 <<<<  $(($_.IPPhone).Replace("0041","+41")) }
    + CategoryInfo          : InvalidArgument: (:) [Set-ADUser], ParameterBind
   ingException
    + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.ActiveDirectory
   .Management.Commands.SetADUser

Any ideas?

Thank you!!

July 9th, 2015 3:22am

Try this:
Set-ADUser $_ -Replace @{IPPhone=$(($_.IPPhone).Replace("0041","+41"))}



Free Windows Admin Tool Kit Click here and download it now
July 9th, 2015 4:25am

Try this:
Set-ADUser $_ -Replace @{IPPhone=$(($_.IPPhone).Replace("0041","+41"))}



July 9th, 2015 8:18am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics