*Edit* One of my in house guys, lemtargatwing, was able to figure out that "var userDisplayName" needs to be "string userDisplayName" in 5.6.
invoke-webrequest : Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error
details and modify your source code appropriately.
Compiler Error Message: CS0121: The call is ambiguous between the following methods or properties:
'ScreenConnect.ServerExtensions.GetStandardVariables(string)' and
'ScreenConnect.ServerExtensions.GetStandardVariables(System.Security.Principal.IPrincipal)'
Source Error:
Line 18: var relayUri = ServerExtensions.GetRelayUri(ConfigurationManager.AppSettings, HttpContext.Current.Request.Url, true, true);
Line 19: var userDisplayName = FormsAuthenticationModule.GetUserDisplayNameWithFallback(HttpContext.Current.User);
Line 20: var variables = ServerExtensions.GetStandardVariables(userDisplayName);
Line 21: var handlerUrl = ServerExtensions.GetWebServerUri(ConfigurationManager.AppSettings, HttpContext.Current.Request.Url, true, true) +
WebConfigurationManager.GetHandlerPath(typeof(ClickOnceDirectHandler)).ReplaceFirst("*", WebResources.GetString("FileDownload.BaseName"));
Line 22:
Source File: c:\Program Files (x86)\ScreenConnect\LHC.ashx Line: 20
Show Detailed Compiler Output:
C:\Windows\system32> "C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe" /t:library /utf8output
/R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.Web\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Program Files
(x86)\ScreenConnect\Bin\ScreenConnect.Web.dll" /R:"C:\Program Files (x86)\ScreenConnect\Bin\ScreenConnect.Client.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.ApplicationServices\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.ApplicationServices.dll"
/R:"C:\Program Files (x86)\ScreenConnect\bin\ScreenConnect.ClientService.dll" /R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ComponentModel.Data
Annotations\v4.0_4.0.0.0__31bf3856ad364e35\System.ComponentModel.DataAnnotations.dll" /R:"C:\Program Files
(x86)\ScreenConnect\Bin\ScreenConnect.WindowsInstaller.dll" /R:"C:\Program Files (x86)\ScreenConnect\Bin\ScreenConnect.Windows.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Services\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.Activities.dll" /R:"C:\Program Files
(x86)\ScreenConnect\Bin\ScreenConnect.Core.dll" /R:"C:\Program Files (x86)\ScreenConnect\Bin\ScreenConnect.Relay.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0__b77a5c561934e089\System.Runtime.Serialization.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Web\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Web.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll" /R:"C:\Program Files
(x86)\ScreenConnect\Bin\ScreenConnect.WindowsServer.dll" /R:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Program Files
(x86)\ScreenConnect\Bin\ScreenConnect.Server.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.IdentityModel\v4.0_4.0.0.0__b77a5c561934e089\System.IdentityModel.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.DataSetExtensions\v4.0_4.0.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.Extensions\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.Extensions.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.WorkflowServices\v4.0_4.0.0.0__31bf3856ad364e35\System.WorkflowServices.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.DynamicData\v4.0_4.0.0.0__31bf3856ad364e35\System.Web.DynamicData.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activation\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activation.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Windows.Forms\v4.0_4.0.0.0__b77a5c561934e089\System.Windows.Forms.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel.Activities\v4.0_4.0.0.0__31bf3856ad364e35\System.ServiceModel.Activities.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.Linq\v4.0_4.0.0.0__b77a5c561934e089\System.Data.Linq.dll"
/R:"C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.ServiceModel\v4.0_4.0.0.0__b77a5c561934e089\System.ServiceModel.dll"
/out:"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\35c504ff\e26c2568\App_Web_lhc.ashx.cdcab7d2.tuejmfa0.dll" /D:DEBUG
/debug+ /optimize- /w:4 /nowarn:1659;1699;1701;612;618 /nowarn:1685 /warnaserror- "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files\root\35c504ff\e26c2568\App_Web_lhc.ashx.cdcab7d2.tuejmfa0.0.cs" "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
Files\root\35c504ff\e26c2568\App_Web_lhc.ashx.cdcab7d2.tuejmfa0.1.cs"
Microsoft (R) Visual C# Compiler version 4.6.1055.0
for Microsoft (R) .NET Framework 4.5
Copyright (C) Microsoft Corporation. All rights reserved.
c:\Program Files (x86)\ScreenConnect\LHC.ashx(20,25): error CS0121: The call is ambiguous between the following methods or properties:
'ScreenConnect.ServerExtensions.GetStandardVariables(string)' and
'ScreenConnect.ServerExtensions.GetStandardVariables(System.Security.Principal.IPrincipal)'
Show Complete Compilation Source:
Line 1: #pragma checksum "C:\Program Files (x86)\ScreenConnect\LHC.ashx" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}"
"9A18C597B9F8AF68B2028076D5EF94709005EBF7"
Line 2:
Line 3: #line 1 "C:\Program Files (x86)\ScreenConnect\LHC.ashx"
Line 4:
Line 5:
Line 6: using System;
Line 7: using System.Web;
Line 8: using System.Collections.Generic;
Line 9: using System.Linq;
Line 10: using System.Configuration;
Line 11: using ScreenConnect;
Line 12:
Line 13: public class LaunchHostClient : IHttpHandler
Line 14: {
Line 15: public void ProcessRequest(HttpContext context)
Line 16: {
Line 17: var permissionEntries = Permissions.GetEntriesForUser();
Line 18: Permissions.AssertAnyPermission(permissionEntries);
Line 19:
Line 20: var sessionFilter = ServerExtensions.GetExpression("SessionID", "=", context.Request.QueryString["ID"]);
Line 21: var relayUri = ServerExtensions.GetRelayUri(ConfigurationManager.AppSettings, HttpContext.Current.Request.Url, true, true);
Line 22: var userDisplayName = FormsAuthenticationModule.GetUserDisplayNameWithFallback(HttpContext.Current.User);
Line 23: var variables = ServerExtensions.GetStandardVariables(userDisplayName);
Line 24: var handlerUrl = ServerExtensions.GetWebServerUri(ConfigurationManager.AppSettings, HttpContext.Current.Request.Url, true, true) +
WebConfigurationManager.GetHandlerPath(typeof(ClickOnceDirectHandler)).ReplaceFirst("*", WebResources.GetString("FileDownload.BaseName"));
Line 25:
Line 26: (from session in SessionManagerPool.Demux.GetSessions(sessionFilter)
Line 27: from groupContainingSession in SessionManagerPool.Demux.GetSessionGroupsContainingSession(session.SessionID, variables)
Line 28: where Permissions.HasPermission(new SessionPermissionRequest { Name = PermissionInfo.ViewSessionGroupPermission, SessionType =
session.SessionType, SessionGroupName = groupContainingSession }, permissionEntries)
Line 29: let sessionPermissions = PermissionInfo.GetSessionPermissions(permissionEntries, session.SessionType, groupContainingSession,
session.Host == userDisplayName)
Line 30: select new ClientLaunchParameters
Line 31: {
Line 32: Host = relayUri.Host,
Line 33: Port = relayUri.Port,
Line 34: EncryptionKey = ServerCryptoManager.Instance.PublicKey,
Line 35: SessionType = session.SessionType,
Line 36: SessionID = session.SessionID,
Line 37: ProcessType = ProcessType.Host,
Line 38: SessionTitle = session.Name,
Line 39: AccessToken = ServerCryptoManager.Instance.GetAccessToken(session.SessionID, ProcessType.Host, userDisplayName,
sessionPermissions, default(DateTime)),
Line 40: })
Line 41: .FirstOrDefault()
Line 42: .SafeDo(clp => context.Response.Write(new Uri(handlerUrl + ClientLaunchParameters.ToQueryString(clp)).AbsoluteUri));
Line 43: }
Line 44:
Line 45: public bool IsReusable { get { return false; } }
Line 46: }
Line 47:
Line 48: #line default
Line 49: #line hidden
Line 50:
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1069.1
At line:1 char:4
+ $r=invoke-webrequest -uri
https://sc.fqdn.com/LHC.ashx?ID=0f5d432c-66e0-4e ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand