SfBS 2019 SEFAUtil in PowerShell

Added to Skype for Business Server 2019 from CU1 is “SEFAUtil” functionality in native PowerShell. No longer do you need to install a clunky “Trusted Application”.

SEFA-WhatNow?

Such innocence. You don’t know the world of pain you’ve missed!

“Secondary Extension Feature Activation Utility” – to give it its full name – has historically shipped in the Lync and Skype for Business “Resource Kit” (“ResKit”) download pack. When correctly integrated into the topology it gives support staff the ability to query, set and cancel all manner of call-forwarding and team/delegation settings from the comfort of their cube, without needing to visit the user or reset their AD password in order to do it remotely (after signing in as that user). It’s a godsend when someone goes on leave unexpectedly or has a catastrophic PC failure with an urgent incoming call pending, and as equally helpful when configuring the settings for executives and other ‘sensitive’ users.

Unfortunately however SEFAUtil is terribly slow in operation, “finicky” to use, seemingly inconsistent (even on its good days) and (as it’s a free-standing executable) not so easily automated or batched.

There have been calls for years to have SEFAUtil reborn as native commandlets within SfB. Landis Technologies rose to this challenge in 2017 with its groundbreaking “SEFAUtil Server”. I’ve blogged about it on a couple of occasions, including this review.

New Commandlets

The following Commandlets were added in CU1:

Get/Set-CsUserCallForwardingSettings
Get/Set-CsUserDelegates
Get/Set-CsUserTeamMembers

Sample Commands

In case you’d like a hand understanding the syntax of these new commands, here are a few samples.

Activate call forward immediate

Activate an immediate call-forward to a (fictitious) Aussie mobile number:

Set-CsUserCallForwardingSettings user@contoso.com -EnableForwarding +61491578888

Cancel an immediate call-forward

This cancels a previously-activated call forward. If the user’s calls were previously set to forward to voicemail on no answer, this will be reinstated automatically:

Set-CsUserCallForwardingSettings user@contoso.com -DisableForwarding

Send unanswered calls to voicemail after 20 seconds

There’s a trick with this one, as you need to include “DisableForwarding” in the same command string:

Set-CsUserCallForwardingSettings user@contoso.com -DisableForwarding -UnansweredToVoicemail -UnansweredWaitTime 20

Add and remove some delegates

Set-CsUserDelegates gilligan@contoso.com -Delegates @{Add="skipper@contoso.com"; Remove="thurston.howell3@contoso.com", "lovey.howell@contoso.com"}

Replace all existing delegates with new ones

Set-CsUserDelegates gilligan@contoso.com -Delegates @{Replace="ginger@contoso.com","professor@contoso.com"}

Team call management

For team call group members, use the same format as the delegates command above, but using the Set-CsUserTeamMembers cmdlet and the “-Team” attribute:

Set-CsUserTeamMembers gilligan@contoso.com -Team @{Add="skipper@contoso.com"}

Sim-ring to the user’s team call group

Set-CsUserCallForwardingSettings jessica@bimbonet.net -EnableSimulRing Team -TeamDelegateRingWaitTime 10

The “Ring your team-call group after this many seconds” value – specified here as “-TeamDelegateRingWaitTime” – defaults to 0 if you don’t include it. The only valid options at this time are 0, 5 or 10s.

The cmdlet will fail with a red error message if the user has no members in their team:

Set-CsUserCallForwardingSettings : Team can't be null for team call operation.

Known Issues

Output “lags”

Sometimes if you make a change, the “updated” output that follows the cmdlet will not reflect this. Here’s an example:

PS C:\> Set-CsUserCallForwardingSettings jessica@contoso.net -EnableForwarding +61491578888

User                             : sip:jessica@contoso.net
CallForwardingEnabled            : False
ForwardDestination               :
ForwardImmediateEnabled          : False
SimultaneousRingEnabled          : False
SimultaneousRingDestination      :
ForwardToDelegates               : False
SimultaneousRingDelegates        : False
TeamRingEnabled                  : False
Team                             : {}
Delegates                        : {}
DelegateRingWaitTime             : 0
TeamDelegateRingWaitTime         : 0
SettingsActiveWorkhours          : False
UnansweredToVoicemail            : True
UnansweredCallForwardDestination :
UnansweredWaitTime               : 30

PS C:\> 

But if you wait only a few seconds and do a fresh “get-“, there it is:

PS C:\> get-CsUserCallForwardingSettings jessica@contoso.net

User                             : sip:jessica@contoso.net
CallForwardingEnabled            : True
ForwardDestination               : sip:+61491578888@contoso.net;user=phone
ForwardImmediateEnabled          : True
SimultaneousRingEnabled          : False
SimultaneousRingDestination      :
ForwardToDelegates               : False
SimultaneousRingDelegates        : False
TeamRingEnabled                  : False
Team                             : {}
Delegates                        : {}
DelegateRingWaitTime             : 0
TeamDelegateRingWaitTime         : 0
SettingsActiveWorkhours          : False
UnansweredToVoicemail            : False
UnansweredCallForwardDestination :
UnansweredWaitTime               : 0

