logo

The ConnectWise Control forum has moved to ConnectWise University! This forum has been locked and is in read-only mode. Click here for instructions on how to access the new forum.

Welcome Guest! You can not login or register.

Notification

Icon
Error

Options
Go to last post Go to first unread
akoumouris  
#1 Posted : Friday, April 1, 2016 6:27:50 AM(UTC)
akoumouris


Rank: Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 10/7/2013(UTC)
Posts: 28
Location: Greece, Thessaloniki

Was thanked: 2 time(s) in 1 post(s)
Hello.

We are trying to add some automation from our sybase applications to ScreenConnect and we need to get all the support sessions using database query.

Does anyone know the query needed to be run on ScreenConnect Database in order to return all support Sessions?


thanks

Scott  
#2 Posted : Friday, April 1, 2016 1:07:31 PM(UTC)
Scott


Rank: Administration

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

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

Thanks: 3 times
Was thanked: 351 time(s) in 303 post(s)
So from table Session you're pulling every entry that has type 0, the query would look like:

Code:

 SELECT * FROM Session WHERE SessionType=0;
ScreenConnect Team
akoumouris  
#3 Posted : Monday, April 4, 2016 9:26:12 AM(UTC)
akoumouris


Rank: Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 10/7/2013(UTC)
Posts: 28
Location: Greece, Thessaloniki

Was thanked: 2 time(s) in 1 post(s)
Sorry, my wrong, I meant Access sessions.

We found that the following Session types are as follows:
0 - Support Sessions
1 - Presentation Sessions
2 - Access Sessions

The problem we face is that we have a Session Group that lists all Access Sessions and there are 1056 of them.

But, when we query the database for SessionType=2 then we get 2000+ results which are not valid.
Does the application keep records for old sessions that disconnected and never connected again? (Not Uninstalled).

Is there any way to get rid of these records if exists?

Thanks
Ben B  
#4 Posted : Monday, April 4, 2016 1:49:58 PM(UTC)
Ben B


Rank: Administration

Medals: Level 2: Lent a Helping Hand! 10 Thanks!

Joined: 10/2/2015(UTC)
Posts: 329

Thanks: 1 times
Was thanked: 71 time(s) in 63 post(s)
The session database includes information about ended sessions. Endedness is determined by the presence of the EndedSession session event.

The following query will pick out Access sessions that do not have a corresponding EndedSession session event:

Code:
SELECT * FROM Session WHERE SessionType = 2 AND SessionID NOT IN (SELECT SessionEvent.SessionID FROM SessionEvent WHERE (EventType = 21 AND SessionType = 2) GROUP BY SessionEvent.SessionID);

Edited by user Monday, April 4, 2016 8:09:08 PM(UTC)  | Reason: syntax highlighting

ScreenConnect Team
akoumouris  
#5 Posted : Tuesday, April 5, 2016 8:13:06 AM(UTC)
akoumouris


Rank: Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 10/7/2013(UTC)
Posts: 28
Location: Greece, Thessaloniki

Was thanked: 2 time(s) in 1 post(s)
Hi Ben.

Unfortunately the query you gave me still returns more than 2200 sessions where in Screen Connect app, the Session Group i have created shows 1065 sessions currently.
Any other ideas?
Scott  
#6 Posted : Tuesday, April 5, 2016 1:00:24 PM(UTC)
Scott


Rank: Administration

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

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

Thanks: 3 times
Was thanked: 351 time(s) in 303 post(s)
What options do you have enabled in the Database tab on the Administration page?

Also, in your web.config, what's the value for AccessSessionExpireSeconds?
ScreenConnect Team
akoumouris  
#7 Posted : Wednesday, April 6, 2016 7:58:19 AM(UTC)
akoumouris


Rank: Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 10/7/2013(UTC)
Posts: 28
Location: Greece, Thessaloniki

Was thanked: 2 time(s) in 1 post(s)
Hello Scott.

In our WebConfig, the Value for AccessSessionExpireSeconds is: 3600
In the Database tab, all options are checked and the value in time is 60 days.
Scott  
#8 Posted : Wednesday, April 6, 2016 12:59:10 PM(UTC)
Scott


Rank: Administration

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

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

Thanks: 3 times
Was thanked: 351 time(s) in 303 post(s)
So AccessSessionExpireSeconds tells ScreenConnect to automatically hide any Access session from the Host page if the session has not connected to the server within the specified amount of time. This means that you have quite a few sessions that can be considered dead/inactive because they have not connected recently. Even with those DB maintenance options, since they have not been ended they remain in the database.

You can change AccessSessionExpireSeconds to 0 (perhaps just temporarily) to prevent it from hiding these inactive sessions. Just be aware that any modifications to the web.config will restart the server services, so it might be best to do at an offpeak time. I would recommend changing the setting and then Ending any sessions that you no longer need.
ScreenConnect Team
akoumouris  
#9 Posted : Friday, April 8, 2016 7:11:52 AM(UTC)
akoumouris


Rank: Member

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 10/7/2013(UTC)
Posts: 28
Location: Greece, Thessaloniki

Was thanked: 2 time(s) in 1 post(s)
Hello Scott.

Lets forget for a minute the database maintenance options and AccessSessionsExpireSeconds value.

In ScreenConnect Web Interface, we created a Session Group Named ALL Access Sessions that has not Session Filters and this one displays currently 1022 Sessions.(See attached Image)

ScreenConnect_Example]Image

So, what is the query that runs and displays those results on Session Group Named ALL Access Sessions?


Thanks.

Edited by user Friday, April 8, 2016 7:13:16 AM(UTC)  | Reason: Edited imaage link.

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.