Hello - I'm attempting to configure a Custom Command with a PS script that will return the number of users in one of my Lync Registrar Pools. I've put together a small powershell script below. This script is returning a list of users (first name, last name) and not a user count. Can you assist with modifying this to output a user count instead of a list of names?
import-module Lync
Get-CsUser -Filter {RegistrarPool -eq "S1LyncPool1.mydomain.local"} | ForEach-Object {
$message = $_.Name + ": " + (Get-CsUser -identity $_.Name).Count
$Context.LogMessage($message, "Information")
}