Pages

Monday, January 17, 2011

I’m not sure if it’s just me but I had a hard time finding documentation that clearly outline the steps required to completely remove Microsoft Lync Server 2010 from your environment. Yes, there are bits and pieces out there that range from specific steps for part of the process and a detail blog post about how to remove all traces from Active Directory with a combination of PowerShell commands and adsiedit. Though I’m sure I could have used the information I found to hack away at then environment, I felt that I really wanted to figure out how to perform the uninstall without having to resort to the manual procedures required when using LDP and ADSIedit. After having no luck through spending hours trying to find documentation that outlines the process from start to finish, I began trying the Microsoft TAP and the Microsoft Partner forums. The TAP forum responses I got was pretty much what I had already known (references to cmdlets that remove the CMS) and the same goes for the Microsoft Partner forums initially. Being unsatisfied with the information I had through these two resources I gave up on the TAP forum because no one’s obligated to answer my questions but continued trading emails with a Microsoft engineer from the Partner Forums because they’ll always try their best to assist until you reach a dead end. After 4 days of trading messages (they answer your question overnight) I finally got enough information to avoid using adsiedit to remove Lync from our environment. I apologize for the long overview but I really wanted communicate how frustrating it was trying to do this. Now on to the good stuff:

Let’s start with a short description of the environment:

You’ve deployed an enterprise pool with one front-end server that collocates all the roles that are collocate-able to the server (i.e. mediation, a/v conferencing), a backend SQL server that hosts your pool’s database and no Edge, Monitoring and Archiving servers have not been deployed. The first step you’ll need to do is to open up Topology Builder, and expand your enterprise pool. Once the node has been expanded, right-click on the pool, select Topology and then RemoveDeployment.

With the above steps, the Remove Deployment Wizard will launch:

As indicated in the description above, this is the first step in completely removing your Lync Server deployment. The prerequisites are outlined so make sure you met them before proceeding with this step.

Once the wizard has performed the removal of the components, the instructions in the above screenshot will be displayed. What I didn’t like about this window was that while it did indicate I needed to publish the empty topology from Topology Builder and validate replication, it was skimpy on the details for the rest of the steps. What you’ll also notice after this wizard runs is that if you had a legacy BackCompatSite merged with your OCS 2007 R2 environment, it will now be gone:

So now that we have an empty topology to be published, proceed with using the Publish Topology action from the Action tab to publish the topology:

The familiar Publish Topology wizard will now launch so proceed as you would for an install:

Once you execute publishing the empty topology, you’ll see an output of the process similar to the following screenshot:

As shown in the above, it does complain about ocspool2 which was a OCS 2007 R2 pool and since I couldn’t find any documentation as to whether I needed to do anything prior to this step, I can’t really comment on whether something was missed. I will definitely update this post in the future when I find out though.

Once the process completes, you’ll see something similar to the following:

I did check the logs to see what the warnings were and although I don’t really remember (it’s been 2 weeks), I do remember it wasn’t anything that I felt needed to be addressed. Just to be safe, I went ahead to force replication using Replication Monitor:

From here on, I went ahead to run Setup.exe from the installation binaries and ran Step 2: Setup or Remove Lync Server Components:

As shown in the output above, roles are now being disabled.

Once completed, we will now see Step 2: Setup or Remove Lync Server Components labeled as: Run Again.

If you’ve closed the Topology Builder, reopen it and download the topology:

This is where I was essentially stuck. I can’t simply right click on the pool and choose Delete because I would end up with the following error:

A published pool hosting Central Management Service can not be removed. Please read product documentation to to find out how to move Central Management Service to a different pool.

I know for a fact that I can simply create a new pool and front-end, move it and remove this ocspool3 but what I’m trying to accomplish here is to remove Lync completely. While I was able to find cmdlet that seemingly removes CMS, I was determined to figure out how to do this properly without hacking away at it. Before I proceed, let me include another screenshot of what the environment looks like now when I select the pool:

From here on, I tried right-clicking on the front-end server and selected delete and it did let me delete the node but now I am left with a red X on the pool:

As shown in the above screenshot, I also get a nice big red X icon indicating that: A pool must contain at least 1 machine. Since I wasn’t even sure if I was supposed to do this, I closed Topology Builder without publishing and reloaded the topology information. I then went ahead and tried deleting the file stores to see what would happen and the following is the error:

