Home Analyst Portal

A way to show all users with current sessions on the portal?

Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
I would like to be able to list everyone who is currently logged into the portal with an active session.  I think I see how to do this against the SDK with PowerShell (which also returns service accounts), but is there any feasible/reasonable way to accomplish this with JavaScript in the portal?

Best Answer

Answers

  • Nicholas_VelichNicholas_Velich Cireson Consultant Ninja IT Monkey ✭✭✭✭
    Can you post your PowerShell code? I'll take a look and see if it can translate.
  • Geoff_RossGeoff_Ross Cireson Consultant O.G.
    I'm assuming @Tom_Hendricks is referring to the Get-SCSMConnectedUser cmdlet. 
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    $dllPath = "[YOURSERVICEMANANAGERINSTALLDIRHERE]\SDK Binaries\Microsoft.EnterpriseManagement.Core.dll"<br><br>$emg = New-Object 'Microsoft.EnterpriseManagement.EnterpriseManagementGroup' '[YOURSCSMSERVERNAMEHERE]'<br><br>$emg.GetConnectedUserNames()<br>
    The output is just an array of strings, formatted is DOMAIN\USERNAME, but that would be just fine.  GUIDs would be better in some ways, but we can always make an API call after the username is known, to get the rest of the details.  I cannot remember for sure, but I probably learned how to do this from this Marcel Zehner blog post.  For a while I had this memorized but had to do a Google search to refresh my memory again.
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    No, @Geoff_Ross, why would I do it the straightforward way when I could make it difficult and slightly less useful, instead? :)
  • Tom_HendricksTom_Hendricks Customer Super IT Monkey ✭✭✭✭✭
    Thanks for confirming, @Nicholas_Velich.  For on-prem it seems that a web call to SMA, which would run the PS and return the result, or a home-grown web service might be the way to go.

    This will have to wait a few sprints, but I appreciate the help figuring out the direction to head in.
Sign In or Register to comment.