logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
dpinto  
#1 Posted : Monday, January 16, 2017 10:23:28 PM(UTC)
dpinto


Rank: Guest

Joined: 1/16/2017(UTC)
Posts: 1
United States

Our execs are concerned that support reps are not completely ending sessions. We are looking for a way to automatically end all support session daily, weekly, or after inactivity for X hours.

Help!
Scott  
#2 Posted : Wednesday, February 22, 2017 2:18:58 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,398
United States

Thanks: 3 times
Was thanked: 297 time(s) in 255 post(s)
So there isn't a way to schedule something to happen within ScreenConnect, but you can create an Extension that contains a method which will perform the action. Then, you could use a cronjob/scheduled task/whatever to make a HTTP request to the method to perform the action whenever you want.

The following WebService class will End all Support sessions where no Host is connected when called. It accepts a single parameter, apiKey, to validate the call is from an authorized source.

Code:

<%@ WebHandler Language="C#" Class="Service" %>

using System;
using System.Net;
using System.Configuration;
using System.Web;
using ScreenConnect;
using System.Linq;

public class Service : WebServiceBase
{
	public object PerformDirectSessionEnd(string apiKey)
	{
		if (apiKey != "YOUR_API_KEY_HERE")
			return null;
		else
			SessionManagerPool.Demux.GetSessions()
				.Where(_ => _.SessionType == SessionType.Support)
				.Where(_ => !_.ActiveConnections.Any(__ => __.ProcessType == ProcessType.Host))
				.Select(_ => _.SessionID)
				.ForEach(_ => SessionManagerPool.Demux.AddSessionEvent(_, new SessionEvent{EventType = SessionEventType.EndedSession}));
				
		return null;
	}
}
ScreenConnect Team
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.