Answers for "powershell script to change phone number in ad"

0

powershell script to change phone number in ad

$users = get-aduser -filter * -searchbase "OU=TestScript,OU=UK,OU=SomeDomain,DC=ad,DC=SomeDomain,DC=com"`
-Properties telephonenumber, mobile 
foreach ($user in $users) {
#Make changes to phone number and place the results into variable $phoneupdate
$phoneupdate = ($Users.telephonenumber -replace "\(0\)", "" -replace "[^0-9,^+]", "") 

Set-ADUser $user -add @{telephonenumber=$phoneupdate}

}
Posted by: Guest on February-08-2021

Code answers related to "powershell script to change phone number in ad"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language