diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index 87ea9dac..8a9f9136 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -1300,6 +1300,11 @@ namespace WebsitePanel.EnterpriseServer List remoteAppsToAdd = remoteApps.Where(x => !existingCollectionApps.Select(p => p.DisplayName).Contains(x.DisplayName)).ToList(); foreach (var app in remoteAppsToAdd) { + if (!string.IsNullOrEmpty(app.RequiredCommandLine)) + { + app.RequiredCommandLine = string.Format("/v:{0}", collection.Servers.First().FqdName); + } + AddRemoteApplicationToCollection(itemId, collection, app); } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs index f15a5fe1..300f8b47 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs @@ -35,5 +35,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices public string FilePath { get; set; } public string FileVirtualPath { get; set; } public bool ShowInWebAccess { get; set; } + public string RequiredCommandLine { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 508b691c..a7380569 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -742,6 +742,12 @@ namespace WebsitePanel.Providers.RemoteDesktopServices cmd.Parameters.Add("FilePath", remoteApp.FilePath); cmd.Parameters.Add("ShowInWebAccess", remoteApp.ShowInWebAccess); + if (!string.IsNullOrEmpty(remoteApp.RequiredCommandLine)) + { + cmd.Parameters.Add("CommandLineSetting", "Require"); + cmd.Parameters.Add("RequiredCommandLine", remoteApp.RequiredCommandLine); + } + ExecuteShellCommand(runSpace, cmd, false); result = true; @@ -1157,6 +1163,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices ShowInWebAccess = Convert.ToBoolean(GetPSObjectProperty(psObject, "ShowInWebAccess")) }; + var requiredCommandLine = GetPSObjectProperty(psObject, "RequiredCommandLine"); + remoteApp.RequiredCommandLine = requiredCommandLine == null ? null : requiredCommandLine.ToString(); + return remoteApp; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx index 0adb8a73..85e03fdd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionApps.ascx.resx @@ -138,6 +138,9 @@ Delete + + Add Full Desktop Connection + Remote Application Name diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx index ecae4947..386d3a51 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx @@ -6,6 +6,7 @@
+
+ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs index 2bcf719d..defa1be5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs @@ -50,7 +50,7 @@ namespace WebsitePanel.Portal.RDS.UserControls } public void SetApps(RemoteApplication[] apps) - { + { BindApps(apps, false); } @@ -104,9 +104,25 @@ namespace WebsitePanel.Portal.RDS.UserControls List selectedApps = GetPopUpGridViewApps(); BindApps(selectedApps.ToArray(), true); - } + protected void btnFullDesktopConnection_Click(object sender, EventArgs e) + { + var newApps = new RemoteApplication[] + { + new RemoteApplication + { + DisplayName = "Session Host", + FilePath = "%SystemRoot%\\system32\\mstsc.exe", + Alias = "mstsc", + RequiredCommandLine = "/v:", + ShowInWebAccess = true + } + }; + + BindApps(newApps, true); + } + protected void BindPopupApps() { RdsCollection collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID); @@ -127,7 +143,7 @@ namespace WebsitePanel.Portal.RDS.UserControls } protected void BindApps(RemoteApplication[] newApps, bool preserveExisting) - { + { // get binded addresses List apps = new List(); if(preserveExisting) @@ -156,6 +172,11 @@ namespace WebsitePanel.Portal.RDS.UserControls } } + if (apps.Any(a => a.DisplayName.Equals("session host", StringComparison.CurrentCultureIgnoreCase))) + { + btnFullDesktopConnection.Enabled = false; + } + gvApps.DataSource = apps; gvApps.DataBind(); } @@ -174,6 +195,7 @@ namespace WebsitePanel.Portal.RDS.UserControls app.Alias = (string)gvApps.DataKeys[i][0]; app.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text; app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).Value; + app.RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLine")).Value; if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.designer.cs index 6c195540..7e892653 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.designer.cs @@ -39,6 +39,15 @@ namespace WebsitePanel.Portal.RDS.UserControls { /// protected global::System.Web.UI.WebControls.Button btnDelete; + /// + /// btnFullDesktopConnection control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnFullDesktopConnection; + /// /// gvApps control. ///