📜  用于更改广告中电话号码的 powershell 脚本 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:51.196000             🧑  作者: Mango

代码示例1
$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}

}