最近准备在生产环境里面推UM了,1K+的用户,难道要一个一个去启用么?由于还要关联Secondary Dail Plan……看来只能用脚本了,PS平时没时间学习,今天就想了一个笨办法如下:
get-user -OrganizationalUnit "OU" | select-object SamAccountName,phone | Export-Csv d:\1.csv -encoding "unicode"

Import-CSV "d:\1.csv" | ForEach-Object -process {Enable-UMMailbox -Identity $_.SamAccountName -UMMailboxPolicy "DP1 默认策略"}

Import-CSV "d:\1.csv" | ForEach-Object -process {Set-Mailbox $_.SamAccountName -SecondaryDialPlan DP2 -SecondaryAddress $_.Phone}