powershell script to edit AD telephone notes

%3CLINGO-SUB%20id%3D%22lingo-sub-2138660%22%20slang%3D%22en-US%22%3Epowershell%20script%20to%20edit%20AD%20telephone%20notes%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2138660%22%20slang%3D%22en-US%22%3E%3CP%3Ewhat%20is%20the%20powershell%20script%20to%20edit%20AD%20telephone%20notes%3C%2FP%3E%3CP%3Ethe%20data%20is%20from%20csv%20file%20with%20header%20UPN%20and%20%22telephone%20notes%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Capture.JPG%22%20style%3D%22width%3A%20485px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F255201i59AEA5A548CC2286%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Capture.JPG%22%20alt%3D%22Capture.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2138660%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EActive%20Directory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EManagement%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Super Contributor

what is the powershell script to edit AD telephone notes

the data is from csv file with header UPN and "telephone notes"

 

Capture.JPG

2 Replies

@Marvin Oco 

Here's one way you can do it.

 

In this example, you can set all five of the phone attributes with a single command.

Set-ADUser -Identity billy.test -Replace @{homePhone=06202123;facsimileTelephoneNumber=67543256;mobile=01278564;pager=89765412;ipPhone=98723456}

 

You can also set each phone attribute one at a time.

Set-ADUser -Identity billy.test -Replace @{homePhone=06202123}
Set-ADUser -Identity billy.test -Replace @{facsimileTelephoneNumber=67543256}
Set-ADUser -Identity billy.test -Replace @{mobile=01278564}
Set-ADUser -Identity billy.test -Replace @{pager=89765412}
Set-ADUser -Identity billy.test -Replace @{ipPhone=98723456}

 

@Marvin Oco 

Also, this is another method 

$Values=@{
homePhone="12311"
facsimileTelephoneNumber ="123123"
mobile="123123"
pager="123123"
ipPhone="123123"
info="This is test"
}

Set-ADUser -Identity cell1 -replace $Values