Forum Discussion

TheGarrison's avatar
TheGarrison
Copper Contributor
Feb 24, 2023
Solved

Powershell Query - Sum / Total / Count

Hi, When i run this :    Get-CsOnlineUser | Where-Object { $_.AssignedPlan -like "MCOEV_VirtualUSER" } | select UserPrincipalName, LineURI   It works fine and returns all the objects i would exp...
  • StevenC365's avatar
    Feb 24, 2023

    TheGarrison I'm pretty sure you should be using Count not Sum, there isn't anything to add up.

     

    It's perhaps a quirk that sum works in other places, should all be using Count in my opinion.

     

    (Get-CsOnlineUser | Where-Object { $_.AssignedPlan -like "MCOEV_VirtualUSER" }).Count