Friday, August 24, 2018

Skype for Business - Powershell to set Dialplan Policy & Voice Policy to Automatic.

If you had manually assigned DialPlan & VoicePolicy and started using the Site level policy then you might want to change your DialPlan & VoicePolicy for all users to back to Automatic.


Basically from 

To 


Here is the powershell which targets users via RegisterPool. I also make a backup of dialplan & volicepolicy which was assigned to user in csv.

Import-Module SkypeOnlineConnector
#Change the below pool for targeting users
$RegistrarPool = "frontend.domain.com"

$users = Get-CsUser -Filter {RegistrarPool -eq $RegistrarPool} | select DisplayName 

$array = @()

foreach ($user in $users)
{

$userpolicy = get-csuser $user[0].DisplayName | select DisplayName, VoicePolicy, DialPlan

$array += $userpolicy

get-csuser $user[0].DisplayName | Grant-CsDialPlan -PolicyName ""
get-csuser $user[0].DisplayName | Grant-CsVoicePolicy -PolicyName ""

#Dialplan set
#get-csuser Firstname LastName | Grant-CsDialPlan -PolicyName ""
#VoicePolicy set
#get-csuser firstname.lastname@skype.com | Grant-CsVoicePolicy -PolicyName ""
}
$array | Export-Csv -notype -Path C:\Scripts\dialplanpolicyFinal-+$RegistrarPool+.csv

No comments:

Post a Comment