Get-CsTopologyFixed Loves Your Simple URLs!

Yes, I know there is no such thing as a tbxml tag. That doesn't mean that there shouldn't be.Remember how I was complaining last week about how Get-CsTopology -AsXml drops the whole SimpleUrlConfiguration node, which makes Topology Builder sad?

Fixed it!

You, too, can enjoy what I do in the evenings on my ridiculous lab machine and get your own readable (though read-only) .tbxml files right from PowerShell:

Get-CsTopologyFixed (hosted on TechNet Gallery)

It works for View-Only Administrators (CsViewOnlyAdministrator), as well as full CsAdministrator (or equivalent), so your telephone gal or Exchange guy can grab a copy whenever they need to check something or a consultant wants a copy so that they understand what’s going on with Lync in your environment. I have not tested it with an account that only has, for example, CsUserAdministrator or CsServerAdministrator.

For people who are not (yet) hard-core PowerShellers: this script is a function, not a standalone script. Running it “dot-sourced” will add the Get-CsTopologyFixed cmdlet to your current PowerShell session, or you can add the function to your Lync Server connection script. You need to either be on a computer with Lync Management Shell (part of the Lync management tools on the Lync Server installer image) or implicitly remoted to one that has it in order to access the native Lync Server cmdlets.

Here is the function to take the output of Get-CsSimpleUrlConfiguration and put it into an XML node, which my full script then drops into the rest of the Topology XML:

    function Convert-CsSimpleUrlConfigurationToXMLText { 
        $GetCsSimpleUrlConfiguration = Get-CsSimpleUrlConfiguration 
        $SimpleUrlConfigurationOut = "" 
        $simpleUrlConfigurationOut += '<SimpleUrlConfiguration xmlns="urn:schema:Microsoft.Rtc.Management.Settings.SimpleUrl.2008" UseBackendDatabase="false">' 
     
        foreach ($simpleUrl in $GetCsSimpleUrlConfiguration.SimpleUrl) { 
            $SimpleUrlConfigurationOut += "<SimpleUrl Component=`"$($simpleUrl.Component)`" Domain=`"$($simpleUrl.Domain)`" ActiveUrl=`"$($simpleUrl.ActiveUrl)`">" 
            foreach ($simpleUrlEntry in $simpleUrl.SimpleUrlEntry) { 
                $SimpleUrlConfigurationOut += "<SimpleUrlEntry Url=`"$($simpleUrlEntry.Url)`" />" 
            } 
            $SimpleUrlConfigurationOut += "</SimpleUrl>" 
        } 
 
        $SimpleUrlConfigurationOut += '</SimpleUrlConfiguration>' 
 
        $SimpleUrlConfigurationOut 
    }

I have no idea if it works (or is even necessary) on Lync Server 2010. If Microsoft will let me have a preview copy, I’d be willing to find out if it works (or is even necessary) on Skype for Business 😉

If you find something wrong with my script, or come up with an improvement, let me know!

Get-CsTopology Hates Your Simple URL Configuration

Yes, I know there is no such thing as a tbxml tag. That doesn't mean that there shouldn't be.

Yes, I know there is no such thing as a tbxml tag. That doesn’t mean that there shouldn’t be.

UPDATE – get the fix from the TechNet Gallery and read about it here!

Several of my Unified Communications team colleagues need to be able to get current copies of the topology on demand to hand to consultants or to just have some idea of what’s going on in our Lync world, but don’t have any business editing it and would rather not install the Lync Management Tools on their PCs. My team lead and I both thought that having a little script keep an up to date copy on our team’s SharePoint site was just the thing, and I pointed out that Get-CsTopology -AsXml should work quite nicely. *Should* being the important word in that sentence.

Get-CsTopology, like many things, is about 95% awesome. The 5% of not awesome is that it does not pull the Simple URLs. It fills in its best (and wrong) guess for the Phone access URLs, but shows that the Meeting URLs and the Administrative Access URL are missing, the first of which is a fatal flaw in a Lync topology.

Continue reading