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

Notification

Icon
Error

Options
Go to last post Go to first unread
willjasen  
#1 Posted : Wednesday, March 1, 2017 6:36:18 PM(UTC)
willjasen


Rank: Guest

Joined: 3/1/2017(UTC)
Posts: 3
United States
Location: Johnson City, TN

I have pieced together a Powershell script to transcode the screen recordings as created using Extended Auditing. The most helpful bit of script has been http://forum.screenconnect.com/yaf_postst10038_Powershell-transcoding.aspx as softland's follow up comment resolved the same singleton error I was running into when piecing it together. However, now I run into:

Quote:
Error processing C:\Program Files (x86)\ScreenConnect\App_Data\Session\03f00ef3
-5b9a-46a2-8831-14aee2d246cf-31ba1975-9a66-4bec-ae2f-be2b0c76a482-2017-02-23-16
-22-03: Method invocation failed because [ScreenConnect.WindowsToolkit] does no
t contain a method named 'CreateVideoFileEncoder'.
Encountered error, stopping.


Every indication that I'm seeing shows that this bit of script should work, but it looks as if the method within the libraries being referenced doesn't exist, so my question is: if it was working for everyone else, why not me and where did it go? I have played around a bit to list out the methods within the library but I don't see any method named "CreateVideoFileEncoder" in at least the places I have looked.

The code I am using is available here: https://github.com/TUCTechnologies/ScreenConnectTranscode
Scott  
#2 Posted : Thursday, March 2, 2017 2:09:32 PM(UTC)
Scott


Rank: Administration

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

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

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
What version of ScreenConnect are you using for those libraries?
ScreenConnect Team
willjasen  
#3 Posted : Saturday, March 4, 2017 2:50:06 AM(UTC)
willjasen


Rank: Guest

Joined: 3/1/2017(UTC)
Posts: 3
United States
Location: Johnson City, TN

Originally Posted by: Scott Go to Quoted Post
What version of ScreenConnect are you using for those libraries?


It is relatively up-to-date.

Your Version:6.1.12292.6236
Latest Version:6.1.12292.6236
Latest Eligible Version:On Latest Eligible
Scott  
#4 Posted : Monday, March 20, 2017 4:45:13 PM(UTC)
Scott


Rank: Administration

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

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

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
Ah, we split the toolkit for that into ServerToolkit. The following should work in 6.1:
Code:

$ScreenConnectDir = "C:\Program Files (x86)\ScreenConnect"
Add-Type -Path (Get-Item "$ScreenConnectDir\bin\ScreenConnect.Core.dll").FullName
Add-Type -Path (Get-Item "$ScreenConnectDir\bin\ScreenConnect.Server.dll").FullName
Add-Type -Path (Get-Item "$ScreenConnectDir\bin\ScreenConnect.Windows.dll").FullName

foreach ($captureFile in Get-ChildItem("$ScreenConnectDir\App_Data\Session\*"))
{
    Try
    {
        $inputStream = [System.IO.File]::OpenRead($captureFile.FullName)
	    $toolkitInstance = [ScreenConnect.ServerToolkit]::Instance
	    $encoder = $toolkitInstance.CreateVideoFileEncoder()
        [ScreenConnect.ServerExtensions]::Transcode($inputStream, $encoder, $captureFile.FullName + ".avi")
    }
    Catch
    {
        echo "Error processing $($captureFile): $($Error[0])"
	    Write-Host "Encountered error, stopping."
	    break
    }
}
ScreenConnect Team
willjasen  
#5 Posted : Monday, March 20, 2017 7:09:56 PM(UTC)
willjasen


Rank: Guest

Joined: 3/1/2017(UTC)
Posts: 3
United States
Location: Johnson City, TN

Thanks, this name update worked!

Is there any documentation available that shows methods like these? Next up for me is to be able to name the resulting transcoded file as something a little more user-friendly using the session details, like <date>-<computer_name>.avi and I have found relatively little documentation on my own so far.

Originally Posted by: Scott Go to Quoted Post
Ah, we split the toolkit for that into ServerToolkit. The following should work in 6.1:
Code:

$ScreenConnectDir = "C:\Program Files (x86)\ScreenConnect"
Add-Type -Path (Get-Item "$ScreenConnectDir\bin\ScreenConnect.Core.dll").FullName
Add-Type -Path (Get-Item "$ScreenConnectDir\bin\ScreenConnect.Server.dll").FullName
Add-Type -Path (Get-Item "$ScreenConnectDir\bin\ScreenConnect.Windows.dll").FullName

foreach ($captureFile in Get-ChildItem("$ScreenConnectDir\App_Data\Session\*"))
{
    Try
    {
        $inputStream = [System.IO.File]::OpenRead($captureFile.FullName)
	    $toolkitInstance = [ScreenConnect.ServerToolkit]::Instance
	    $encoder = $toolkitInstance.CreateVideoFileEncoder()
        [ScreenConnect.ServerExtensions]::Transcode($inputStream, $encoder, $captureFile.FullName + ".avi")
    }
    Catch
    {
        echo "Error processing $($captureFile): $($Error[0])"
	    Write-Host "Encountered error, stopping."
	    break
    }
}


Scott  
#6 Posted : Tuesday, April 11, 2017 2:13:04 PM(UTC)
Scott


Rank: Administration

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

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

Thanks: 3 times
Was thanked: 291 time(s) in 249 post(s)
Quote:
Is there any documentation available that shows methods like these? Next up for me is to be able to name the resulting transcoded file as something a little more user-friendly using the session details, like <date>-<computer_name>.avi and I have found relatively little documentation on my own so far.


To my knowledge there isn't any documentation pertaining to this code directly.

Now, it is possible to get additional information about a session from just the capture file, albeit a bit complicated. As you've probably noticed the session capture filename is made up of two GUIDs and a date, example 1b352556-85e9-42ea-9e58-4ed3c0632b53-75d4185e-acc3-414b-a0e8-fdd23225ed7a-2017-02-22-15-58-21.

The first GUID is the relevant session's SessionID (1b352556-85e9-42ea-9e58-4ed3c0632b53), the second guid is the connection's ConnectionID (75d4185e-acc3-414b-a0e8-fdd23225ed7a), and the date in UTC when the capture was created (2017-02-22-15-58-21).

Using the SessionID you can hit the Session Manager method GetSession(sessionID) to retrieve the information about the session you would like to use.
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.