What was a pretty easy task in Exchange 2010, seems to have become more difficult in the new Exchange 2013 Control Panel (ECP). When deleting a UM Dial Plan you need to remove all of its associations first, these are:
UM Mailbox Policies and UM Auto Attendants
Remove any Mailbox Policies or Auto Attendants from the Dial Plan
UM Server
Remove the Dial Plans association to the UM Call Router and UM Service
UM IP gateways/UM Hunt Groups
Remove the Dial Plans association to a UM IP Gateway by deleting the UM Hunt Group bound to the Dial Plan. This is where it gets interesting – The below screen shot shows the UM Hunt Group configuration section in the Dial Plan. The troubles is when you create a SIP URI Dial Plan type which is required for Lync, you cannot see this section. I’m not sure if this is a bug, or by design.
- Gateway Identity is found in the “Name” column returned from Get-UMIPGateway
- Hunt Group is found in the “Name” column returned from Get-UMHuntGroup
Your command should look something like this:
1 |
Remove-UMHuntGroup -Identity "GatewayNameHuntGroup" |
If you get the syntax wrong you’ll probably see one of the following 2 error messages:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
>>Cannot process argument transformation on parameter 'Identity'. Cannot convert value "NLNZ Offices:NL NZ Offices Dial Plan" to type "Microsoft.Exchange.Configuration.Tasks.UMHuntGroupIdParameter". Error: "'NLNZ Offices:NL NZ Offices Dial Plan' isn't a valid UM hunt group identity. Specify an identity in the form "<gateway identity>\<hunt group name>"." + CategoryInfo : InvalidData: (:) [Remove-UMHuntGroup], ParameterBindin...mationException + FullyQualifiedErrorId : ParameterArgumentTransformationError,Remove-UMHuntGroup + PSComputerName : lxlhlyncexch01.lhl.local >>The operation couldn't be performed because object '<UM Server>\NLNZ Offices' couldn't be found on '<UM Server>'. + CategoryInfo : NotSpecified: (:) [Remove-UMHuntGroup], ManagementObjectNotFoundException + FullyQualifiedErrorId : FAC401B1,Microsoft.Exchange.Management.Tasks.UM.RemoveUMHuntGroup + PSComputerName : <UM Server> |
PowerShell
Below is a rough example of how PowerShell could make this task a little easier:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
#Settings $ExchangeMailboxServers = @("<mailboxserver1fqdn>","<mailboxserver2fqdn>") #Comma seperated list of Exchange 2013 Mailbox Servers $ExchangeCASServers = @("<casserver1fqdn>","<casserver2fqdn>") #Comma seperated list of Exchange 2013 CAS Servers $UMDialPlan = "Dial Plan Name" #Dial Plan to delete $UMMailboxPolicy = "Mailbox Policy" #Mailbox Policy to delete - This should be the one associated to the dial plan $UMIPGatewayName = "IP Gateway Name" #UM IP Gateway Name (Get-UMIPGateway | FT -AutoSize #Name column is the Gateway Identity) $UMHuntGroupName = "Hunt Group Name" # UM Hunt Group Name (Get-UMHuntGroup #Name column is the Hunt Group Name) #Remove Mailbox Policy Remove-UMMailboxPolicy -Identity $UMMailboxPolicy #Remove Dial Plan associations from UM servers #Exchange 2013 - Remove dial plan from each Exchange mailbox server foreach($MailboxServer in $ExchangeMailboxServers) { Set-UMService -Identity $MailboxServer -DialPlans @{Remove="$UMDialPlan"} } #Exchange 2013 - Remove dial plan from each Exchange CAS server foreach($CASServer in $ExchangeCASServers) { Set-UMCallRouterSettings -Server $CASServer -DialPlans @{Remove="$UMDialPlan"} } #Remove UM Hunt Group Remove-UMHuntGroup -Identity "$UMIPGatewayName\$UMHuntGroupName" #Remove Dial Plan Remove-UMDialplan -Identity $UMDialPlan |
Great article. I noticed a slight syntax issue with your remove-UMHuntGroup in my Exchange version. I needed to add a backslash (\) between the Gateway identity and the UM Huntgroup name. I am running Exchange 2013 Version 15 (Build 1076.9).
Example:
Remove-UMHuntGroup -identity GatewayID\UMHuntGroupName.
Thanks.
Thanks for your feedback, good to know 🙂 I did test this in an Exchange 2013 environment so maybe something has changes…
I’ve updated my PowerShell script – looks like when I moved my site from Blogger the import process stripped some of the text!
Thanks for the article.
For me, I used the “GUID” returned from Get-UMHuntGroup to remove the hunt group:
Remove-UMHuntGroup -Identity “”
Cheers for your feedback 🙂
[…] Andrew Morpeth explained how to do this with details here: https://ucgeek.co/2014/04/removing-exchange-2013-um-dial-plan/ […]
[…] Andrew Morpeth explained how to do this with details in this very helpful article here: https://ucgeek.co/2014/04/removing-exchange-2013-um-dial-plan/ […]