diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index 4d7fd9ff..b2388d93 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -836,6 +836,7 @@ namespace WebsitePanel.EnterpriseServer } rds.AddSessionHostServersToCollection(org.OrganizationId, collection.Name, newServers.ToArray()); + rds.MoveSessionHostsToCollectionOU(collection.Servers.ToArray(), collection.Name, org.OrganizationId); foreach (var server in newServers) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs index a2113c2e..2cfe5b06 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs @@ -83,5 +83,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices void MoveSessionHostToRdsOU(string hostName); void ApplyGPO(string organizationId, string collectionName, RdsServerSettings serverSettings); void ShadowSession(string sessionId, bool control); + void MoveSessionHostsToCollectionOU(List servers, string collectionName, string organizationId); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 95bfca5d..d510960f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -637,6 +637,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices } } + public void MoveSessionHostsToCollectionOU(List servers, string collectionName, string organizationId) + { + foreach(var server in servers) + { + MoveSessionHostToCollectionOU(server.Name, collectionName, organizationId); + } + } + public void RemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server) { Runspace runSpace = null; diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs index 924cfa7d..bbd90595 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs @@ -106,6 +106,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { private System.Threading.SendOrPostCallback ShadowSessionOperationCompleted; + private System.Threading.SendOrPostCallback MoveSessionHostsToCollectionOUOperationCompleted; + /// public RemoteDesktopServices() { this.Url = "http://localhost:9003/RemoteDesktopServices.asmx"; @@ -225,6 +227,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// public event ShadowSessionCompletedEventHandler ShadowSessionCompleted; + /// + public event MoveSessionHostsToCollectionOUCompletedEventHandler MoveSessionHostsToCollectionOUCompleted; + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -1882,6 +1887,52 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/MoveSessionHostsToCollectionOU", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void MoveSessionHostsToCollectionOU(RdsServer[] servers, string collectionName, string organizationId) { + this.Invoke("MoveSessionHostsToCollectionOU", new object[] { + servers, + collectionName, + organizationId}); + } + + /// + public System.IAsyncResult BeginMoveSessionHostsToCollectionOU(RdsServer[] servers, string collectionName, string organizationId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("MoveSessionHostsToCollectionOU", new object[] { + servers, + collectionName, + organizationId}, callback, asyncState); + } + + /// + public void EndMoveSessionHostsToCollectionOU(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void MoveSessionHostsToCollectionOUAsync(RdsServer[] servers, string collectionName, string organizationId) { + this.MoveSessionHostsToCollectionOUAsync(servers, collectionName, organizationId, null); + } + + /// + public void MoveSessionHostsToCollectionOUAsync(RdsServer[] servers, string collectionName, string organizationId, object userState) { + if ((this.MoveSessionHostsToCollectionOUOperationCompleted == null)) { + this.MoveSessionHostsToCollectionOUOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMoveSessionHostsToCollectionOUOperationCompleted); + } + this.InvokeAsync("MoveSessionHostsToCollectionOU", new object[] { + servers, + collectionName, + organizationId}, this.MoveSessionHostsToCollectionOUOperationCompleted, userState); + } + + private void OnMoveSessionHostsToCollectionOUOperationCompleted(object arg) { + if ((this.MoveSessionHostsToCollectionOUCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.MoveSessionHostsToCollectionOUCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); @@ -2523,4 +2574,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void ShadowSessionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void MoveSessionHostsToCollectionOUCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs index c246e544..e28846eb 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs @@ -695,5 +695,21 @@ namespace WebsitePanel.Server throw; } } + + [WebMethod, SoapHeader("settings")] + public void MoveSessionHostsToCollectionOU(List servers, string collectionName, string organizationId) + { + try + { + Log.WriteStart("'{0}' MoveSessionHostsToCollectionOU", ProviderSettings.ProviderName); + RDSProvider.MoveSessionHostsToCollectionOU(servers, collectionName, organizationId); + Log.WriteEnd("'{0}' MoveSessionHostsToCollectionOU", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' MoveSessionHostsToCollectionOU", ProviderSettings.ProviderName), ex); + throw; + } + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSSetupLetter.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSSetupLetter.ascx.resx index 61c375b4..a5c69ade 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSSetupLetter.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSSetupLetter.ascx.resx @@ -138,4 +138,7 @@ * Enter E-Mail + + Back to Users List + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx index 42fbacb1..23f91360 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx @@ -18,7 +18,7 @@
- + @@ -41,13 +41,13 @@ - - - - - - + +
+ + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.cs index 41e33a4a..c50344f7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.cs @@ -59,5 +59,10 @@ namespace WebsitePanel.Portal.RDS return; } } + + protected void btnExit_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "rds_collection_edit_users", "CollectionId=" + PanelRequest.CollectionID, "ItemID=" + PanelRequest.ItemID)); + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.designer.cs index 7a8f53e8..32a49f96 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSSetupLetter.ascx.designer.cs @@ -129,6 +129,15 @@ namespace WebsitePanel.Portal.RDS { /// protected global::System.Web.UI.WebControls.TextBox txtCC; + /// + /// btnExit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnExit; + /// /// btnSend control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs index cb563662..9165638c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs @@ -26,8 +26,7 @@ namespace WebsitePanel.Portal.RDS.UserControls tabsList.Add(CreateTab("rds_collection_edit_apps", "Tab.RdsApplications")); tabsList.Add(CreateTab("rds_collection_edit_users", "Tab.RdsUsers")); tabsList.Add(CreateTab("rds_collection_user_sessions", "Tab.UserSessions")); - tabsList.Add(CreateTab("rds_collection_local_admins", "Tab.LocalAdmins")); - tabsList.Add(CreateTab("rds_setup_letter", "Tab.RdsSetupLetter")); + tabsList.Add(CreateTab("rds_collection_local_admins", "Tab.LocalAdmins")); int idx = 0;