PS C:\>

Microsoft is aware of this, so until it’s resolved just be careful. If you’re scripting any of this, I suggest you follow every “set” with a brief pause and then a “get”, on which you will then act if required.

Some states not captured correctly

Clearly this is will be resolved in a later update, but at the moment you might find the odd state that’s not correctly reflected in the get-CsUserCallForwardingSettings output.

One example I’ve found is if the user activates a call-forward to voicemail. The get-CsUserCallForwardingSettings cmdlet reports “CallForwardingEnabled : False”.

PS C:> Get-CsUserCallForwardingSettings gilligan

User                             : sip:gilligan@contoso.net
CallForwardingEnabled            : False
ForwardDestination               :
ForwardImmediateEnabled          : False
SimultaneousRingEnabled          : False
SimultaneousRingDestination      :
ForwardToDelegates               : False
SimultaneousRingDelegates        : False
TeamRingEnabled                  : False
Team                             : {}
Delegates                        : {}
DelegateRingWaitTime             : 0
TeamDelegateRingWaitTime         : 0
SettingsActiveWorkhours          : False
UnansweredToVoicemail            : True
UnansweredCallForwardDestination :
UnansweredWaitTime               : 30

Installation

You don’t need to do anything special to install this new functionality – it’s all baked into CU1. Having said that, don’t overlook the Update-CsAdminRole step.

If you’re at all doubtful, check out the Installation section of my CU1 post from earlier today.

Revision History

12th July 2019: This is the initial publication.
30th April 2021: Updated the ‘fictitious’ link.

 
– G.

15 Comments

  1. Hello,

    do you know how to enable group call pickup for users in Skype for Business Server 2019?
    I can’t find anything useful in the new cmdlets and SEFAUtil.exe seems to be not supported for SfBS 2019…

    Best regards
    Nils

  2. Is anybody else not able to run these commands unless you start the Powershell session as an admin? This happens to me both on a local PS on the SfB frontend (tells me something about a TLS error in case I start it as a non admin), as well as a remote PS (tells me the command is not recognized).

  3. Hi,

    one more problem with the new cmdlets…
    The parameter -UnansweredToOther from the cmdlet Set-CsUserCallForwardingSettings doesn’t work properly.
    The output of Get-CsUserCallForwardingSettings seems o.k. but the forwarding does not work and the call is rejected instead of forwarded.

    When I call the settings in the SfB client after that and click OK to save it (without any changes) it works as well as when I make the changes directly in the SfB client settings (not using the cmdlet).

    I thought that the september update fixed it but meanwhile the issue came back. I don’t know why…

    Best regards
    Nils

  4. Hi Greg,
    thanks for the summery.

    With old SefaUtil, we were able to work on a trusted application computer (admin-host) to adjust call forwardings.
    The new PS commands seems to work on frontend servers only.
    On a Trusted Application Computer we get an error:
    Get-CsUserCallForwardingSettings : Failed to establish UserEndpoint

    Do I miss something here?

    Thanks in advance,
    Oliver

    • Hi Oliver

      So far, I’ve automated the following commands running on a Trusted Application computer, as part of an IIS Web site. The Application Pool identity is set to a domain administrator account.
      Set-CsUserTeamMembers
      Get-CsUserCallForwardingSettings
      Set-CsUserCallForwardingSettings

      There are no reasons why others shouldn’t work.
      Unlike other Skype powershell commands, these only work from a x64 process. In the background, they load SIPEPS.dll.

      I did find that when the server had a 2nd network interface, the Skype powershell commands would fail with “could not find domain controller” errors. I had to block all standard protocols (DNS etc) on the 2nd network for it to work.

      I would conclude that these new commands are more like mini UCMA programs – and you should diagnose the problems from that perspective – ie, check network, permissions, AD group membership etc.

  5. What causes call forwarding to the mobile, even when all the settings are not to forward in Skype4b 2015?
    We have a scenario as when the unanswered call goes to the mobile. It is very annoying at the non office times.
    Workaround is to enter wrong Phone number in the skype4b mobile app, something to deal with registrations.
    However is there a setting where this can be stopped.

    • Are you sure it’s the user’s account doing a “call forward” to the user’s mobile number and not simply presenting on the SfB app on their phone?

      What is the “unanswered calls will be sent to” destination showing in the PC client? If THAT’S voicemail, is there any chance the calls are bouncing back to the user’s mobile via their voice mailbox?

Leave a Reply

Your email address will not be published.

... and please just confirm for me that you're not a bot first: Time limit is exhausted. Please reload the CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.