Missing Meet URL in Global Topology in Lync Hosting Pack v2

For some reason, our provisioning service does not always publish the meet url in the global topology. Strictly speaking this entry is not used to populate the users meetURL, but it is needed whenever you need to deploy changes to the topology.

Missing Meet URL's in the global topology will cause an error message in Topology Builder, and prevent you from deploying anything.

In a huge deployment, finding the missing domain/meet-url mapping can take some time. That's where this short example script comes in play.

Powershell to the rescue, once again :)
$domain = Get-CsSipDomain | select identity
foreach ($d in $domain){
$TenantName = $d.identity.tostring()
$TenOrgID = (Get-CsTenant | where name -eq "$TenantName").tenantID
$TenantSIPDomain = $TenantName
$BaseMeetingURL = "https://meet.domain.com/"
$NewMeetingURL =  $BaseMeetingURL + $TenantSIPDomain
$URLEntry = New-CsSimpleUrlEntry -Url $NewMeetingURL
Write-Host "$URLEntry" -ForegroundColor darkgreen
$SimpleURL = New-CsSimpleUrl -Component "meet" -Domain $TenantSIPDomain -SimpleUrl $URLEntry -ActiveUrl $NewMeetingURL
Write-Host "$SimpleURL" -ForegroundColor yellow
Set-CsSimpleUrlConfiguration –identity global -SimpleUrl @{add=$SimpleURL} -Verbose -ErrorAction SilentlyContinue|Out-Null
Be aware you might have adjust the script to match your environment. And I should probably mention we've chosen to name our tenants the same as their sip addresses ;)