Set or change a Teams users call forwarding settings with PowerShell

So, as the title says, its now possible to manage a user in your Team tenants call forwarding settings. This is a feature that has been missed by many UC administrator since Teams replaced Skype for Business. But now it’s finally here – Sort of, the features is in preview. The features was release with the new preview version of the Microsoft Teams PowerShell module on the 9 December.

So lets get to it, what can you actually do with this ‘new’ feature. There are 5 commands you can use

  • Set-CsUserCallingSettings
  • Get-sUserCallingSettings
  • New-CsUserCallingDelegate
  • Set-sUserCallingDelegate
  • Remove-CsUserCallingDelegate

Set-CsUserCallingSettings lets you functions related to how call forwarding is handle on a specify user. Sample below:

Set-CsUserCallingSettings -Identity UserName@domain.com -IsForwardingEnabled $true -ForwardingType Immediate -ForwardingTarget +4512345678 -ForwardingTargetType SingleTarget

The above command forwards a specify users Teams call to a external PSTN phone number

When running the command “Get-CsUserCallingSettings” you get an output of what the user you specified settings is:

Get-CsUserCallingSettings -Identity UserName@domain.com
Add alt text

As we can see in the picture there are all of settings that can be modified for users call forward settings. We even have the possible to set “Delegates” for the users – This is a feature that can be used in relation to a Personal assistance contacting helpdesk to set him/her as a delegate on a corporate officer (or the likes) Teams to answers calls (or make calls) while in a meeting or a well deserved holiday. In order to set set a user as delegate on another users Teams you need to run the following command:

New-CsUserCallingDelegate -Identity UserName@domain.com -Delegate CorporateOfficer@domain.com -MakeCalls $true -ManageSettings $true -ReceiveCalls $true

If you need to change the permissions set for the Personal assistance to not make call as the corporate officer, run the following command:

Set-CsUserCallingDelegate -Identity UserName@domain.com -Delegate CorporateOfficer@domain.com -MakeCalls $true

If are tasked to remove the delegate permission for some reason, all you need to is run the following command:

Remove-CsUserCallingDelegate -Identity UserName@domain.com -Delegate CorporateOfficer@domain.com

In-depth :

ForwardingTargetType:
If ‘ForwardingTargetType’ is set to ‘SingleTarget’, then the ‘ForwardingTarget’ must be either a UPN(email) or a PSTN number (Remember country code!)

How to add multiple users to a user’s call group:

Set-CsUserCallingSettings -Identity CorporateOfficer@domain.com -CallGroupTargets "PA1@domain.com","PA2@domain.com","PA3@domain.com" -CallGroupOrder Simultaneous

It is importen note the following: With the parameter ‘CallGroupOrder’ you can specify if the calls should ring the call group members in the defined order (‘InOrder’)or all at the same time (‘Simultaneous’)
(The order is in that ordre you typed in the command above).

It’s important to note as well that all existing members on the users Callgroup well be removed and replaced with the ones you type in your command.

Forward to voicemail if unanswered or Forward to voicemail immediately
If you want to change how the users Teams handles and unanswered call and want it to go to voice mail you need the following command

Set-CsUserCallingSettings -Identity UserName@domain.com -IsUnansweredEnabled $true -UnansweredTargetType Voicemail -UnansweredDelay 00:00:20

If you need the a users call to go to voicemail immediately, you need use the following commands:

Set-CsUserCallingSettings -Identity UserName@domain.com -IsUnansweredEnabled $false
Set-CsUserCallingSettings -Identity UserName@domain.com -IsForwardingEnabled $true -ForwardingType Immediate -ForwardingTargetType Voicemail

The code samples are available on my GitHub page:
https://github.com/ChrFrohn/MSTeams/blob/main/Callforwarding.Ps1