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

Notification

Icon
Error

Options
Go to last post Go to first unread
cybersecfun  
#1 Posted : Wednesday, October 25, 2017 4:18:31 PM(UTC)
cybersecfun


Rank: Guest

Joined: 10/25/2017(UTC)
Posts: 2
United States

I am looking at creating a custom extension that would allow us to initiate a "support" session with a client without their initial interaction.
This would be used in a domain environment that we administer.
The end goal would be for us to be able to use Powershell to start the session rather than asking the user to navigate to ScreenConnect, Join with a code, etc.

The Powershell would look something like:

Create-SCSession -ComputerName ComputerA

This would:
-Create a new session
-Download an exe/msi
-Run the executable
-Join the user to the support session

Has anyone got this functionality to work in this manner?

Do you have any ideas on how to achieve this?

Thanks
Scott  
#2 Posted : Thursday, October 26, 2017 11:05:23 AM(UTC)
Scott


Rank: Administration

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

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

Thanks: 3 times
Was thanked: 305 time(s) in 262 post(s)
So basically you're looking for a way to do all of this from the command line?

Creating the session is pretty simple, you can wrap a basic CreateSupportSession or something in a WebService within an extension and just invoke that to get the sessionID.

Your Extension would also have a method to return the Client Launch Parameters which you could then pass directly to ClickOnce (or something similar) to actually launch it.

I suggest taking a good look at the Guest Support Session Exe Extension as it does pretty much exactly what you're looking for, but you'd need to write something to actually invoke the .application file.
ScreenConnect Team
cybersecfun  
#3 Posted : Thursday, October 26, 2017 12:24:34 PM(UTC)
cybersecfun


Rank: Guest

Joined: 10/25/2017(UTC)
Posts: 2
United States

Exactly! I have gotten as far as creating a new extension and using the "CreateSession" feature which works well.

Where I am stuck is actually having it downloaded the exe with the appropriate parameters. The Guest Support Session Exe extension requests the user to enter a name for the session. I attempted to take this part out but I can't seem to get it to work with the new SessionID that is generated and download the appropriate EXE.MSI would be the best option but at least the EXE.
Scott  
#4 Posted : Thursday, October 26, 2017 12:45:16 PM(UTC)
Scott


Rank: Administration

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

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

Thanks: 3 times
Was thanked: 305 time(s) in 262 post(s)
So you really have two options here. Your script can pass dummy information/whatever for the sessionName or you can just remove it entirely and have the WebService method create a value (or whatever).

And that GetLaunchFileAndSetUrl method returns a handler of type ClickOnceDirect (which is a .application file).

Within the exe, this file is passed to ClickOnce with the following import statement:

Code:

[DllImport("dfshim", CharSet = CharSet.Auto)]


And then the actual invocation:
Code:

public static async Task CreateAndConnectToSessionAsync(string sessionName)
		{
			//launchurl contains client launch parameters retrieved from server specific to clickoncedirecthandler
			var launchUrl = await Program.CallServiceMethodAsync<string>(
							"GetLaunchFileAndSetUrl",
							sessionName
			);

			if (launchUrl == null)
				throw new InvalidOperationException("Session not found.");

			Program.ShOpenVerbApplication(IntPtr.Zero, IntPtr.Zero, launchUrl, 0);
		}


Keeping powershell's ability to hook into .NET dlls that are created "correctly" I would imagine you could implement similar functionality within a script.
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.