diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index afc2a442..dad53cc7 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -532,9 +532,23 @@ namespace WebsitePanel.EnterpriseServer private static int AddRdsCollectionInternal(int itemId, RdsCollection collection) { var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "ADD_RDS_COLLECTION"); + var domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName; try { + foreach(var server in collection.Servers) + { + if (!server.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase)) + { + throw TaskManager.WriteError(new Exception("Fully Qualified Domain Name not valid.")); + } + + if (!CheckRDSServerAvaliable(server.FqdName)) + { + throw TaskManager.WriteError(new Exception(string.Format("Unable to connect to {0} server.", server.FqdName))); + } + } + // load organization Organization org = OrganizationController.GetOrganization(itemId); if (org == null) @@ -822,7 +836,7 @@ namespace WebsitePanel.EnterpriseServer FillRdsServerData(tmpServer); } - result.Servers = tmpServers.ToArray(); + result.Servers = tmpServers.ToArray(); return result; } @@ -1016,25 +1030,22 @@ namespace WebsitePanel.EnterpriseServer { if (CheckRDSServerAvaliable(rdsServer.FqdName)) { - rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description); + var domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName; + + if (rdsServer.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase)) + { + rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description); + } + else + { + throw TaskManager.WriteError(new Exception("Fully Qualified Domain Name not valid.")); + } } else { - result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_SERVER", new Exception("The server that you are adding, is not available")); - return result; + throw TaskManager.WriteError(new Exception(string.Format("Unable to connect to {0} server. Please double check Server Full Name setting and retry.", rdsServer.FqdName))); } - } - catch (Exception ex) - { - if (ex.InnerException != null) - { - result.AddError("Unable to add RDS Server", ex.InnerException); - } - else - { - result.AddError("Unable to add RDS Server", ex); - } - } + } finally { if (!result.IsSuccess) @@ -1753,7 +1764,7 @@ namespace WebsitePanel.EnterpriseServer { bool result = false; var ping = new Ping(); - var reply = ping.Send(hostname, 1000); + var reply = ping.Send(hostname, 1000); if (reply.Status == IPStatus.Success) { @@ -1761,8 +1772,7 @@ namespace WebsitePanel.EnterpriseServer } return result; - } - + } private static ResultObject DeleteRemoteDesktopServiceInternal(int itemId) { @@ -1811,7 +1821,7 @@ namespace WebsitePanel.EnterpriseServer private static RemoteDesktopServices GetRemoteDesktopServices(int serviceId) { var rds = new RemoteDesktopServices(); - ServiceProviderProxy.Init(rds, serviceId); + ServiceProviderProxy.Init(rds, serviceId); return rds; } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServersPaged.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServersPaged.cs index db523c2d..199ab34f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServersPaged.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServersPaged.cs @@ -26,11 +26,12 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + namespace WebsitePanel.Providers.RemoteDesktopServices { public class RdsServersPaged { public int RecordsCount { get; set; } - public RdsServer[] Servers { get; set; } + public RdsServer[] Servers { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index d86af8ba..930584d2 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -1343,7 +1343,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { runSpace = OpenRunspace(); var feature = AddFeature(runSpace, hostName, "RDS-RD-Server", true, true); - installationResult = (bool)GetPSObjectProperty(feature, "Success"); + installationResult = (bool)GetPSObjectProperty(feature, "Success"); + + if (!IsFeatureInstalled(hostName, "Desktop-Experience", runSpace)) + { + feature = AddFeature(runSpace, hostName, "Desktop-Experience", true, false); + } + + if (!IsFeatureInstalled(hostName, "NET-Framework-Core", runSpace)) + { + feature = AddFeature(runSpace, hostName, "NET-Framework-Core", true, false); + } } finally { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index 27590807..5269c27d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5656,6 +5656,9 @@ Session host certificate not installed + + RDS Server not added + Session host certificate has been installed diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx index d98a066e..62f67170 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/RDS_Settings.ascx @@ -10,7 +10,7 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCreateCollection.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCreateCollection.ascx.cs index 2d21ad7e..5f09adc8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCreateCollection.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCreateCollection.ascx.cs @@ -69,7 +69,7 @@ namespace WebsitePanel.Portal.RDS } catch (Exception ex) { - messageBox.ShowErrorMessage("RDSCOLLECTION_NOT_CREATED", ex); + ShowErrorMessage("RDSCOLLECTION_NOT_CREATED", ex); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditApplicationUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditApplicationUsers.ascx.cs index 2a9be753..4b4d828b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditApplicationUsers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditApplicationUsers.ascx.cs @@ -52,6 +52,15 @@ namespace WebsitePanel.Portal.RDS txtApplicationName.Text = remoteApp.DisplayName; //var remoteAppUsers = organizationUsers.Where(x => applicationUsers.Contains(x.AccountName)); var remoteAppUsers = organizationUsers.Where(x => applicationUsers.Select(a => a.Split('\\').Last().ToLower()).Contains(x.SamAccountName.Split('\\').Last().ToLower())); + var localAdmins = ES.Services.RDS.GetRdsCollectionLocalAdmins(PanelRequest.CollectionID); + + foreach(var user in remoteAppUsers) + { + if (localAdmins.Select(l => l.AccountName).Contains(user.AccountName)) + { + user.IsVIP = true; + } + } users.SetUsers(remoteAppUsers.ToArray()); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionUsers.ascx.cs index 767eab4f..f18e7ad0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionUsers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditCollectionUsers.ascx.cs @@ -27,6 +27,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Linq; using System.Web.UI.WebControls; using WebsitePanel.EnterpriseServer; using WebsitePanel.Providers.Common; @@ -45,6 +46,15 @@ namespace WebsitePanel.Portal.RDS BindQuota(); var collectionUsers = ES.Services.RDS.GetRdsCollectionUsers(PanelRequest.CollectionID); var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID); + var localAdmins = ES.Services.RDS.GetRdsCollectionLocalAdmins(PanelRequest.CollectionID); + + foreach (var user in collectionUsers) + { + if (localAdmins.Select(l => l.AccountName).Contains(user.AccountName)) + { + user.IsVIP = true; + } + } litCollectionName.Text = collection.DisplayName; users.SetUsers(collectionUsers); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSLocalAdmins.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSLocalAdmins.ascx.cs index 1ea540d9..d65093ef 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSLocalAdmins.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSLocalAdmins.ascx.cs @@ -4,6 +4,8 @@ using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.RemoteDesktopServices; namespace WebsitePanel.Portal.RDS { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx index 4ba1e5c0..93432cd3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx @@ -23,8 +23,9 @@ - + + @@ -81,6 +82,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx.cs index fdd2e6ce..f4fbbd8f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx.cs @@ -132,6 +132,15 @@ namespace WebsitePanel.Portal.RDS.UserControls protected void BindPopupAccounts() { OrganizationUser[] accounts = ES.Services.Organizations.GetOrganizationUsersPaged(PanelRequest.ItemID, null, null, null, 0, Int32.MaxValue).PageUsers; + var localAdmins = ES.Services.RDS.GetRdsCollectionLocalAdmins(PanelRequest.CollectionID); + + foreach (var user in accounts) + { + if (localAdmins.Select(l => l.AccountName).Contains(user.AccountName)) + { + user.IsVIP = true; + } + } accounts = accounts.Where(x => !GetUsers().Select(p => p.AccountName).Contains(x.AccountName)).ToArray(); Array.Sort(accounts, CompareAccount); @@ -221,7 +230,8 @@ namespace WebsitePanel.Portal.RDS.UserControls { AccountName = (string)gvPopupAccounts.DataKeys[i][0], DisplayName = ((Literal)row.FindControl("litDisplayName")).Text, - SamAccountName = ((HiddenField)row.FindControl("hdnSamName")).Value + SamAccountName = ((HiddenField)row.FindControl("hdnSamName")).Value, + IsVIP = Convert.ToBoolean(((HiddenField)row.FindControl("hdnLocalAdmin")).Value) }); } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDSServers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDSServers.ascx index 1a6ef547..61130777 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDSServers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDSServers.ascx @@ -15,10 +15,8 @@ - - -
+
100 - - + +
+ + + + + + + + - - - - - - +