API to pull all hosts from Screenconnect

Avatar
  • updated
  • Open

Hi, I am looking for a way to pull down all active hosts, logged on user, machine name etc. Ideally everything you can see in the General tab within screen connect. I looked at the Bulk DataSync API and RESTful API Manager extension and I can’t find any details on how to get this using those methods. 

I am essentially trying to pull similar data to what I can pull from Connect Wise Automate via APIs https://mysite.hostedrmm.com/cwa/api/v1/computers and https://mysite.hostedrmm.com/cwa/api/v1/computers/chassis

We are moving away from ConnectWise Automate but we are keeping screenconenct so I need to pull the data from Screenconenct instead.

(note, ConnectWise moderators edited this to anonymize the URL)

Avatar
0
Caitlin M Barnes Team Member

Hi Tor,

The RESTful API manager has a method 'GetSessionsByFilter' which can take "HostConnectedCount > 0" to return a list of sessions where a Host is connected. The Session object already contains the SessionGuestInfo stuff, but you can also use GetSessionDetailsBySessionID(Guid sessionID) to get session details.

Avatar
0
tor loege

Thanks but that only returns 4 sessions so I assume only the ones an agent is currently active in. I am looking for all all hosts in the Everything group (we have 3401 currently). Is that an option somehow?

Avatar
0
tor loege

Actually what I can probably do is call it twice. Once for HostConnectedCount > 0 and once with HostConnectedCount = 0. Seems clunky but I guess that could work if there are no better options?  Is the session id returned by this persistent for a given host or could that change?

Avatar
0
Caitlin M Barnes Team Member

Your suggestion is one way to go, but the GetSessionsByFilter method can take a general filter, perhaps like SessionType = 'Access', or even more generic like 'GuestConnectedCount > -1'. 

However, that is a pretty intensive call, especially with the number of endpoints you're querying. So not a call you'll want to make constantly. 



Top contributors

Avatar
Avatar
Avatar
Avatar
Avatar
Avatar
Avatar
Avatar
Avatar
Avatar
Avatar
Avatar
Avatar
Avatar
Avatar