How to Remove Legacy OCS Dial-in Simple URL from Lync Server

If you've migrated to Lync Server from a previous version of OCS, you may have noticed that you might have an additional simple URL configured.  You can see this in the Lync Server Control Panel under Topology > Simple URL:


Note: You may need to click on the image above in order to read the text.

It shows up as Dialin13.  You can also see it if you run:

Get-CsSimpleUrlConfiguration | Select-Object -ExpandProperty SimpleUrl

This is the dial-in URL that was used in OCS.  So where did this URL come from?  First, the dial-in URL was part of the Communicator Web Access component of OCS.  You can find some additional information in the Ten Things You Might Not Know About the 2007 R2 Release of Communicator Web Access TechNet article.  Specifically you needed to run Step 4 under Deploy Communicator Web Access:

This step published the URLs for Communicator Web Access.  You can find some additional information in the Publishing Communicator Web Access URLs TechNet article.

So when you click on Publish, where does that information get stored?  It is actually stored in two locations.  The first is in WMI on the CWA Server(s):

The second location is in Active Directory.  Specifically in the Global Settings folder under RTC Service:

The two attributes are: ms-RTC-SIP-DefaultCWAExternalURL and ms-RTC-SIP-DefaultCWAInternalURL.  So now that we know where the information is stored, how did it get into Lync?  The Dialin13 simple URL was created in Lync when you ran Import-CsLegacyConfiguration as part of the migration steps from OCS to Lync Server.  In order to remove the old OCS dial-in simple URL, we're going to follow the steps outlined in Example 3 in the Set-CsSimpleUrlConfiguration TechNet article:

Because the Set-CsSimpleUrlConfiguration cmdlet needs to work with URL objects, the example starts by creating a new object that contains the exact same property values as the URL to be deleted.  To do that, the first command uses the New-CsSimpleUrlEntry cmdlet to create a URL entry that points to https://im.test.deitterick.com/dialin; this URL entry is stored in a variable named $urlEntry:

$urlEntry = New-CsSimpleUrlEntry -Url "https://im.test.deitterick.com/dialin"

After the URL entry has been created, the second command uses the New-CsSimpleUrl cmdlet to create an in-memory instance of a simple URL.  In this example, the URL Component is set to Dialin13; the domain is set to *; the ActiveUrl is set to https://im.test.deitterick.com/dialin; and the SimpleUrl property is set to $urlEntry, $urlEntry being the URL entry created in the first command.  This creates an in-memory URL ($simpleUrl) that has the same property values as the URL to be deleted:

$simpleUrl = New-CsSimpleUrl -Component "Dialin13" -Domain "*" -SimpleUrlEntry $urlEntry -ActiveUrl "https://im.test.deitterick.com/dialin"

The final command in the example then deletes the URL from the simple URL collection for the Global site.  This is done by using the Set-CsSimpleUrlConfiguration cmdlet, the SimpleUrl parameter, and the parameter value @{Remove=$simpleUrl}.  This syntax simply causes the URL stored in the object reference $simpleUrl to be removed from the SimpleUrl property:

Set-CsSimpleUrlConfiguration -Identity Global -SimpleUrl @{Remove=$simpleUrl}

Once the command completes, you will see a warning message about running Enable-CsComputer.  You can go ahead and run Enable-CsComputer on your Lync Server Front End Servers for good measure:

If you go back to the Lync Server Control Panel and look in Topology > Simple URL, you will see that the Dialin13 simple URL is no longer there:


Note: You may need to click on the image above in order to read the text.

 

One important thing to remember is that if you run Import-CsLegacyConfiguration again for any reason, it will recreate the Dialin13 simple URL!  The reason for this is that those attributes still exist in Active Directory and the cmdlet will import them again.  However, this shouldn't be a big issue, since you shouldn't need to run the Import-CsLegacyConfiguration cmdlet again once you've decommissioned your OCS environment.