Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell Script to copy mobilephone number to telephone number

$
0
0

Hello Friends,

I need a powershell script to copy mobilephone attribute to telephone attribute.

Scenario is below:

I have Group "Test1" , I need to copy mobilephone attribute to telephone attribute of all the uses in this Group.

I have created the script but its not giving desired result

"Get-QADGroup "test1"|ForEach-Object{Get-QADGroupMember$_.samaccountname}|selectsamaccountname,mobilephone | export-csvD:\test1.csv

Import-Csv "D:\test1.csv"|%{Get-QADUSer$_.Samaccountname | Set-QADUser-ObjectAttributes@{telephonenumber=$_.mobilephone}}"

My observation:

1.while I exporting the attribute , i am not getting proper telephone format in CSV which is "+919999XXX1111" 

2. If Telephonenumber attribute of a user is allready filled , it does not update the attribute. it only update the attribute if it is blank

Plase help to resolve it.

this is kind of urgent , thank you all in advance


 


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>