The story
I had a project few weeks ago where my client wanted to install Skype for Business 2019 but had installed Lync before and removed the server without doing proper decommissioning which kept dirty records in AD database and had to be removed manually in order to make a new clean installation of Skype for Business 2019
To do so:
There are two days of doing so, One is using ADSIEdit and ADUC to remove Computer Objects and Users related attributes and Security Groups.
I normally would prefer PowerShell but since we can demonstrate both ways for people who like to work with GUI
Starting with GUI
Removing Legacy Lync server from the AD Schema
Prerequisites
- Using a domain or enterprise admin
- Access to the ADSIEdit.
Goal of removing Legacy Lync server from your AD environment.
- Preparing AD schema and domain for a new deployment after you improperly deleted Lync Servers without uninstalling them.
- Cleaning Users’ Lync related attributes for the new deployment.
Step#1: Remove permissions
This step removes the original Lync permissions from the active director.
- Open Active Directory Users and Computers
- Right click on your top level domain being cleaned and select Properties
- From the Properties windows, select the Security tab.
- Remove all security users titled RTC*
These are usually
– RTCUniversalServerReadOnlyGroup
– RTCUniversalUserReadOnlyGroup
– RTCUniversalUniversalServices
– RTCUniversalUserAdmins
From <http://blog.armgasys.com/?p=320>
-
Repeat the same steps for each of the following AD Folders and
OUs
NOTE: Not all RTC permissions will exist in each AD Folder or OU, but these three OUs do:
– Domain Controllers
– System
– Users
Domain Controllers
Systems
Users
Step#3: Additional AD cleanup
- Open Active Directory Users and Computers
- Drill down as follows
[Your Domain] \ Program Data \ Distributed \ KeyMan - Delete LyncCertificates
NOTE: This may not exist in all scenarios. - Drill down as follows
[Your Domain] Users - Delete all RTC* and CS* users created by Lync
I.E. CSAdministrator, CSHelpDesk, RTCComponentUniversalServices, Etc.
Deleting users from the User OU
Deleting CS Users
Step#4: Cleanup existing users
This steps resets Lync attributes for any domain users and contacts.
The Second way: Using PowerShell
get-aduser -filter {msRTCSIP-PrimaryUserAddress -like “*”}|set-aduser -clear msRTCSIP-PrimaryUserAddress,msRTCSIP-PrimaryHomeServer,msRTCSIP-UserEnabled,msRTCSIP-OptionFlags,msRTCSIP-UserPolicies, msRTCSIP-DeploymentLocator, msRTCSIP-FederationEnabled, msRTCSIP-InternetAccessEnabled
Result:
Users attribute are clean and AD has nothing left over of Previous installation of Lync or Skype for Business .