SCRIPT: Reset-UserPolicies.ps1

Script Name: Reset-UserPolicies.ps1

Script Author: Lync MVP Ståle Hansen

Original Post: https://msunified.net/2011/07/04/script-to-reset-user-policies-in-lync-on-migrated-ocs-users/

Log:

  • V01 04.07.2011
    • Initial script
    • Reset CS policies on migrated users from OCS to Lync to use global settings
####################################################################################################
# Reset-UserPolicies.ps1
#
# v01 July 2011 by Ståle Hansen, Lync MVP (http://msunified.net)
#
####################################################################################################
foreach ($User in (Get-CsUser -Filter {ExternalAccessPolicy -ne $Null} )) {

$ErrorActionPreference = 'SilentlyContinue'

Get-CsUser $User.SamAccountName | Grant-CsVoicePolicy -PolicyName $null
Get-CsUser $User.SamAccountName | Grant-CsExternalAccessPolicy -PolicyName $null
Get-CsUser $User.SamAccountName | Grant-CsArchivingPolicy -PolicyName $null
Get-CsUser $User.SamAccountName | Grant-CsDialPlan -PolicyName $null

Write-Host Policies are reset for $User.DisplayName

$ErrorActionPreference = 'Continue'

}

Write-Host These users where not change, possibly due to Insufisient Access Rights
Get-CsUser -Filter {ExternalAccessPolicy -ne $Null} | ft DisplayName

One thought on “SCRIPT: Reset-UserPolicies.ps1

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