At times we might run into a situation where we would need to remove all the server roles, remove the features and front end roles in our Lync environment like in a disaster recovery scenario or Lync server upgrade.
In this article, we will have a look at the steps to decommission the Lync servers in an existing deployment.
Based on experience, we have gathered a few steps which should be useful to troubleshoot in these kinds of scenarios.
Disable all users that are enabled for Lync Server and conferencing directories. You can run the below command:
Get-CSuser | Disable-CSuser Get-CsConferenceDirectory | Remove-CsConferenceDirectory
Get-CSuser | Disable-CSuser
Get-CsConferenceDirectory | Remove-CsConferenceDirectory
2A. Remove Exchange Unified Messaging (UM) Contact Objects:
Get-CsExUmContact -Filter {RegistrarPool -eq "<LyncServerPoolFqdn>"} | Remove-CsExUmContact
Get-CsExUmContact -Filter {RegistrarPool -eq "<
LyncServerPoolFqdn
>"} | Remove-CsExUmContact
2B. Remove Response Group Service Workflow Contact Objects:
Get-CsRgsWorkflow -Identity:Service:ApplicationServer:<LyncServerPoolFqdn> | Remove-CsRgsWorkflow
Get-CsRgsWorkflow -Identity:Service:ApplicationServer:<
> | Remove-CsRgsWorkflow
2C. Remove Dial-in Conferencing Access Number Contact Objects:
Get-CsDialInConferencingAccessNumber | where {$_.Pool -eq "<LyncServerPoolFqdn>"} | Remove- CsDialInConferencingAccessNumber
Get-CsDialInConferencingAccessNumber | where {$_.Pool -eq "<
>"} | Remove- CsDialInConferencingAccessNumber
Set-CsPstnGateway -Identity "PstnGateway:<Xds Identity of PSTN Gateway>" -MediationServer:"MediationServer: <Name of Mediation Server Identity>"
Set-CsPstnGateway -Identity "PstnGateway:<
Xds
Identity of PSTN Gateway>" -MediationServer:"MediationServer: <
Name
of Mediation Server Identity>"
Confirm that a Front End Pool or Front End Server is Vacant:
Get-CsVoiceRoute | select Identity,PstnGatewayList
Delete all the server roles in the topology, and then publish the final, empty topology.
Once the above is done you can open topology builder and publish the empty topology by choosing the option Download Topology from existing deployment.
Uninstall all Lync related SQL database.
Uninstall-CsDatabase -DatabaseType User -SqlServerFqdn sqlbe.contoso.net[-SqlInstanceName <instance name>]
Uninstall-CsDatabase -DatabaseType User -SqlServerFqdn sqlbe.contoso.net[-SqlInstanceName <
instance
name>]
Run “Remove-CsConfigurationStoreLocation” to remove the Central Management store service control point (SCP) for the existing Central Management store in Active Directory Domain Services (AD DS).
Remove the Central Management Store Service Control Point in Active Directory Domain Services (Optional)
Example:
Disable-CsAdDomain -Domain domain1.contoso.net -GlobalSettingsDomainController dc01.domain1.contoso.net -Force
Disable-CsAdForest -Force -GroupDomain contoso.net
After doing the above, you should be able to start a new deployment.