Reader Question: “How Can I Find Out the Number of Active Users on Skype for Business?”
A reader I’ll call Tom, with whom I’ve spoken a couple times now, had a question on Active Users. He wanted to know if there was a way he could, via the Control Panel or PowerShell, find the number of Lync/Skype4B users who were active right now.
Interesting question! He asked if there was a PowerShell cmdlet to find out – easily the fastest method. However, I don’t know of a cmdlet which displays active users for Skype for Business Server.
There IS a cmdlet which displays active users for Skype for Business Online. It’s:
Office 365 also has an Active Users Report for Skype for Business Online in its Admin Center.
Getting a full list of active users on Skype4B Server? That’s a little more complicated.
Option 1: Monitoring Reports
Remember this screenshot? It came from a User Activity Report on our then-Lync Server.
With the User Activity Report you can see who’s active during a specific time period, and what peer-to-peer or conferencing sessions they’re in. It does serve to answer Tom’s question, but not in the most direct manner.
What about PowerShell?
Option 2: PowerShell Scripts
I checked several PowerShell cmdlets – Get-CsUser, Get-CsAdUser, etc. None would give me a list of active users on our Front End. I even tried the Get-CsOnlineUser on our server, just in case it did work. No such luck.
So I turned to scripts. Rather quickly I found two script-based options for listing active Skype4B users.
One, the incredibly powerful Get-CsConnections.ps1.
Script: Get-CsConnections.ps1 â€“ See User Connections, Client Versions, Load Balancing in Lync Server: Ehlo World!
Written back in 2011, the author has updated the script multiple times, and it does work with Skype for Business Server.
It requires installation, the steps for which are documented in the post. (EDIT: According to the script’s developer, all you need to do is download and run. All the better!)
Get-CsConnections.ps1 has plenty of parameters to choose from. For instance, running the script to see the number of active users on a Front End Server named DEFAULT is:
Get-CsConnections.ps1 -Server DEFAULT -IncludeUsers
The same blog also had the second option: a “oneliner” script using the Get-Counter cmdlet.
One Liner â€“ See Number Of Connected Users, Endpoints On A Lync Front End Server: Ehlo World!
In order to use this, you’d need to know the specific counters for active users. They are, according to the post:
LS:USrv â€“ Endpoint Cache\USrv â€“ Active Registered Endpoints
LS:USrv â€“ Endpoint Cache\USrv â€“ Active Registered Users
The full “oneliner” script reads:
Get-Counter “\LS:USrv – Endpoint Cache\USrv – Active Registered Endpoints”,”\LS:USrv – Endpoint Cache\USrv – Active Registered Users” | Select-Object -ExpandProperty CounterSamples | Format-Table Path,CookedValue -Auto
A simple method for finding active users. Fewer steps too. But, not as many options as Get-CsConnections.ps1.
I find the underlying “counter” technology fascinating though…the post is definitely worth a read. I may dig further into it for later posts as well.
Impressive Use of PowerShell for a Deceptively-Thorny Problem
Great question Tom! Set me on a bit of a goose chase, but we wound up with some juicy tidbits as a result. Thank you to the Ehlo World! Blog as well for their stellar work.
What would you use Skype for Business Active User data for? Please email in or comment your thoughts.
(UPDATED JANUARY 22, 2020)