Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Remove user from Response Groups in Skype for Business and Lync,
#Skype User Offboarding Response Group Cleanup.
#Define user account
$SipAddress = ""
#Create an array of response groups containing the user
$RGSGroups = (Get-CsRgsAgentGroup | where {$_.AgentsByuri -contains "Sip:$SipAddress"})
#Run through the groups and remove the user
ForEach ($Group in $RGSGroups)
Write-output "User found in $($Group.Name). Removing..."
Set-CsRgsAgentGroup -Instance $Group
Write-output "User removed from $($Group.Name)."
Write-error "Error: Something went wrong removing the user from $($"
#Check if we left the response Group Empty
if ($Group.AgentsByUri.Count -eq 0) {Write-Warning "$SipAddress was the last user in $($ This response group will not function until another user is added!"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.