From 789cd6ca11c069d1e7ebb6c8b75993c1bc1cbe21 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 27 Feb 2015 02:30:22 -0800 Subject: [PATCH] Small fixes --- .../Windows2012.cs | 30 +++++++++++++++---- .../WebsitePanel/RDS/RDSCollections.ascx | 4 +-- .../WebsitePanel/RDS/RDSCollections.ascx.cs | 4 +++ .../RDS/UserControls/RDSCollectionApps.ascx | 6 ++-- .../UserControls/RDSCollectionApps.ascx.cs | 8 +++++ 5 files changed, 41 insertions(+), 11 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 5e547dcb..dea195b8 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -67,11 +67,12 @@ namespace WebsitePanel.Providers.RemoteDesktopServices private const string RdsGroupFormat = "rds-{0}-{1}"; private const string RdsModuleName = "RemoteDesktopServices"; private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\""; - private const string WspAdministratorsGroupName = "WSP-Administrators"; - private const string WspAdministratorsGroupDescription = "WSP Administrators"; + private const string WspAdministratorsGroupName = "WSP-Org-Administrators"; + private const string WspAdministratorsGroupDescription = "WSP Org Administrators"; private const string RdsServersOU = "RDSServers"; private const string RDSHelpDeskComputerGroup = "Websitepanel-RDSHelpDesk-Computer"; - private const string RDSHelpDeskAdminsGroup = "WSP-HelpdeskAdmins"; + private const string RDSHelpDeskGroup = "WSP-HelpDeskAdministrators"; + private const string RDSHelpDeskGroupDescription = "WSP Help Desk Administrators"; #endregion @@ -1178,14 +1179,31 @@ namespace WebsitePanel.Providers.RemoteDesktopServices private void AddHelpDeskAdminsGroupToLocalAdmins(Runspace runspace, string hostName) { - var helpDeskAdminsGroupPath = GetHelpDeskGroupPath(RDSHelpDeskAdminsGroup); + var helpDeskAdminsGroupPath = GetHelpDeskGroupPath(RDSHelpDeskGroup); + DirectoryEntry groupEntry = null; if (!ActiveDirectoryUtils.AdObjectExists(helpDeskAdminsGroupPath)) { - ActiveDirectoryUtils.CreateGroup(GetRootOUPath(), RDSHelpDeskAdminsGroup); + ActiveDirectoryUtils.CreateGroup(GetRootOUPath(), RDSHelpDeskGroup); + groupEntry = ActiveDirectoryUtils.GetADObject(helpDeskAdminsGroupPath); + + if (groupEntry.Properties.Contains("Description")) + { + groupEntry.Properties["Description"][0] = RDSHelpDeskGroupDescription; + } + else + { + groupEntry.Properties["Description"].Add(RDSHelpDeskGroupDescription); + } + + groupEntry.CommitChanges(); + } + + if (groupEntry == null) + { + groupEntry = ActiveDirectoryUtils.GetADObject(helpDeskAdminsGroupPath); } - var groupEntry = ActiveDirectoryUtils.GetADObject(helpDeskAdminsGroupPath); var samAccountName = ActiveDirectoryUtils.GetADObjectProperty(groupEntry, "sAMAccountName"); var scripts = new List diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx index 52e148f2..a311aaa3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx @@ -47,8 +47,8 @@ - - <%# Eval("DisplayName").ToString() %> + + <%# Eval("DisplayName").ToString() %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx.cs index f7a57731..efdaaa56 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx.cs @@ -95,6 +95,10 @@ namespace WebsitePanel.Portal.RDS ShowErrorMessage("REMOTE_DESKTOP_SERVICES_REMOVE_COLLECTION", ex); } } + else if (e.CommandName == "EditCollection") + { + Response.Redirect(GetCollectionEditUrl(e.CommandArgument.ToString())); + } } protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) 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 02806956..bbc141f1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx @@ -9,7 +9,7 @@ @@ -24,8 +24,8 @@ - - + + 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 22651296..15bf0ecc 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 @@ -254,6 +254,14 @@ namespace WebsitePanel.Portal.RDS.UserControls BindPopupApps(); } + protected void gvApps_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "EditApplication") + { + Response.Redirect(GetCollectionUsersEditUrl(e.CommandArgument.ToString())); + } + } + protected SortDirection Direction { get { return ViewState[DirectionString] == null ? SortDirection.Descending : (SortDirection)ViewState[DirectionString]; }