As a starting point when removing Skype for Business (SfB) from an on-premises domain, there must be a decision about removing JUST the SfB topology from the on-premises deployment or if you want to remove also the Active Directory schema preparation that was required to install SfB in the first place.
In this post I will outline how to safely remove the SfB topology.
Let me advise against removing the schema modification. I see no massive benefits in that and, as a main motivation not to remove the schema, please remember that all migrated user phone numbers are still managed by the msRTCSIP-Line attribute.
By the way, the above is also a motivation NOT TO run the massive SfB user disable Get-CsUser | Disable-CsUser -Verbose that is often suggested, if you did not have a prior preparation.
If you still want to remove the schema, take a look to Mark Vale’s blog here for a detailed explanation on this specific topic
https://online.commsverse.com/do-not-remove-skype-for-business-until-you-have-read-this/
I will assume that:
• All the users, analog devices, meeting rooms and response groups heve been already migrated to Microsoft Teams
• Skype for Business hybrid has been removed, as for this Microsoft document “Disable hybrid to complete migration to the cloud”
https://docs.microsoft.com/en-us/skypeforbusiness/hybrid/cloud-consolidation-disabling-hybrid
Emptying the SfB deployment
(All the commands have to be executed on one of the Front Ends from the Skype for Business Server Management Shell)
• Remove ONLY the users still on the on-premises pools
Get-CsUser -Filter {RegistrarPool -eq "CurrentPoolFqdn"} | Disable-CsUser -Verbose
• Remove Exchange UM Contacts:
Get-CsExUmContact | Remove-CsExUmContact
• Remove Voice Routes
Get-CsVoiceRoute | Remove-CsVoiceRoute
• Remove Conferencing Directories (-Force could be required)
Get-CsConferenceDirectory | Remove-CsConferenceDirectory
Note: you could have to execute this one again when publishing the topology, if you have an error message
• Remove Call Park Orbit policies
Get-CsCallParkOrbit | Remove-CsCallParkOrbit
• Remove Unassigned Number configuration
Get-CsUnassignedNumber | Remove-CsUnassignedNumber
• Remove Analog Devices
Get-CsAnalogDevice | Remove-CsAnalogDevice
• Remove Skype for Business meeting rooms
Get-CsMeetingRoom | Remove-CsMeetingRoom
• Remove Response Group workflows
Get-CsRgsWorkflow | Remove-CsRgsWorkflow
• Remove trunk configuration
Get-CsTrunkConfiguration | Remove-CsTrunkConfiguration
Removing the deployment
1) Open the Topology Builder
2) Click Action and navigate to Topology
– Remove any PSTN Gateway
– Remove any Persistent Chat Server
3) Action > Topology > Remove Deployment
4) Action > Topology > Publish. This will publish the removal configuration.
5) Progress through the “Publish the topology” wizard. If you have trusted applications in the topology you will have a warning that you have to acknowledge before proceeding
6) You will still see the last Front End in your topology. Finalize the Skype for Business topology decommission running the following command from the Skype for Business Server Management Shell
Publish-CsTopology -FinalizeUninstall
Remove the Configuration Store Location from Active Directory:
Remove-CsConfigurationStoreLocation
Note
Sometimes, when publishing the topology, you could have the following errors
Warning: Access control entry (ACE) XXXXXXXX\RTCUniversalServerReadOnlyGroup; Allow; GenericRead; None; None
Warning: The access control entries (ACEs) on the object "computers container" are not ready
If Skype for Business Server administrators are not domain administrators, the RTCUniversalServerAdmins group needs the right permissions. Verify it running
Test-CsSetupPermission -ComputerOU "ou=CsServers,dc=litwareinc,dc=com"
The result must be “True”
If the result is false. fix the error running
Enable-CsAdDomain -Domain “YourDomain.com”
(More information in the Microsoft document below)
https://docs.microsoft.com/en-us/skypeforbusiness/manage/test-admin-topology-rights