This file store is being used. Remove the dependencies before deleting the store. Affected services:

Ok, again, no surprise there since the pool is still here. This is where I began spending over 2 hours trying to find official documentation on TechNet on what to do next but unfortunately, what I was looking for did not appear to exist. As I had indicated earlier, I began trading emails with a Microsoft engineer and after 4 days, I finally got further instructions. The first step from this point on is to remove the conference directories and to do this, we need to excute the cmdlet Get-CsConferenceDirectory from within the Lync Server Management Shell:

PS C:\Users\tluk> Get-CsConferenceDirectory

Identity : 1

ServiceId : UserServer:ocspool3

TargetServerIfMoving :

Id : 1

Fingerprint : 0b507838-20b9-444c-86e2-3174d2d2dd64

Identity : 3

ServiceId : BackCompatSite-UserServices-1

TargetServerIfMoving :

Id : 3

Fingerprint :

PS C:\Users\tluk>

As shown in the above, we currently have 2 so I proceeded to remove the BackCompatSite-UserServices-1 which then threw the following error:

PS C:\Users\tluk> Get-CsConferenceDirectory

Identity : 1

ServiceId : UserServer:ocspool3

TargetServerIfMoving :

Id : 1

Fingerprint : 0b507838-20b9-444c-86e2-3174d2d2dd64

Identity : 3

ServiceId : BackCompatSite-UserServices-1

TargetServerIfMoving :

Id : 3

Fingerprint :

PS C:\Users\tluk> Remove-CsConferenceDirectory -Identity 3

Remove-CsConferenceDirectory : Cannot find a definition for a conference direct

I originally had no idea why I’m getting an error here but thinking I believe it’s obvious that we’re trying to remove a reference to the BackCompatSite-UserServices-1 which no longer exists through looking at the topology information in Topology Builder. I went ahead and proceed with removing the conference directory that belonged to the Lync pool and it executed without any issues:

PS C:\Users\tluk> Remove-CsConferenceDirectory -Identity 1

WARNING: You are about to delete the last conference directory. Users on this

Once you’ve completed uninstalling the CsDatabase for Application, we can proceed with doing the same for Archiving (if it exists). There’s no harm done executing the command so if you’re not sure, just execute it anyways:

Database created by script "RtcCdrDbSetup.wsf" does not exist. There is nothing

to remove.

Database created by script "rtcaggregatordbsetup.wsf" does not exist. There is n

othing to remove.

PS C:\Users\tluk>

Now that we have uninstalling the Application, Archiving and Monitoring databases, we can proceed with uninstalling the Central Management Database with the command: Uninstall-CsDatabase-CentralManagementDatabase -SqlServerFqdn <yourSQLserver.domain.com> -SqlInstanceName <yourInstanceName>:

Once the step above is completed, you can try opening Topology Builder to download the topology and you’ll see the following:

Topology Builder could not copy the topology from the Central Management Store. Cannot find location of Central Management Store in Active Directory.

Success!

From here on, you’ll need to perform some cleanup with the backend SQL database which I won’t go into the details but I’ll include the screenshots:

You’ll also need to delete the file share you created for the pool:

It was definitely frustrating to not find clear documentation for the uninstall but I’m glad I got through it and I have to thank Alex Yu from Microsoft Partner Forums support for filling in the missing information/steps.

Assuming that the RTC instance of SQL server was used for the pool you've decommissioned then yes, you can safely uninstall it. If you have OCS 2007 R2 currently deployed in your environment and you're unsure about which SQL instance it's using, please confirm that it's not using the RTC instance you speak of.

Hi, useful document thankyou however you made a mistake which had me stumped for a while... you need to run bootstrapper.exe /scorch option rather than just bootstrapper. I kept running bootstrapper.exe without the scorch parameter and it kept installing the roles again rather than uninstalling them!

Thanks a lot !Microsoft desperately tries to cumbersome all of its products in quest for more and more money paid for their support, for their licenses and soft. Eventually they will lose - the open source will win.

hi,I am not able to publish topology after I deleted the lync 2010the error is it host orphaned users,but these users do not exist anymore in the active directoryhow can I force the uninstallpls help meGhassan