Symptoms

  • There are some SIP domains to which no users belong.
  • The simple URL remains in Lync after the SIP domain is removed.
  • The simple URLs are missing for some SIP domains.
  • The user provisioning task fails with the message:

    There must be an Active URL for Meet for each SIP Domain
    
  • The user removing task fails with the message:

    Simple URL cannot be specified for a nonexistent SIP Domain.  Please add the SIP Domain first
    

Cause

The issue may be caused by failed tasks on creating/updating/removing Lync users.

Resolution

Run the following script (attached to this KB article) from the PowerShell with the LyncOnline module imported on the Lync provisioning gateway host:

  1. Extract the attached archive on the Lync provisioning gateway host.
  2. Test script:

    .\RemoveUnusedDomains.ps1 -preferredDomainController '<Preferred Domain Controller>' -baseMeetDomain '<Conferencing domain name>' -lyncAdminLogin '<Lync System Administrator User Name>' -lyncAdminPassword '<Lync System Administrator Password>'
    

    Example:

    .\RemoveUnusedDomains.ps1 -preferredDomainController dc01.provider.net -baseMeetDomain meet.provider.net -lyncAdminLogin Administrator -lyncAdminPassword 'some secure password'
    

    View the log file RemoveUnusedDomain-log.txt in the folder the script was run from.

    Note: Output of the script may contain the warning WARNING: Activation (Enable-CSComputer) may need to be re-run on impacted Front End servers. If the lyncAdminLogin and lyncAdminPassword parameters are specified, this action (Enable-CSComputer) is performed by a script.

  3. If the script was executed correctly, register a scheduled task:

    schtasks /create /SC MONTHLY /mo LASTDAY /TR "%SystemRoot%\system32\windowspowershell\v1.0\powershell.exe -command '<full path to extracted script>\RemoveUnusedDomains.ps1 -preferredDomainController <Preferred Domain Controller> -baseMeetDomain <Conferencing domain name> -lyncAdminLogin <Lync System Administrator User Name> -lyncAdminPassword <Lync System Administrator Password>'" /ST 23:59 /TN "Lync Remove Unused Domains" /M *
    

    This command registers the scheduled task that executes the RemoveUnusedDomains script on the last day of every month at 23:59.

Script Parameters

Parameter Required Description
preferredDomainControllerYesPreferred Domain Controller FQDN. This value can be obtained in the global settings of the Lync 2010 resource type: POA Provider CP > Service Director > Resource Types > {Lync 2010 application RT} > Activation Parameters > Global Settings
baseMeetDomainNoConferencing domain name. This value can be obtained in the global settings of the Lync 2010 resource type. Specify this parameter in order to create missing simple URLs.
lyncAdminLoginNoLync System Administrator User Name. This value can be obtained in the global settings of the Lync 2010 resource type. If this parameter is omitted, the Enable-CsComputer cmdlet should be manually run on each FrontEnd and Director server.
lyncAdminPasswordNoLync System Administrator Password. This value can be obtained in the global settings of the Lync 2010 resource type. If this parameter is omitted, the Enable-CsComputer cmdlet should be manually run on each FrontEnd and Director server.

Internal content