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

Notification

Icon
Error

Options
Go to last post Go to first unread
promptcare  
#1 Posted : Tuesday, April 25, 2017 7:53:17 PM(UTC)
promptcare


Rank: Advanced Member

Medals: ScreenConnect Advisor: Focus Group MemberLevel 2: Lent a Helping Hand! 10 Thanks!

Joined: 9/14/2011(UTC)
Posts: 353
Location: ON, Canada

Thanks: 30 times
Was thanked: 13 time(s) in 11 post(s)
I use CustomProperty3 as a note field to let me know what needs to be done to a PC -- "check updates", etc. I've recently started using it to tag PCs on my workbench so they'll show up in my "To Do" group. Using: "(CustomProperty3 <> '' OR GuestClientVersion <> '6.2.12963.6312') AND GuestConnectedCount > 0" as this also helps me make sure I get any PCs running older versions caught up.

When a PC hits my workbench, I fire up a 'toolbox' program and start up a bunch of mostly-automated steps. Once started, I often babysit it from my desk.
If there were a way to include a command to change that flag to "workbench", that'd be great.
Scott  
#2 Posted : Tuesday, May 2, 2017 11:26:44 AM(UTC)
Scott


Rank: Administration

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

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

Thanks: 3 times
Was thanked: 305 time(s) in 262 post(s)
So, you want a script/program in your mostly-automated steps to tell the ScreenConnect server to change the value for CustomProperty3 upon execution? Because the Custom Property values are only read upon session creation, you would have to do this with a webrequest (via curl or powershell, etc). Your WebRequest would call an extension method like:

Code:

public void ChangeCustomProperty3(string AuthKey, Guid sessionID)
	{
		if(AuthKey != "3661515"){
			//do nothing don't care
		} else {
			Session session = SessionManagerPool.Demux.GetSession(sessionID);
			session.CustomPropertyValues[2] = "workbench";
			
			SessionManagerPool.Demux.UpdateSession("Toolbox Script", sessionID, session.Name, session.IsPublic, session.Code, session.CustomPropertyValues);
		}
	}


It would pass a pre-shared AuthKey (to prevent anyone from making the request) and the sessionID (can be pulled from the registry).

The basic powershell code could look like:

Code:

$params = '["AUTHKEY_HERE","SESSIONID_HERE"]'

Invoke-WebRequest -Uri http://YOUR_URL_HERE:8040/App_Extensions/EXTENSION_ID_HERE/Service.ashx/ChangeCustomProperty3 -Method POST -ContentType "application/json" -Body $params
ScreenConnect Team
JasonThompson  
#3 Posted : Friday, June 2, 2017 9:10:17 AM(UTC)
JasonThompson


Rank: Newbie

Joined: 5/28/2015(UTC)
Posts: 2
Austria
Location: Wattens

Hi Scott,

can you maybe provide an example of how to „end“ a specific access session using only the session name (not sessionID) via command line?

Thanks
Jason
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.