[en] Get the number of Lync Migrated Users with Legacy Voice Policy from OCS Script


This little script will let you know how many migrated users are on Lync Server with a legacy voice policy assigned to them.

This was very usefull to me when i had to identify the number of users i had to update the legacy voice policy after migrated them to Lync Pool. Hope it will help you all!!!

######################################################################
# Look for all new and imported policies on Lync Pool except DefaultPolicy or Default Policy
# You have to change the RegistrarPool according to your deployment
######################################################################
get-CsVoicePolicy | where {$_.name -notlike “Default Policy” -and $_.name -notlike “DefaultPolicy”} | foreach-object {
$policy= $_.identity
$countusers = 0
foreach ($sipaddress in (Get-csuser -filter {VoicePolicy -eq $policy -and RegistrarPool -eq “POOL FQDN NAME”})){
$countusers++
}
# Removes the prefix Tag: from the policy identity
$tagpolicy= $policy -replace “Tag:”,””
if ($countusers -gt 0){
Write-Host There are still $countusers users on policy $tagpolicy from OCS -foregroundcolor yellow
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s