Skip to content

Instantly share code, notes, and snippets.

@amandadebler
Created July 6, 2020 14:34
Show Gist options
  • Save amandadebler/d83d8c23b986ef46078120520d1bf91c to your computer and use it in GitHub Desktop.
Save amandadebler/d83d8c23b986ef46078120520d1bf91c to your computer and use it in GitHub Desktop.
<#
Get-CsTopologyFixed.ps1 v1.0
Last updated 2015-02-27 by Amanda Debler, https://mandie.net
Please let me know about any improvements you've made or mistakes you've found!
#>
<#
.Synopsis
Fixes the missing SimpleURLConfiguration of the native Get-CsTopology -AsXml cmdlet
.DESCRIPTION
The version of Get-CsTopology -AsXml that ships with Lync Server 2013 Management
Shell leaves off the SimpleURLConfiguration node, which prevents the URLs for
meetings, the Lync Administration web console and phone access from
being shown in Topology Builder. A lack of a Meeting URL is a fatal error in
a Lync topology.
.EXAMPLE
Get-CsTopologyFixed
.EXAMPLE
Get-CsTopologyFixed -Path "C:\temp\AwesomeCompanyTopology.tbxml"
#>
function Get-CsTopologyFixed
{
[CmdletBinding()]
[OutputType([void])]
Param
(
# Param1 help description
[Parameter(Mandatory=$false,
ValueFromPipelineByPropertyName=$true,
Position=0)]
$Path = "C:\Temp\MyReadOnlyTopology.tbxml"
)
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
}
$SimpleURLConfiguration = Convert-CsSimpleUrlConfigurationToXMLText
$CsTopologyWithoutURLs = Get-CsTopology -AsXml
$CsTopologyWithURLs = $CsTopologyWithoutURLs.Replace("</Topology>",$SimpleUrlConfiguration+"</Topology>")
$CsTopologyWithURLs | Out-File -FilePath $path
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment