Steps to completely uninstall/remove an already existing lync 2010/2013 deployment

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 a disaster recovery scenario, a lync server upgrade.

In this article we will have a look at the steps to decommission the lync servers in a existing deployment.

Based on my experience, i have gathered few steps which would be useful to troubleshoot in these kinds of scenarios.

 

1) Disable all users that are enabled for Lync Server and conferencing directories.

Probably you can run the below commands

Get-CSuser | Disable-CSuser

Get-CsConferenceDirectory | Remove-CsConferenceDirectory

 

2)  Remove Exchange Unified Messaging (UM) Contact Objects

Get-CsExUmContact -Filter {RegistrarPool -eq “<LyncServerPoolFqdn>”} | Remove-CsExUmContact

 

3) Remove Response Group Service Workflow Contact Objects

Get-CsRgsWorkflow -Identity:Service:ApplicationServer:<LyncServerPoolFqdn> | Remove-CsRgsWorkflow

 

4) Remove Dial-in Conferencing Access Number Contact Objects

Get-CsDialInConferencingAccessNumber | where {$_.Pool -eq “<LyncServerPoolFqdn>”} | Remove- CsDialInConferencingAccessNumber

 

5) Reassign the PSTN Gateway

Set-CsPstnGateway -Identity “PstnGateway:<Xds Identity of PSTN Gateway>” -MediationServer:”MediationServer: <Name of Mediation Server Identity>”

6) Confirm that a Front End Pool or Front End Server is Vacant

Get-CsVoiceRoute | select Identity,PstnGatewayList

 

7) Delete all the server roles in the topology, and then publish the final, empty topology.

Log on to the computer where Topology Builder is installed.
Start Topology Builder: Click Start, click All Programs, click Microsoft Lync Server 2010, and then click Lync Server Topology Builder.
In the Actions pane, click Remove Deployment.
Read the information regarding Remove Deployment
Click Next, and then click Finish.

Once the above is done you can open topology builder and publish the empty topology by choosing the option Download Topology from existing deployment.

8) Uninstall all Lync related SQL database.

Uninstall-CsDatabase -DatabaseType User -SqlServerFqdn sqlbe.contoso.net[-SqlInstanceName <instance name>]

 

9) 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)

10) Unprep the domain.

Example:

Disable-CsAdDomain -Domain domain1.contoso.net -GlobalSettingsDomainController dc01.domain1.contoso.net -Force

11) Unprep the forest.

Example:

Disable-CsAdForest -Force -GroupDomain contoso.net

After doing the above, you should be able to start a new deployment.

Thanks

Sathish Veerapandian

MVP – Exchange Server 

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

%d bloggers like this: