From 2e97811d339a3696f64dbbf8574bc340550465be Mon Sep 17 00:00:00 2001 From: "a.skorina" Date: Mon, 10 Nov 2014 11:14:15 +0300 Subject: [PATCH] RDS provider + controller --- WebsitePanel/Database/update_db.sql | 657 ++++- .../Servers/ResourceGroups.cs | 1 + .../RemoteDesktopServicesProxy.cs | 2424 ++++++++++++++++- .../Data/DataProvider.cs | 283 ++ .../HostedSolution/OrganizationController.cs | 7 + .../RemoteDesktopServicesController.cs | 1031 ++++++- .../esRemoteDesktopServices.asmx.cs | 179 +- .../HostedSolution/ActiveDirectoryUtils.cs | 25 + .../IRemoteDesktopServices.cs | 23 +- .../RemoteDesktopServices/RdsCollection.cs | 21 + .../RdsCollectionPaged.cs | 8 + .../RemoteDesktopServices/RdsServer.cs | 22 + .../RemoteDesktopServices/RdsServersPaged.cs | 8 + .../RemoteApplication.cs | 11 + .../SessionHostServer.cs | 11 + .../RemoteDesktopServices/StartMenuApp.cs | 9 + .../WebsitePanel.Providers.Base.csproj | 7 + ...s.RemoteDesktopServices.Windows2012.csproj | 2 + .../Windows2012.cs | 1345 ++++++++- .../RemoteDesktopServicesProxy.cs | 1325 ++++++++- .../RemoteDesktopServices.asmx.cs | 270 ++ 21 files changed, 7552 insertions(+), 117 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollection.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollectionPaged.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServersPaged.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/SessionHostServer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/StartMenuApp.cs diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 98849b0c..3a409483 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -2403,7 +2403,7 @@ INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupContr END GO --- RDS Quota +-- RDS Quotas IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'RDS.Users') BEGIN @@ -2411,6 +2411,12 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDe END GO +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'RDS.Servers') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (451, 45, 2, N'RDS.Servers',N'Remote Desktop Servers',2, 0 , NULL) +END +GO + -- RDS Provider IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Remote Desktop Services Windows 2012') @@ -5416,4 +5422,651 @@ close c deallocate c -GO \ No newline at end of file +GO + + + +/*Remote Desktop Services*/ + +/*Remote Desktop Services Tables*/ +IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollectionUsers') +DROP TABLE RDSCollectionUsers +GO +CREATE TABLE RDSCollectionUsers +( + ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY, + RDSCollectionId INT NOT NULL, + AccountID INT NOT NULL +) +GO + + +IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSServers') +DROP TABLE RDSServers +GO +CREATE TABLE RDSServers +( + ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY, + ItemID INT, + Name NVARCHAR(255), + FqdName NVARCHAR(255), + Description NVARCHAR(255), + RDSCollectionId INT/* FOREIGN KEY REFERENCES RDSCollection (ID)*/ +) +GO + + +IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'RDSCollections') +DROP TABLE RDSCollections +GO +CREATE TABLE RDSCollections +( + ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY, + ItemID INT NOT NULL, + Name NVARCHAR(255), + Description NVARCHAR(255) +) +GO + +ALTER TABLE [dbo].[RDSCollectionUsers] WITH CHECK ADD CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId] FOREIGN KEY([RDSCollectionId]) +REFERENCES [dbo].[RDSCollections] ([ID]) +ON DELETE CASCADE +GO + + +ALTER TABLE [dbo].[RDSCollectionUsers] WITH CHECK ADD CONSTRAINT [FK_RDSCollectionUsers_UserId] FOREIGN KEY([AccountID]) +REFERENCES [dbo].[ExchangeAccounts] ([AccountID]) +ON DELETE CASCADE +GO + +ALTER TABLE [dbo].[RDSServers] WITH CHECK ADD CONSTRAINT [FK_RDSServers_RDSCollectionId] FOREIGN KEY([RDSCollectionId]) +REFERENCES [dbo].[RDSCollections] ([ID]) +GO + +/*Remote Desktop Services Procedures*/ + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSServer') +DROP PROCEDURE AddRDSServer +GO +CREATE PROCEDURE [dbo].[AddRDSServer] +( + @RDSServerID INT OUTPUT, + @Name NVARCHAR(255), + @FqdName NVARCHAR(255), + @Description NVARCHAR(255) +) +AS +INSERT INTO RDSServers +( + Name, + FqdName, + Description +) +VALUES +( + @Name, + @FqdName, + @Description +) + +SET @RDSServerID = SCOPE_IDENTITY() + +RETURN +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'DeleteRDSServer') +DROP PROCEDURE DeleteRDSServer +GO +CREATE PROCEDURE [dbo].[DeleteRDSServer] +( + @Id int +) +AS +DELETE FROM RDSServers +WHERE Id = @Id +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'UpdateRDSServer') +DROP PROCEDURE UpdateRDSServer +GO +CREATE PROCEDURE [dbo].[UpdateRDSServer] +( + @Id INT, + @ItemID INT, + @Name NVARCHAR(255), + @FqdName NVARCHAR(255), + @Description NVARCHAR(255), + @RDSCollectionId INT +) +AS + +UPDATE RDSServers +SET + ItemID = @ItemID, + Name = @Name, + FqdName = @FqdName, + Description = @Description, + RDSCollectionId = @RDSCollectionId +WHERE ID = @Id +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSServerToOrganization') +DROP PROCEDURE AddRDSServerToOrganization +GO +CREATE PROCEDURE [dbo].[AddRDSServerToOrganization] +( + @Id INT, + @ItemID INT +) +AS + +UPDATE RDSServers +SET + ItemID = @ItemID +WHERE ID = @Id +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'RemoveRDSServerFromOrganization') +DROP PROCEDURE RemoveRDSServerFromOrganization +GO +CREATE PROCEDURE [dbo].[RemoveRDSServerFromOrganization] +( + @Id INT +) +AS + +UPDATE RDSServers +SET + ItemID = NULL +WHERE ID = @Id +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSServerToCollection') +DROP PROCEDURE AddRDSServerToCollection +GO +CREATE PROCEDURE [dbo].[AddRDSServerToCollection] +( + @Id INT, + @RDSCollectionId INT +) +AS + +UPDATE RDSServers +SET + RDSCollectionId = @RDSCollectionId +WHERE ID = @Id +GO + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'RemoveRDSServerFromCollection') +DROP PROCEDURE RemoveRDSServerFromCollection +GO +CREATE PROCEDURE [dbo].[RemoveRDSServerFromCollection] +( + @Id INT +) +AS + +UPDATE RDSServers +SET + RDSCollectionId = NULL +WHERE ID = @Id +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSServersByItemId') +DROP PROCEDURE GetRDSServersByItemId +GO +CREATE PROCEDURE [dbo].[GetRDSServersByItemId] +( + @ItemID INT +) +AS +SELECT + RS.Id, + RS.ItemID, + RS.Name, + RS.FqdName, + RS.Description, + RS.RdsCollectionId, + SI.ItemName + FROM RDSServers AS RS + LEFT OUTER JOIN ServiceItems AS SI ON SI.ItemId = RS.ItemId + WHERE RS.ItemID = @ItemID +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSServers') +DROP PROCEDURE GetRDSServers +GO +CREATE PROCEDURE [dbo].[GetRDSServers] +AS +SELECT + RS.Id, + RS.ItemID, + RS.Name, + RS.FqdName, + RS.Description, + RS.RdsCollectionId, + SI.ItemName + FROM RDSServers AS RS + LEFT OUTER JOIN ServiceItems AS SI ON SI.ItemId = RS.ItemId +GO + + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSServerById') +DROP PROCEDURE GetRDSServerById +GO +CREATE PROCEDURE [dbo].[GetRDSServerById] +( + @ID INT +) +AS +SELECT TOP 1 + RS.Id, + RS.ItemID, + RS.Name, + RS.FqdName, + RS.Description, + RS.RdsCollectionId, + SI.ItemName + FROM RDSServers AS RS + LEFT OUTER JOIN ServiceItems AS SI ON SI.ItemId = RS.ItemId + WHERE Id = @Id +GO + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSServersByCollectionId') +DROP PROCEDURE GetRDSServersByCollectionId +GO +CREATE PROCEDURE [dbo].[GetRDSServersByCollectionId] +( + @RdsCollectionId INT +) +AS +SELECT + RS.Id, + RS.ItemID, + RS.Name, + RS.FqdName, + RS.Description, + RS.RdsCollectionId, + SI.ItemName + FROM RDSServers AS RS + LEFT OUTER JOIN ServiceItems AS SI ON SI.ItemId = RS.ItemId + WHERE RdsCollectionId = @RdsCollectionId +GO + + + + + + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSServersPaged') +DROP PROCEDURE GetRDSServersPaged +GO +CREATE PROCEDURE [dbo].[GetRDSServersPaged] +( + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @ItemID int, + @IgnoreItemId bit, + @RdsCollectionId int, + @IgnoreRdsCollectionId bit, + @SortColumn nvarchar(50), + @StartRow int, + @MaximumRows int +) +AS +-- build query and run it to the temporary table +DECLARE @sql nvarchar(2000) + +SET @sql = ' + +DECLARE @EndRow int +SET @EndRow = @StartRow + @MaximumRows + +DECLARE @RDSServer TABLE +( + ItemPosition int IDENTITY(0,1), + RDSServerId int +) +INSERT INTO @RDSServer (RDSServerId) +SELECT + S.ID +FROM RDSServers AS S +WHERE + ((((@ItemID is Null AND S.ItemID is null) or @IgnoreItemId = 1) + or (@ItemID is not Null AND S.ItemID = @ItemID)) + and + (((@RdsCollectionId is Null AND S.RDSCollectionId is null) or @IgnoreRdsCollectionId = 1) + or (@RdsCollectionId is not Null AND S.RDSCollectionId = @RdsCollectionId)))' + +IF @FilterColumn <> '' AND @FilterValue <> '' +SET @sql = @sql + ' AND ' + @FilterColumn + ' LIKE @FilterValue ' + +IF @SortColumn <> '' AND @SortColumn IS NOT NULL +SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' ' + +SET @sql = @sql + ' SELECT COUNT(RDSServerId) FROM @RDSServer; +SELECT + ST.ID, + ST.ItemID, + ST.Name, + ST.FqdName, + ST.Description, + ST.RdsCollectionId, + SI.ItemName +FROM @RDSServer AS S +INNER JOIN RDSServers AS ST ON S.RDSServerId = ST.ID +LEFT OUTER JOIN ServiceItems AS SI ON SI.ItemId = ST.ItemId +WHERE S.ItemPosition BETWEEN @StartRow AND @EndRow' + +exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @FilterValue nvarchar(50), @ItemID int, @RdsCollectionId int, @IgnoreItemId bit, @IgnoreRdsCollectionId bit', +@StartRow, @MaximumRows, @FilterValue, @ItemID, @RdsCollectionId, @IgnoreItemId , @IgnoreRdsCollectionId + + +RETURN + +GO +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO + + + + + + + + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSCollectionsPaged') +DROP PROCEDURE GetRDSCollectionsPaged +GO +CREATE PROCEDURE [dbo].[GetRDSCollectionsPaged] +( + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @ItemID int, + @SortColumn nvarchar(50), + @StartRow int, + @MaximumRows int +) +AS +-- build query and run it to the temporary table +DECLARE @sql nvarchar(2000) + +SET @sql = ' + +DECLARE @EndRow int +SET @EndRow = @StartRow + @MaximumRows +DECLARE @RDSCollections TABLE +( + ItemPosition int IDENTITY(0,1), + RDSCollectionId int +) +INSERT INTO @RDSCollections (RDSCollectionId) +SELECT + S.ID +FROM RDSCollections AS S +WHERE + ((@ItemID is Null AND S.ItemID is null) + or (@ItemID is not Null AND S.ItemID = @ItemID))' + +IF @FilterColumn <> '' AND @FilterValue <> '' +SET @sql = @sql + ' AND ' + @FilterColumn + ' LIKE @FilterValue ' + +IF @SortColumn <> '' AND @SortColumn IS NOT NULL +SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' ' + +SET @sql = @sql + ' SELECT COUNT(RDSCollectionId) FROM @RDSCollections; +SELECT + CR.ID, + CR.ItemID, + CR.Name, + CR.Description +FROM @RDSCollections AS C +INNER JOIN RDSCollections AS CR ON C.RDSCollectionId = CR.ID +WHERE C.ItemPosition BETWEEN @StartRow AND @EndRow' + +exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @FilterValue nvarchar(50), @ItemID int', +@StartRow, @MaximumRows, @FilterValue, @ItemID + + +RETURN + +GO +SET ANSI_NULLS ON +GO +SET QUOTED_IDENTIFIER ON +GO + + + + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSCollectionsByItemId') +DROP PROCEDURE GetRDSCollectionsByItemId +GO +CREATE PROCEDURE [dbo].[GetRDSCollectionsByItemId] +( + @ItemID INT +) +AS +SELECT + Id, + ItemId, + Name, + Description + FROM RDSCollections + WHERE ItemID = @ItemID +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSCollectionByName') +DROP PROCEDURE GetRDSCollectionByName +GO +CREATE PROCEDURE [dbo].[GetRDSCollectionByName] +( + @Name NVARCHAR(255) +) +AS + +SELECT TOP 1 + Id, + Name, + ItemId, + Description + FROM RDSCollections + WHERE Name = @Name +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSCollectionById') +DROP PROCEDURE GetRDSCollectionById +GO +CREATE PROCEDURE [dbo].[GetRDSCollectionById] +( + @ID INT +) +AS + +SELECT TOP 1 + Id, + ItemId, + Name, + Description + FROM RDSCollections + WHERE ID = @ID +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSCollection') +DROP PROCEDURE AddRDSCollection +GO +CREATE PROCEDURE [dbo].[AddRDSCollection] +( + @RDSCollectionID INT OUTPUT, + @ItemID INT, + @Name NVARCHAR(255), + @Description NVARCHAR(255) +) +AS + +INSERT INTO RDSCollections +( + ItemID, + Name, + Description +) +VALUES +( + @ItemID, + @Name, + @Description +) + +SET @RDSCollectionID = SCOPE_IDENTITY() + +RETURN +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'UpdateRDSCollection') +DROP PROCEDURE UpdateRDSCollection +GO +CREATE PROCEDURE [dbo].[UpdateRDSCollection] +( + @ID INT, + @ItemID INT, + @Name NVARCHAR(255), + @Description NVARCHAR(255) +) +AS + +UPDATE RDSCollections +SET + ItemID = @ItemID, + Name = @Name, + Description = @Description +WHERE ID = @Id +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'DeleteRDSCollection') +DROP PROCEDURE DeleteRDSCollection +GO +CREATE PROCEDURE [dbo].[DeleteRDSCollection] +( + @Id int +) +AS + +UPDATE RDSServers +SET + RDSCollectionId = Null +WHERE RDSCollectionId = @Id + +DELETE FROM RDSCollections +WHERE Id = @Id +GO + + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSCollectionUsersByRDSCollectionId') +DROP PROCEDURE GetRDSCollectionUsersByRDSCollectionId +GO +CREATE PROCEDURE [dbo].[GetRDSCollectionUsersByRDSCollectionId] +( + @ID INT +) +AS +SELECT + [AccountID], + [ItemID], + [AccountType], + [AccountName], + [DisplayName], + [PrimaryEmailAddress], + [MailEnabledPublicFolder], + [MailboxManagerActions], + [SamAccountName], + [AccountPassword], + [CreatedDate], + [MailboxPlanId], + [SubscriberNumber], + [UserPrincipalName], + [ExchangeDisclaimerId], + [ArchivingMailboxPlanId], + [EnableArchiving], + [LevelID], + [IsVIP] + FROM ExchangeAccounts + WHERE AccountID IN (Select AccountId from RDSCollectionUsers where RDSCollectionId = @Id) +GO + + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddUserToRDSCollection') +DROP PROCEDURE AddUserToRDSCollection +GO +CREATE PROCEDURE [dbo].[AddUserToRDSCollection] +( + @RDSCollectionID INT, + @AccountId INT +) +AS + +INSERT INTO RDSCollectionUsers +( + RDSCollectionId, + AccountID +) +VALUES +( + @RDSCollectionID, + @AccountId +) +GO + + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'RemoveRDSUserFromRDSCollection') +DROP PROCEDURE RemoveRDSUserFromRDSCollection +GO +CREATE PROCEDURE [dbo].[RemoveRDSUserFromRDSCollection] +( + @AccountId INT, + @RDSCollectionId INT +) +AS + + +DELETE FROM RDSCollectionUsers +WHERE AccountId = @AccountId AND RDSCollectionId = @RDSCollectionId +GO + + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetOrganizationRdsUsersCount') +DROP PROCEDURE GetOrganizationRdsUsersCount +GO +CREATE PROCEDURE [dbo].GetOrganizationRdsUsersCount +( + @ItemID INT, + @TotalNumber int OUTPUT +) +AS +SELECT + @TotalNumber = Count([RDSCollectionId]) + FROM [dbo].[RDSCollectionUsers] + WHERE [RDSCollectionId] in (SELECT [ID] FROM [RDSCollections] where [ItemId] = @ItemId ) +RETURN +GO diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs index 9494443f..624a885d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs @@ -56,5 +56,6 @@ namespace WebsitePanel.EnterpriseServer public const string Lync = "Lync"; public const string EnterpriseStorage = "EnterpriseStorage"; public const string ServiceLevels = "Service Levels"; + public const string RDS = "RDS"; } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs index 5367eaf5..d2deb586 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs @@ -39,26 +39,2428 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.3038. // + +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.RemoteDesktopServices; + namespace WebsitePanel.EnterpriseServer { - using System.Xml.Serialization; - using System.Web.Services; - using System.ComponentModel; - using System.Web.Services.Protocols; using System; + using System.ComponentModel; using System.Diagnostics; - - + using System.Web.Services; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + /// - // CODEGEN: No methods were found in the WSDL for this protocol. [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name="esRemoteDesktopServicesSoap", Namespace="http://smbsaas/websitepanel/enterpriseserver")] - public partial class esRemoteDesktopServices : Microsoft.Web.Services3.WebServicesClientProtocol { - + [System.Web.Services.WebServiceBindingAttribute(Name = "esRemoteDesktopServicesSoap", Namespace = "http://smbsaas/websitepanel/enterpriseserver")] + public partial class esRemoteDesktopServices : Microsoft.Web.Services3.WebServicesClientProtocol + { + + private System.Threading.SendOrPostCallback GetRdsCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback GetOrganizationRdsCollectionsOperationCompleted; + + private System.Threading.SendOrPostCallback AddRdsCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback GetRdsCollectionsPagedOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveRdsCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback GetRdsServersPagedOperationCompleted; + + private System.Threading.SendOrPostCallback GetFreeRdsServersPagedOperationCompleted; + + private System.Threading.SendOrPostCallback GetOrganizationRdsServersPagedOperationCompleted; + + private System.Threading.SendOrPostCallback GetOrganizationFreeRdsServersPagedOperationCompleted; + + private System.Threading.SendOrPostCallback GetRdsServerOperationCompleted; + + private System.Threading.SendOrPostCallback GetCollectionRdsServersOperationCompleted; + + private System.Threading.SendOrPostCallback GetOrganizationRdsServersOperationCompleted; + + private System.Threading.SendOrPostCallback AddRdsServerOperationCompleted; + + private System.Threading.SendOrPostCallback AddRdsServerToCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback AddRdsServerToOrganizationOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveRdsServerOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveRdsServerFromCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveRdsServerFromOrganizationOperationCompleted; + + private System.Threading.SendOrPostCallback UpdateRdsServerOperationCompleted; + + private System.Threading.SendOrPostCallback GetRdsCollectionUsersOperationCompleted; + + private System.Threading.SendOrPostCallback SetUsersToRdsCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback GetCollectionRemoteApplicationsOperationCompleted; + + private System.Threading.SendOrPostCallback GetAvailableRemoteApplicationsOperationCompleted; + + private System.Threading.SendOrPostCallback AddRemoteApplicationToCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveRemoteApplicationFromCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback SetRemoteApplicationsToRdsCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback GetOrganizationRdsUsersCountOperationCompleted; + /// - public esRemoteDesktopServices() { + public esRemoteDesktopServices() + { this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx"; } + + /// + public event GetRdsCollectionCompletedEventHandler GetRdsCollectionCompleted; + + /// + public event GetOrganizationRdsCollectionsCompletedEventHandler GetOrganizationRdsCollectionsCompleted; + + /// + public event AddRdsCollectionCompletedEventHandler AddRdsCollectionCompleted; + + /// + public event GetRdsCollectionsPagedCompletedEventHandler GetRdsCollectionsPagedCompleted; + + /// + public event RemoveRdsCollectionCompletedEventHandler RemoveRdsCollectionCompleted; + + /// + public event GetRdsServersPagedCompletedEventHandler GetRdsServersPagedCompleted; + + /// + public event GetFreeRdsServersPagedCompletedEventHandler GetFreeRdsServersPagedCompleted; + + /// + public event GetOrganizationRdsServersPagedCompletedEventHandler GetOrganizationRdsServersPagedCompleted; + + /// + public event GetOrganizationFreeRdsServersPagedCompletedEventHandler GetOrganizationFreeRdsServersPagedCompleted; + + /// + public event GetRdsServerCompletedEventHandler GetRdsServerCompleted; + + /// + public event GetCollectionRdsServersCompletedEventHandler GetCollectionRdsServersCompleted; + + /// + public event GetOrganizationRdsServersCompletedEventHandler GetOrganizationRdsServersCompleted; + + /// + public event AddRdsServerCompletedEventHandler AddRdsServerCompleted; + + /// + public event AddRdsServerToCollectionCompletedEventHandler AddRdsServerToCollectionCompleted; + + /// + public event AddRdsServerToOrganizationCompletedEventHandler AddRdsServerToOrganizationCompleted; + + /// + public event RemoveRdsServerCompletedEventHandler RemoveRdsServerCompleted; + + /// + public event RemoveRdsServerFromCollectionCompletedEventHandler RemoveRdsServerFromCollectionCompleted; + + /// + public event RemoveRdsServerFromOrganizationCompletedEventHandler RemoveRdsServerFromOrganizationCompleted; + + /// + public event UpdateRdsServerCompletedEventHandler UpdateRdsServerCompleted; + + /// + public event GetRdsCollectionUsersCompletedEventHandler GetRdsCollectionUsersCompleted; + + /// + public event SetUsersToRdsCollectionCompletedEventHandler SetUsersToRdsCollectionCompleted; + + /// + public event GetCollectionRemoteApplicationsCompletedEventHandler GetCollectionRemoteApplicationsCompleted; + + /// + public event GetAvailableRemoteApplicationsCompletedEventHandler GetAvailableRemoteApplicationsCompleted; + + /// + public event AddRemoteApplicationToCollectionCompletedEventHandler AddRemoteApplicationToCollectionCompleted; + + /// + public event RemoveRemoteApplicationFromCollectionCompletedEventHandler RemoveRemoteApplicationFromCollectionCompleted; + + /// + public event SetRemoteApplicationsToRdsCollectionCompletedEventHandler SetRemoteApplicationsToRdsCollectionCompleted; + + /// + public event GetOrganizationRdsUsersCountCompletedEventHandler GetOrganizationRdsUsersCountCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollection", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RdsCollection GetRdsCollection(int collectionId) + { + object[] results = this.Invoke("GetRdsCollection", new object[] { + collectionId}); + return ((RdsCollection)(results[0])); + } + + /// + public System.IAsyncResult BeginGetRdsCollection(int collectionId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetRdsCollection", new object[] { + collectionId}, callback, asyncState); + } + + /// + public RdsCollection EndGetRdsCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RdsCollection)(results[0])); + } + + /// + public void GetRdsCollectionAsync(int collectionId) + { + this.GetRdsCollectionAsync(collectionId, null); + } + + /// + public void GetRdsCollectionAsync(int collectionId, object userState) + { + if ((this.GetRdsCollectionOperationCompleted == null)) + { + this.GetRdsCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCollectionOperationCompleted); + } + this.InvokeAsync("GetRdsCollection", new object[] { + collectionId}, this.GetRdsCollectionOperationCompleted, userState); + } + + private void OnGetRdsCollectionOperationCompleted(object arg) + { + if ((this.GetRdsCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetRdsCollectionCompleted(this, new GetRdsCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetOrganizationRdsCollections", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RdsCollection[] GetOrganizationRdsCollections(int itemId) + { + object[] results = this.Invoke("GetOrganizationRdsCollections", new object[] { + itemId}); + return ((RdsCollection[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetOrganizationRdsCollections(int itemId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetOrganizationRdsCollections", new object[] { + itemId}, callback, asyncState); + } + + /// + public RdsCollection[] EndGetOrganizationRdsCollections(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RdsCollection[])(results[0])); + } + + /// + public void GetOrganizationRdsCollectionsAsync(int itemId) + { + this.GetOrganizationRdsCollectionsAsync(itemId, null); + } + + /// + public void GetOrganizationRdsCollectionsAsync(int itemId, object userState) + { + if ((this.GetOrganizationRdsCollectionsOperationCompleted == null)) + { + this.GetOrganizationRdsCollectionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationRdsCollectionsOperationCompleted); + } + this.InvokeAsync("GetOrganizationRdsCollections", new object[] { + itemId}, this.GetOrganizationRdsCollectionsOperationCompleted, userState); + } + + private void OnGetOrganizationRdsCollectionsOperationCompleted(object arg) + { + if ((this.GetOrganizationRdsCollectionsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetOrganizationRdsCollectionsCompleted(this, new GetOrganizationRdsCollectionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddRdsCollection", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject AddRdsCollection(int itemId, RdsCollection collection) + { + object[] results = this.Invoke("AddRdsCollection", new object[] { + itemId, + collection}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginAddRdsCollection(int itemId, RdsCollection collection, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddRdsCollection", new object[] { + itemId, + collection}, callback, asyncState); + } + + /// + public ResultObject EndAddRdsCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void AddRdsCollectionAsync(int itemId, RdsCollection collection) + { + this.AddRdsCollectionAsync(itemId, collection, null); + } + + /// + public void AddRdsCollectionAsync(int itemId, RdsCollection collection, object userState) + { + if ((this.AddRdsCollectionOperationCompleted == null)) + { + this.AddRdsCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddRdsCollectionOperationCompleted); + } + this.InvokeAsync("AddRdsCollection", new object[] { + itemId, + collection}, this.AddRdsCollectionOperationCompleted, userState); + } + + private void OnAddRdsCollectionOperationCompleted(object arg) + { + if ((this.AddRdsCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddRdsCollectionCompleted(this, new AddRdsCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollectionsPaged", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RdsCollectionPaged GetRdsCollectionsPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + object[] results = this.Invoke("GetRdsCollectionsPaged", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}); + return ((RdsCollectionPaged)(results[0])); + } + + /// + public System.IAsyncResult BeginGetRdsCollectionsPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetRdsCollectionsPaged", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public RdsCollectionPaged EndGetRdsCollectionsPaged(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RdsCollectionPaged)(results[0])); + } + + /// + public void GetRdsCollectionsPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + this.GetRdsCollectionsPagedAsync(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); + } + + /// + public void GetRdsCollectionsPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetRdsCollectionsPagedOperationCompleted == null)) + { + this.GetRdsCollectionsPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCollectionsPagedOperationCompleted); + } + this.InvokeAsync("GetRdsCollectionsPaged", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, this.GetRdsCollectionsPagedOperationCompleted, userState); + } + + private void OnGetRdsCollectionsPagedOperationCompleted(object arg) + { + if ((this.GetRdsCollectionsPagedCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetRdsCollectionsPagedCompleted(this, new GetRdsCollectionsPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RemoveRdsCollection", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject RemoveRdsCollection(int itemId, RdsCollection collection) + { + object[] results = this.Invoke("RemoveRdsCollection", new object[] { + itemId, + collection}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginRemoveRdsCollection(int itemId, RdsCollection collection, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("RemoveRdsCollection", new object[] { + itemId, + collection}, callback, asyncState); + } + + /// + public ResultObject EndRemoveRdsCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void RemoveRdsCollectionAsync(int itemId, RdsCollection collection) + { + this.RemoveRdsCollectionAsync(itemId, collection, null); + } + + /// + public void RemoveRdsCollectionAsync(int itemId, RdsCollection collection, object userState) + { + if ((this.RemoveRdsCollectionOperationCompleted == null)) + { + this.RemoveRdsCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveRdsCollectionOperationCompleted); + } + this.InvokeAsync("RemoveRdsCollection", new object[] { + itemId, + collection}, this.RemoveRdsCollectionOperationCompleted, userState); + } + + private void OnRemoveRdsCollectionOperationCompleted(object arg) + { + if ((this.RemoveRdsCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveRdsCollectionCompleted(this, new RemoveRdsCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsServersPaged", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RdsServersPaged GetRdsServersPaged(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + object[] results = this.Invoke("GetRdsServersPaged", new object[] { + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}); + return ((RdsServersPaged)(results[0])); + } + + /// + public System.IAsyncResult BeginGetRdsServersPaged(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetRdsServersPaged", new object[] { + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public RdsServersPaged EndGetRdsServersPaged(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RdsServersPaged)(results[0])); + } + + /// + public void GetRdsServersPagedAsync(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + this.GetRdsServersPagedAsync(filterColumn, filterValue, sortColumn, startRow, maximumRows, null); + } + + /// + public void GetRdsServersPagedAsync(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetRdsServersPagedOperationCompleted == null)) + { + this.GetRdsServersPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServersPagedOperationCompleted); + } + this.InvokeAsync("GetRdsServersPaged", new object[] { + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, this.GetRdsServersPagedOperationCompleted, userState); + } + + private void OnGetRdsServersPagedOperationCompleted(object arg) + { + if ((this.GetRdsServersPagedCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetRdsServersPagedCompleted(this, new GetRdsServersPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetFreeRdsServersPaged", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RdsServersPaged GetFreeRdsServersPaged(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + object[] results = this.Invoke("GetFreeRdsServersPaged", new object[] { + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}); + return ((RdsServersPaged)(results[0])); + } + + /// + public System.IAsyncResult BeginGetFreeRdsServersPaged(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetFreeRdsServersPaged", new object[] { + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public RdsServersPaged EndGetFreeRdsServersPaged(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RdsServersPaged)(results[0])); + } + + /// + public void GetFreeRdsServersPagedAsync(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + this.GetFreeRdsServersPagedAsync(filterColumn, filterValue, sortColumn, startRow, maximumRows, null); + } + + /// + public void GetFreeRdsServersPagedAsync(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetFreeRdsServersPagedOperationCompleted == null)) + { + this.GetFreeRdsServersPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFreeRdsServersPagedOperationCompleted); + } + this.InvokeAsync("GetFreeRdsServersPaged", new object[] { + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, this.GetFreeRdsServersPagedOperationCompleted, userState); + } + + private void OnGetFreeRdsServersPagedOperationCompleted(object arg) + { + if ((this.GetFreeRdsServersPagedCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetFreeRdsServersPagedCompleted(this, new GetFreeRdsServersPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetOrganizationRdsServersPaged", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RdsServersPaged GetOrganizationRdsServersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + object[] results = this.Invoke("GetOrganizationRdsServersPaged", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}); + return ((RdsServersPaged)(results[0])); + } + + /// + public System.IAsyncResult BeginGetOrganizationRdsServersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetOrganizationRdsServersPaged", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public RdsServersPaged EndGetOrganizationRdsServersPaged(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RdsServersPaged)(results[0])); + } + + /// + public void GetOrganizationRdsServersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + this.GetOrganizationRdsServersPagedAsync(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); + } + + /// + public void GetOrganizationRdsServersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetOrganizationRdsServersPagedOperationCompleted == null)) + { + this.GetOrganizationRdsServersPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationRdsServersPagedOperationCompleted); + } + this.InvokeAsync("GetOrganizationRdsServersPaged", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, this.GetOrganizationRdsServersPagedOperationCompleted, userState); + } + + private void OnGetOrganizationRdsServersPagedOperationCompleted(object arg) + { + if ((this.GetOrganizationRdsServersPagedCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetOrganizationRdsServersPagedCompleted(this, new GetOrganizationRdsServersPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetOrganizationFreeRdsServersPaged", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RdsServersPaged GetOrganizationFreeRdsServersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + object[] results = this.Invoke("GetOrganizationFreeRdsServersPaged", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}); + return ((RdsServersPaged)(results[0])); + } + + /// + public System.IAsyncResult BeginGetOrganizationFreeRdsServersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetOrganizationFreeRdsServersPaged", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public RdsServersPaged EndGetOrganizationFreeRdsServersPaged(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RdsServersPaged)(results[0])); + } + + /// + public void GetOrganizationFreeRdsServersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + this.GetOrganizationFreeRdsServersPagedAsync(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); + } + + /// + public void GetOrganizationFreeRdsServersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetOrganizationFreeRdsServersPagedOperationCompleted == null)) + { + this.GetOrganizationFreeRdsServersPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationFreeRdsServersPagedOperationCompleted); + } + this.InvokeAsync("GetOrganizationFreeRdsServersPaged", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, this.GetOrganizationFreeRdsServersPagedOperationCompleted, userState); + } + + private void OnGetOrganizationFreeRdsServersPagedOperationCompleted(object arg) + { + if ((this.GetOrganizationFreeRdsServersPagedCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetOrganizationFreeRdsServersPagedCompleted(this, new GetOrganizationFreeRdsServersPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsServer", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RdsServer GetRdsServer(int rdsSeverId) + { + object[] results = this.Invoke("GetRdsServer", new object[] { + rdsSeverId}); + return ((RdsServer)(results[0])); + } + + /// + public System.IAsyncResult BeginGetRdsServer(int rdsSeverId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetRdsServer", new object[] { + rdsSeverId}, callback, asyncState); + } + + /// + public RdsServer EndGetRdsServer(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RdsServer)(results[0])); + } + + /// + public void GetRdsServerAsync(int rdsSeverId) + { + this.GetRdsServerAsync(rdsSeverId, null); + } + + /// + public void GetRdsServerAsync(int rdsSeverId, object userState) + { + if ((this.GetRdsServerOperationCompleted == null)) + { + this.GetRdsServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServerOperationCompleted); + } + this.InvokeAsync("GetRdsServer", new object[] { + rdsSeverId}, this.GetRdsServerOperationCompleted, userState); + } + + private void OnGetRdsServerOperationCompleted(object arg) + { + if ((this.GetRdsServerCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetRdsServerCompleted(this, new GetRdsServerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetCollectionRdsServers", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RdsServer[] GetCollectionRdsServers(int collectionId) + { + object[] results = this.Invoke("GetCollectionRdsServers", new object[] { + collectionId}); + return ((RdsServer[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetCollectionRdsServers(int collectionId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetCollectionRdsServers", new object[] { + collectionId}, callback, asyncState); + } + + /// + public RdsServer[] EndGetCollectionRdsServers(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RdsServer[])(results[0])); + } + + /// + public void GetCollectionRdsServersAsync(int collectionId) + { + this.GetCollectionRdsServersAsync(collectionId, null); + } + + /// + public void GetCollectionRdsServersAsync(int collectionId, object userState) + { + if ((this.GetCollectionRdsServersOperationCompleted == null)) + { + this.GetCollectionRdsServersOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCollectionRdsServersOperationCompleted); + } + this.InvokeAsync("GetCollectionRdsServers", new object[] { + collectionId}, this.GetCollectionRdsServersOperationCompleted, userState); + } + + private void OnGetCollectionRdsServersOperationCompleted(object arg) + { + if ((this.GetCollectionRdsServersCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetCollectionRdsServersCompleted(this, new GetCollectionRdsServersCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetOrganizationRdsServers", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RdsServer[] GetOrganizationRdsServers(int itemId) + { + object[] results = this.Invoke("GetOrganizationRdsServers", new object[] { + itemId}); + return ((RdsServer[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetOrganizationRdsServers(int itemId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetOrganizationRdsServers", new object[] { + itemId}, callback, asyncState); + } + + /// + public RdsServer[] EndGetOrganizationRdsServers(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RdsServer[])(results[0])); + } + + /// + public void GetOrganizationRdsServersAsync(int itemId) + { + this.GetOrganizationRdsServersAsync(itemId, null); + } + + /// + public void GetOrganizationRdsServersAsync(int itemId, object userState) + { + if ((this.GetOrganizationRdsServersOperationCompleted == null)) + { + this.GetOrganizationRdsServersOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationRdsServersOperationCompleted); + } + this.InvokeAsync("GetOrganizationRdsServers", new object[] { + itemId}, this.GetOrganizationRdsServersOperationCompleted, userState); + } + + private void OnGetOrganizationRdsServersOperationCompleted(object arg) + { + if ((this.GetOrganizationRdsServersCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetOrganizationRdsServersCompleted(this, new GetOrganizationRdsServersCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddRdsServer", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject AddRdsServer(RdsServer rdsServer) + { + object[] results = this.Invoke("AddRdsServer", new object[] { + rdsServer}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginAddRdsServer(RdsServer rdsServer, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddRdsServer", new object[] { + rdsServer}, callback, asyncState); + } + + /// + public ResultObject EndAddRdsServer(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void AddRdsServerAsync(RdsServer rdsServer) + { + this.AddRdsServerAsync(rdsServer, null); + } + + /// + public void AddRdsServerAsync(RdsServer rdsServer, object userState) + { + if ((this.AddRdsServerOperationCompleted == null)) + { + this.AddRdsServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddRdsServerOperationCompleted); + } + this.InvokeAsync("AddRdsServer", new object[] { + rdsServer}, this.AddRdsServerOperationCompleted, userState); + } + + private void OnAddRdsServerOperationCompleted(object arg) + { + if ((this.AddRdsServerCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddRdsServerCompleted(this, new AddRdsServerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddRdsServerToCollection", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject AddRdsServerToCollection(int itemId, RdsServer rdsServer, RdsCollection rdsCollection) + { + object[] results = this.Invoke("AddRdsServerToCollection", new object[] { + itemId, + rdsServer, + rdsCollection}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginAddRdsServerToCollection(int itemId, RdsServer rdsServer, RdsCollection rdsCollection, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddRdsServerToCollection", new object[] { + itemId, + rdsServer, + rdsCollection}, callback, asyncState); + } + + /// + public ResultObject EndAddRdsServerToCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void AddRdsServerToCollectionAsync(int itemId, RdsServer rdsServer, RdsCollection rdsCollection) + { + this.AddRdsServerToCollectionAsync(itemId, rdsServer, rdsCollection, null); + } + + /// + public void AddRdsServerToCollectionAsync(int itemId, RdsServer rdsServer, RdsCollection rdsCollection, object userState) + { + if ((this.AddRdsServerToCollectionOperationCompleted == null)) + { + this.AddRdsServerToCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddRdsServerToCollectionOperationCompleted); + } + this.InvokeAsync("AddRdsServerToCollection", new object[] { + itemId, + rdsServer, + rdsCollection}, this.AddRdsServerToCollectionOperationCompleted, userState); + } + + private void OnAddRdsServerToCollectionOperationCompleted(object arg) + { + if ((this.AddRdsServerToCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddRdsServerToCollectionCompleted(this, new AddRdsServerToCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddRdsServerToOrganization", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject AddRdsServerToOrganization(int itemId, int serverId) + { + object[] results = this.Invoke("AddRdsServerToOrganization", new object[] { + itemId, + serverId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginAddRdsServerToOrganization(int itemId, int serverId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddRdsServerToOrganization", new object[] { + itemId, + serverId}, callback, asyncState); + } + + /// + public ResultObject EndAddRdsServerToOrganization(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void AddRdsServerToOrganizationAsync(int itemId, int serverId) + { + this.AddRdsServerToOrganizationAsync(itemId, serverId, null); + } + + /// + public void AddRdsServerToOrganizationAsync(int itemId, int serverId, object userState) + { + if ((this.AddRdsServerToOrganizationOperationCompleted == null)) + { + this.AddRdsServerToOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddRdsServerToOrganizationOperationCompleted); + } + this.InvokeAsync("AddRdsServerToOrganization", new object[] { + itemId, + serverId}, this.AddRdsServerToOrganizationOperationCompleted, userState); + } + + private void OnAddRdsServerToOrganizationOperationCompleted(object arg) + { + if ((this.AddRdsServerToOrganizationCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddRdsServerToOrganizationCompleted(this, new AddRdsServerToOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RemoveRdsServer", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject RemoveRdsServer(int rdsServerId) + { + object[] results = this.Invoke("RemoveRdsServer", new object[] { + rdsServerId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginRemoveRdsServer(int rdsServerId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("RemoveRdsServer", new object[] { + rdsServerId}, callback, asyncState); + } + + /// + public ResultObject EndRemoveRdsServer(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void RemoveRdsServerAsync(int rdsServerId) + { + this.RemoveRdsServerAsync(rdsServerId, null); + } + + /// + public void RemoveRdsServerAsync(int rdsServerId, object userState) + { + if ((this.RemoveRdsServerOperationCompleted == null)) + { + this.RemoveRdsServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveRdsServerOperationCompleted); + } + this.InvokeAsync("RemoveRdsServer", new object[] { + rdsServerId}, this.RemoveRdsServerOperationCompleted, userState); + } + + private void OnRemoveRdsServerOperationCompleted(object arg) + { + if ((this.RemoveRdsServerCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveRdsServerCompleted(this, new RemoveRdsServerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RemoveRdsServerFromCollection", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject RemoveRdsServerFromCollection(int itemId, RdsServer rdsServer, RdsCollection rdsCollection) + { + object[] results = this.Invoke("RemoveRdsServerFromCollection", new object[] { + itemId, + rdsServer, + rdsCollection}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginRemoveRdsServerFromCollection(int itemId, RdsServer rdsServer, RdsCollection rdsCollection, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("RemoveRdsServerFromCollection", new object[] { + itemId, + rdsServer, + rdsCollection}, callback, asyncState); + } + + /// + public ResultObject EndRemoveRdsServerFromCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void RemoveRdsServerFromCollectionAsync(int itemId, RdsServer rdsServer, RdsCollection rdsCollection) + { + this.RemoveRdsServerFromCollectionAsync(itemId, rdsServer, rdsCollection, null); + } + + /// + public void RemoveRdsServerFromCollectionAsync(int itemId, RdsServer rdsServer, RdsCollection rdsCollection, object userState) + { + if ((this.RemoveRdsServerFromCollectionOperationCompleted == null)) + { + this.RemoveRdsServerFromCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveRdsServerFromCollectionOperationCompleted); + } + this.InvokeAsync("RemoveRdsServerFromCollection", new object[] { + itemId, + rdsServer, + rdsCollection}, this.RemoveRdsServerFromCollectionOperationCompleted, userState); + } + + private void OnRemoveRdsServerFromCollectionOperationCompleted(object arg) + { + if ((this.RemoveRdsServerFromCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveRdsServerFromCollectionCompleted(this, new RemoveRdsServerFromCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RemoveRdsServerFromOrganization", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject RemoveRdsServerFromOrganization(int rdsServerId) + { + object[] results = this.Invoke("RemoveRdsServerFromOrganization", new object[] { + rdsServerId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginRemoveRdsServerFromOrganization(int rdsServerId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("RemoveRdsServerFromOrganization", new object[] { + rdsServerId}, callback, asyncState); + } + + /// + public ResultObject EndRemoveRdsServerFromOrganization(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void RemoveRdsServerFromOrganizationAsync(int rdsServerId) + { + this.RemoveRdsServerFromOrganizationAsync(rdsServerId, null); + } + + /// + public void RemoveRdsServerFromOrganizationAsync(int rdsServerId, object userState) + { + if ((this.RemoveRdsServerFromOrganizationOperationCompleted == null)) + { + this.RemoveRdsServerFromOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveRdsServerFromOrganizationOperationCompleted); + } + this.InvokeAsync("RemoveRdsServerFromOrganization", new object[] { + rdsServerId}, this.RemoveRdsServerFromOrganizationOperationCompleted, userState); + } + + private void OnRemoveRdsServerFromOrganizationOperationCompleted(object arg) + { + if ((this.RemoveRdsServerFromOrganizationCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveRdsServerFromOrganizationCompleted(this, new RemoveRdsServerFromOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/UpdateRdsServer", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject UpdateRdsServer(RdsServer rdsServer) + { + object[] results = this.Invoke("UpdateRdsServer", new object[] { + rdsServer}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginUpdateRdsServer(RdsServer rdsServer, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("UpdateRdsServer", new object[] { + rdsServer}, callback, asyncState); + } + + /// + public ResultObject EndUpdateRdsServer(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void UpdateRdsServerAsync(RdsServer rdsServer) + { + this.UpdateRdsServerAsync(rdsServer, null); + } + + /// + public void UpdateRdsServerAsync(RdsServer rdsServer, object userState) + { + if ((this.UpdateRdsServerOperationCompleted == null)) + { + this.UpdateRdsServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateRdsServerOperationCompleted); + } + this.InvokeAsync("UpdateRdsServer", new object[] { + rdsServer}, this.UpdateRdsServerOperationCompleted, userState); + } + + private void OnUpdateRdsServerOperationCompleted(object arg) + { + if ((this.UpdateRdsServerCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateRdsServerCompleted(this, new UpdateRdsServerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollectionUsers", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUser[] GetRdsCollectionUsers(int collectionId) + { + object[] results = this.Invoke("GetRdsCollectionUsers", new object[] { + collectionId}); + return ((OrganizationUser[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetRdsCollectionUsers(int collectionId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetRdsCollectionUsers", new object[] { + collectionId}, callback, asyncState); + } + + /// + public OrganizationUser[] EndGetRdsCollectionUsers(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((OrganizationUser[])(results[0])); + } + + /// + public void GetRdsCollectionUsersAsync(int collectionId) + { + this.GetRdsCollectionUsersAsync(collectionId, null); + } + + /// + public void GetRdsCollectionUsersAsync(int collectionId, object userState) + { + if ((this.GetRdsCollectionUsersOperationCompleted == null)) + { + this.GetRdsCollectionUsersOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCollectionUsersOperationCompleted); + } + this.InvokeAsync("GetRdsCollectionUsers", new object[] { + collectionId}, this.GetRdsCollectionUsersOperationCompleted, userState); + } + + private void OnGetRdsCollectionUsersOperationCompleted(object arg) + { + if ((this.GetRdsCollectionUsersCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetRdsCollectionUsersCompleted(this, new GetRdsCollectionUsersCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetUsersToRdsCollection", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject SetUsersToRdsCollection(int itemId, int collectionId, OrganizationUser[] users) + { + object[] results = this.Invoke("SetUsersToRdsCollection", new object[] { + itemId, + collectionId, + users}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginSetUsersToRdsCollection(int itemId, int collectionId, OrganizationUser[] users, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SetUsersToRdsCollection", new object[] { + itemId, + collectionId, + users}, callback, asyncState); + } + + /// + public ResultObject EndSetUsersToRdsCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void SetUsersToRdsCollectionAsync(int itemId, int collectionId, OrganizationUser[] users) + { + this.SetUsersToRdsCollectionAsync(itemId, collectionId, users, null); + } + + /// + public void SetUsersToRdsCollectionAsync(int itemId, int collectionId, OrganizationUser[] users, object userState) + { + if ((this.SetUsersToRdsCollectionOperationCompleted == null)) + { + this.SetUsersToRdsCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUsersToRdsCollectionOperationCompleted); + } + this.InvokeAsync("SetUsersToRdsCollection", new object[] { + itemId, + collectionId, + users}, this.SetUsersToRdsCollectionOperationCompleted, userState); + } + + private void OnSetUsersToRdsCollectionOperationCompleted(object arg) + { + if ((this.SetUsersToRdsCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetUsersToRdsCollectionCompleted(this, new SetUsersToRdsCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetCollectionRemoteApplications", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public RemoteApplication[] GetCollectionRemoteApplications(int itemId, string collectionName) + { + object[] results = this.Invoke("GetCollectionRemoteApplications", new object[] { + itemId, + collectionName}); + return ((RemoteApplication[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetCollectionRemoteApplications(int itemId, string collectionName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetCollectionRemoteApplications", new object[] { + itemId, + collectionName}, callback, asyncState); + } + + /// + public RemoteApplication[] EndGetCollectionRemoteApplications(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RemoteApplication[])(results[0])); + } + + /// + public void GetCollectionRemoteApplicationsAsync(int itemId, string collectionName) + { + this.GetCollectionRemoteApplicationsAsync(itemId, collectionName, null); + } + + /// + public void GetCollectionRemoteApplicationsAsync(int itemId, string collectionName, object userState) + { + if ((this.GetCollectionRemoteApplicationsOperationCompleted == null)) + { + this.GetCollectionRemoteApplicationsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCollectionRemoteApplicationsOperationCompleted); + } + this.InvokeAsync("GetCollectionRemoteApplications", new object[] { + itemId, + collectionName}, this.GetCollectionRemoteApplicationsOperationCompleted, userState); + } + + private void OnGetCollectionRemoteApplicationsOperationCompleted(object arg) + { + if ((this.GetCollectionRemoteApplicationsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetCollectionRemoteApplicationsCompleted(this, new GetCollectionRemoteApplicationsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetAvailableRemoteApplications", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public StartMenuApp[] GetAvailableRemoteApplications(int itemId, string collectionName) + { + object[] results = this.Invoke("GetAvailableRemoteApplications", new object[] { + itemId, + collectionName}); + return ((StartMenuApp[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetAvailableRemoteApplications(int itemId, string collectionName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetAvailableRemoteApplications", new object[] { + itemId, + collectionName}, callback, asyncState); + } + + /// + public StartMenuApp[] EndGetAvailableRemoteApplications(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((StartMenuApp[])(results[0])); + } + + /// + public void GetAvailableRemoteApplicationsAsync(int itemId, string collectionName) + { + this.GetAvailableRemoteApplicationsAsync(itemId, collectionName, null); + } + + /// + public void GetAvailableRemoteApplicationsAsync(int itemId, string collectionName, object userState) + { + if ((this.GetAvailableRemoteApplicationsOperationCompleted == null)) + { + this.GetAvailableRemoteApplicationsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAvailableRemoteApplicationsOperationCompleted); + } + this.InvokeAsync("GetAvailableRemoteApplications", new object[] { + itemId, + collectionName}, this.GetAvailableRemoteApplicationsOperationCompleted, userState); + } + + private void OnGetAvailableRemoteApplicationsOperationCompleted(object arg) + { + if ((this.GetAvailableRemoteApplicationsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetAvailableRemoteApplicationsCompleted(this, new GetAvailableRemoteApplicationsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddRemoteApplicationToCollection", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject AddRemoteApplicationToCollection(int itemId, RdsCollection collection, RemoteApplication application) + { + object[] results = this.Invoke("AddRemoteApplicationToCollection", new object[] { + itemId, + collection, + application}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginAddRemoteApplicationToCollection(int itemId, RdsCollection collection, RemoteApplication application, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddRemoteApplicationToCollection", new object[] { + itemId, + collection, + application}, callback, asyncState); + } + + /// + public ResultObject EndAddRemoteApplicationToCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void AddRemoteApplicationToCollectionAsync(int itemId, RdsCollection collection, RemoteApplication application) + { + this.AddRemoteApplicationToCollectionAsync(itemId, collection, application, null); + } + + /// + public void AddRemoteApplicationToCollectionAsync(int itemId, RdsCollection collection, RemoteApplication application, object userState) + { + if ((this.AddRemoteApplicationToCollectionOperationCompleted == null)) + { + this.AddRemoteApplicationToCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddRemoteApplicationToCollectionOperationCompleted); + } + this.InvokeAsync("AddRemoteApplicationToCollection", new object[] { + itemId, + collection, + application}, this.AddRemoteApplicationToCollectionOperationCompleted, userState); + } + + private void OnAddRemoteApplicationToCollectionOperationCompleted(object arg) + { + if ((this.AddRemoteApplicationToCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddRemoteApplicationToCollectionCompleted(this, new AddRemoteApplicationToCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RemoveRemoteApplicationFromCollectio" + + "n", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject RemoveRemoteApplicationFromCollection(int itemId, RdsCollection collection, RemoteApplication application) + { + object[] results = this.Invoke("RemoveRemoteApplicationFromCollection", new object[] { + itemId, + collection, + application}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginRemoveRemoteApplicationFromCollection(int itemId, RdsCollection collection, RemoteApplication application, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("RemoveRemoteApplicationFromCollection", new object[] { + itemId, + collection, + application}, callback, asyncState); + } + + /// + public ResultObject EndRemoveRemoteApplicationFromCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void RemoveRemoteApplicationFromCollectionAsync(int itemId, RdsCollection collection, RemoteApplication application) + { + this.RemoveRemoteApplicationFromCollectionAsync(itemId, collection, application, null); + } + + /// + public void RemoveRemoteApplicationFromCollectionAsync(int itemId, RdsCollection collection, RemoteApplication application, object userState) + { + if ((this.RemoveRemoteApplicationFromCollectionOperationCompleted == null)) + { + this.RemoveRemoteApplicationFromCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveRemoteApplicationFromCollectionOperationCompleted); + } + this.InvokeAsync("RemoveRemoteApplicationFromCollection", new object[] { + itemId, + collection, + application}, this.RemoveRemoteApplicationFromCollectionOperationCompleted, userState); + } + + private void OnRemoveRemoteApplicationFromCollectionOperationCompleted(object arg) + { + if ((this.RemoveRemoteApplicationFromCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveRemoteApplicationFromCollectionCompleted(this, new RemoveRemoteApplicationFromCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetRemoteApplicationsToRdsCollection" + + "", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject SetRemoteApplicationsToRdsCollection(int itemId, int collectionId, RemoteApplication[] remoteApps) + { + object[] results = this.Invoke("SetRemoteApplicationsToRdsCollection", new object[] { + itemId, + collectionId, + remoteApps}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginSetRemoteApplicationsToRdsCollection(int itemId, int collectionId, RemoteApplication[] remoteApps, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SetRemoteApplicationsToRdsCollection", new object[] { + itemId, + collectionId, + remoteApps}, callback, asyncState); + } + + /// + public ResultObject EndSetRemoteApplicationsToRdsCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void SetRemoteApplicationsToRdsCollectionAsync(int itemId, int collectionId, RemoteApplication[] remoteApps) + { + this.SetRemoteApplicationsToRdsCollectionAsync(itemId, collectionId, remoteApps, null); + } + + /// + public void SetRemoteApplicationsToRdsCollectionAsync(int itemId, int collectionId, RemoteApplication[] remoteApps, object userState) + { + if ((this.SetRemoteApplicationsToRdsCollectionOperationCompleted == null)) + { + this.SetRemoteApplicationsToRdsCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetRemoteApplicationsToRdsCollectionOperationCompleted); + } + this.InvokeAsync("SetRemoteApplicationsToRdsCollection", new object[] { + itemId, + collectionId, + remoteApps}, this.SetRemoteApplicationsToRdsCollectionOperationCompleted, userState); + } + + private void OnSetRemoteApplicationsToRdsCollectionOperationCompleted(object arg) + { + if ((this.SetRemoteApplicationsToRdsCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetRemoteApplicationsToRdsCollectionCompleted(this, new SetRemoteApplicationsToRdsCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetOrganizationRdsUsersCount", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int GetOrganizationRdsUsersCount(int itemId) + { + object[] results = this.Invoke("GetOrganizationRdsUsersCount", new object[] { + itemId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginGetOrganizationRdsUsersCount(int itemId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetOrganizationRdsUsersCount", new object[] { + itemId}, callback, asyncState); + } + + /// + public int EndGetOrganizationRdsUsersCount(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void GetOrganizationRdsUsersCountAsync(int itemId) + { + this.GetOrganizationRdsUsersCountAsync(itemId, null); + } + + /// + public void GetOrganizationRdsUsersCountAsync(int itemId, object userState) + { + if ((this.GetOrganizationRdsUsersCountOperationCompleted == null)) + { + this.GetOrganizationRdsUsersCountOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationRdsUsersCountOperationCompleted); + } + this.InvokeAsync("GetOrganizationRdsUsersCount", new object[] { + itemId}, this.GetOrganizationRdsUsersCountOperationCompleted, userState); + } + + private void OnGetOrganizationRdsUsersCountOperationCompleted(object arg) + { + if ((this.GetOrganizationRdsUsersCountCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetOrganizationRdsUsersCountCompleted(this, new GetOrganizationRdsUsersCountCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) + { + base.CancelAsync(userState); + } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetRdsCollectionCompletedEventHandler(object sender, GetRdsCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetRdsCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetRdsCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RdsCollection Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RdsCollection)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetOrganizationRdsCollectionsCompletedEventHandler(object sender, GetOrganizationRdsCollectionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationRdsCollectionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetOrganizationRdsCollectionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RdsCollection[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RdsCollection[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddRdsCollectionCompletedEventHandler(object sender, AddRdsCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddRdsCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal AddRdsCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetRdsCollectionsPagedCompletedEventHandler(object sender, GetRdsCollectionsPagedCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetRdsCollectionsPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetRdsCollectionsPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RdsCollectionPaged Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RdsCollectionPaged)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void RemoveRdsCollectionCompletedEventHandler(object sender, RemoveRdsCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RemoveRdsCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal RemoveRdsCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetRdsServersPagedCompletedEventHandler(object sender, GetRdsServersPagedCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetRdsServersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetRdsServersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RdsServersPaged Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RdsServersPaged)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetFreeRdsServersPagedCompletedEventHandler(object sender, GetFreeRdsServersPagedCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetFreeRdsServersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetFreeRdsServersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RdsServersPaged Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RdsServersPaged)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetOrganizationRdsServersPagedCompletedEventHandler(object sender, GetOrganizationRdsServersPagedCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationRdsServersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetOrganizationRdsServersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RdsServersPaged Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RdsServersPaged)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetOrganizationFreeRdsServersPagedCompletedEventHandler(object sender, GetOrganizationFreeRdsServersPagedCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationFreeRdsServersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetOrganizationFreeRdsServersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RdsServersPaged Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RdsServersPaged)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetRdsServerCompletedEventHandler(object sender, GetRdsServerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetRdsServerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetRdsServerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RdsServer Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RdsServer)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetCollectionRdsServersCompletedEventHandler(object sender, GetCollectionRdsServersCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetCollectionRdsServersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetCollectionRdsServersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RdsServer[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RdsServer[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetOrganizationRdsServersCompletedEventHandler(object sender, GetOrganizationRdsServersCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationRdsServersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetOrganizationRdsServersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RdsServer[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RdsServer[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddRdsServerCompletedEventHandler(object sender, AddRdsServerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddRdsServerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal AddRdsServerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddRdsServerToCollectionCompletedEventHandler(object sender, AddRdsServerToCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddRdsServerToCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal AddRdsServerToCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddRdsServerToOrganizationCompletedEventHandler(object sender, AddRdsServerToOrganizationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddRdsServerToOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal AddRdsServerToOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void RemoveRdsServerCompletedEventHandler(object sender, RemoveRdsServerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RemoveRdsServerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal RemoveRdsServerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void RemoveRdsServerFromCollectionCompletedEventHandler(object sender, RemoveRdsServerFromCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RemoveRdsServerFromCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal RemoveRdsServerFromCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void RemoveRdsServerFromOrganizationCompletedEventHandler(object sender, RemoveRdsServerFromOrganizationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RemoveRdsServerFromOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal RemoveRdsServerFromOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void UpdateRdsServerCompletedEventHandler(object sender, UpdateRdsServerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class UpdateRdsServerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal UpdateRdsServerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetRdsCollectionUsersCompletedEventHandler(object sender, GetRdsCollectionUsersCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetRdsCollectionUsersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetRdsCollectionUsersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public OrganizationUser[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((OrganizationUser[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void SetUsersToRdsCollectionCompletedEventHandler(object sender, SetUsersToRdsCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetUsersToRdsCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SetUsersToRdsCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetCollectionRemoteApplicationsCompletedEventHandler(object sender, GetCollectionRemoteApplicationsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetCollectionRemoteApplicationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetCollectionRemoteApplicationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RemoteApplication[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RemoteApplication[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetAvailableRemoteApplicationsCompletedEventHandler(object sender, GetAvailableRemoteApplicationsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetAvailableRemoteApplicationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetAvailableRemoteApplicationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public StartMenuApp[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((StartMenuApp[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddRemoteApplicationToCollectionCompletedEventHandler(object sender, AddRemoteApplicationToCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddRemoteApplicationToCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal AddRemoteApplicationToCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void RemoveRemoteApplicationFromCollectionCompletedEventHandler(object sender, RemoveRemoteApplicationFromCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RemoveRemoteApplicationFromCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal RemoveRemoteApplicationFromCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void SetRemoteApplicationsToRdsCollectionCompletedEventHandler(object sender, SetRemoteApplicationsToRdsCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetRemoteApplicationsToRdsCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SetRemoteApplicationsToRdsCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetOrganizationRdsUsersCountCompletedEventHandler(object sender, GetOrganizationRdsUsersCountCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationRdsUsersCountCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetOrganizationRdsUsersCountCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public int Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index 7619168e..62f9905f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -35,6 +35,7 @@ using WebsitePanel.Providers.HostedSolution; using Microsoft.ApplicationBlocks.Data; using System.Collections.Generic; using Microsoft.Win32; +using WebsitePanel.Providers.RemoteDesktopServices; namespace WebsitePanel.EnterpriseServer { @@ -4435,5 +4436,287 @@ namespace WebsitePanel.EnterpriseServer } #endregion + + #region RDS + + public static IDataReader GetRDSCollectionsByItemId(int itemId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetRDSCollectionsByItemId", + new SqlParameter("@ItemID", itemId) + ); + } + + public static IDataReader GetRDSCollectionByName(string name) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetRDSCollectionByName", + new SqlParameter("@Name", name) + ); + } + + public static IDataReader GetRDSCollectionById(int id) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetRDSCollectionById", + new SqlParameter("@ID", id) + ); + } + + public static DataSet GetRDSCollectionsPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return SqlHelper.ExecuteDataset( + ConnectionString, + CommandType.StoredProcedure, + "GetRDSCollectionsPaged", + new SqlParameter("@FilterColumn", VerifyColumnName(filterColumn)), + new SqlParameter("@FilterValue", VerifyColumnValue(filterValue)), + new SqlParameter("@itemId", itemId), + new SqlParameter("@SortColumn", VerifyColumnName(sortColumn)), + new SqlParameter("@startRow", startRow), + new SqlParameter("@maximumRows", maximumRows) + ); + } + + public static int AddRDSCollection(int itemId, string name, string description) + { + SqlParameter rdsCollectionId = new SqlParameter("@RDSCollectionID", SqlDbType.Int); + rdsCollectionId.Direction = ParameterDirection.Output; + + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddRDSCollection", + rdsCollectionId, + new SqlParameter("@ItemID", itemId), + new SqlParameter("@Name", name), + new SqlParameter("@Description", description) + ); + + // read identity + return Convert.ToInt32(rdsCollectionId.Value); + } + + public static int GetOrganizationRdsUsersCount(int itemId) + { + SqlParameter count = new SqlParameter("@TotalNumber", SqlDbType.Int); + count.Direction = ParameterDirection.Output; + + DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure, + ObjectQualifier + "GetOrganizationRdsUsersCount", + count, + new SqlParameter("@ItemId", itemId)); + + // read identity + return Convert.ToInt32(count.Value); + } + + public static void UpdateRDSCollection(RdsCollection collection) + { + UpdateRDSCollection(collection.Id, collection.ItemId, collection.Name, collection.Description); + } + + public static void UpdateRDSCollection(int id, int itemId, string name, string description) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "UpdateRDSCollection", + new SqlParameter("@Id", id), + new SqlParameter("@ItemID", itemId), + new SqlParameter("@Name", name), + new SqlParameter("@Description", description) + ); + } + + public static void DeleteRDSCollection(int id) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "DeleteRDSCollection", + new SqlParameter("@Id", id) + ); + } + + public static int AddRDSServer(string name, string fqdName, string description) + { + SqlParameter rdsServerId = new SqlParameter("@RDSServerID", SqlDbType.Int); + rdsServerId.Direction = ParameterDirection.Output; + + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddRDSServer", + rdsServerId, + new SqlParameter("@FqdName", fqdName), + new SqlParameter("@Name", name), + new SqlParameter("@Description", description) + ); + + // read identity + return Convert.ToInt32(rdsServerId.Value); + } + + public static IDataReader GetRDSServersByItemId(int itemId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetRDSServersByItemId", + new SqlParameter("@ItemID", itemId) + ); + } + + public static DataSet GetRDSServersPaged(int? itemId, int? collectionId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, bool ignoreItemId = false, bool ignoreRdsCollectionId = false) + { + return SqlHelper.ExecuteDataset( + ConnectionString, + CommandType.StoredProcedure, + "GetRDSServersPaged", + new SqlParameter("@FilterColumn", VerifyColumnName(filterColumn)), + new SqlParameter("@FilterValue", VerifyColumnValue(filterValue)), + new SqlParameter("@SortColumn", VerifyColumnName(sortColumn)), + new SqlParameter("@startRow", startRow), + new SqlParameter("@ItemID", itemId), + new SqlParameter("@RdsCollectionId", collectionId), + new SqlParameter("@IgnoreItemId", ignoreItemId), + new SqlParameter("@IgnoreRdsCollectionId", ignoreRdsCollectionId), + new SqlParameter("@maximumRows", maximumRows) + ); + } + + public static IDataReader GetRDSServerById(int id) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetRDSServerById", + new SqlParameter("@ID", id) + ); + } + + public static IDataReader GetRDSServersByCollectionId(int collectionId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetRDSServersByCollectionId", + new SqlParameter("@RdsCollectionId", collectionId) + ); + } + + public static void DeleteRDSServer(int id) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "DeleteRDSServer", + new SqlParameter("@Id", id) + ); + } + + public static void UpdateRDSServer(RdsServer server) + { + UpdateRDSServer(server.Id, server.ItemId, server.Name, server.FqdName, server.Description, + server.RdsCollectionId); + } + + public static void UpdateRDSServer(int id, int? itemId, string name, string fqdName, string description, int? rdsCollectionId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "UpdateRDSServer", + new SqlParameter("@Id", id), + new SqlParameter("@ItemID", itemId), + new SqlParameter("@Name", name), + new SqlParameter("@FqdName", fqdName), + new SqlParameter("@Description", description), + new SqlParameter("@RDSCollectionId", rdsCollectionId) + ); + } + + public static void AddRDSServerToCollection(int serverId, int rdsCollectionId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddRDSServerToCollection", + new SqlParameter("@Id", serverId), + new SqlParameter("@RDSCollectionId", rdsCollectionId) + ); + } + + public static void AddRDSServerToOrganization(int itemId, int serverId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddRDSServerToOrganization", + new SqlParameter("@Id", serverId), + new SqlParameter("@ItemID", itemId) + ); + } + + public static void RemoveRDSServerFromOrganization(int serverId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "RemoveRDSServerFromOrganization", + new SqlParameter("@Id", serverId) + ); + } + + public static void RemoveRDSServerFromCollection(int serverId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "RemoveRDSServerFromCollection", + new SqlParameter("@Id", serverId) + ); + } + + public static IDataReader GetRDSCollectionUsersByRDSCollectionId(int id) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetRDSCollectionUsersByRDSCollectionId", + new SqlParameter("@id", id) + ); + } + + public static void AddRDSUserToRDSCollection(int rdsCollectionId, int accountId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddUserToRDSCollection", + new SqlParameter("@RDSCollectionId", rdsCollectionId), + new SqlParameter("@AccountID", accountId) + ); + } + + public static void RemoveRDSUserFromRDSCollection(int rdsCollectionId, int accountId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "RemoveRDSUserFromRDSCollection", + new SqlParameter("@RDSCollectionId", rdsCollectionId), + new SqlParameter("@AccountID", accountId) + ); + } + + #endregion } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index b2830b5e..616b1098 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -726,6 +726,13 @@ namespace WebsitePanel.EnterpriseServer successful = false; } + //Cleanup RDS + + if (RemoteDesktopServicesController.DeleteRemoteDesktopService(itemId).IsSuccess == false) + { + successful = false; + } + //Cleanup Exchange try { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index 1db609d9..f2a3ca42 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -27,20 +27,1039 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Net.NetworkInformation; +using System.Runtime.CompilerServices; using System.Xml; using System.Data; using System.Collections.Specialized; using System.Collections.Generic; using System.Text; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.EnterpriseStorage; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.OS; +using WebsitePanel.Providers.RemoteDesktopServices; +using WebsitePanel.Providers.Web; namespace WebsitePanel.EnterpriseServer { - public class RemoteDesktopServicesController - { + public class RemoteDesktopServicesController + { private RemoteDesktopServicesController() - { - } + { - - } + } + + public static RdsCollection GetRdsCollection(int collectionId) + { + return GetRdsCollectionInternal(collectionId); + } + + public static List GetOrganizationRdsCollections(int itemId) + { + return GetOrganizationRdsCollectionsInternal(itemId); + } + + public static ResultObject AddRdsCollection(int itemId, RdsCollection collection) + { + return AddRdsCollectionInternal(itemId, collection); + } + + public static RdsCollectionPaged GetRdsCollectionsPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return GetRdsCollectionsPagedInternal(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows); + } + + public static ResultObject RemoveRdsCollection(int itemId, RdsCollection collection) + { + return RemoveRdsCollectionInternal(itemId, collection); + } + + public static List GetAvailableRemoteApplications(int itemId, string collectionName) + { + return GetAvailableRemoteApplicationsInternal(itemId, collectionName); + } + + public static RdsServersPaged GetRdsServersPaged(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return GetRdsServersPagedInternal(filterColumn, filterValue, sortColumn, startRow, maximumRows); + } + + public static RdsServersPaged GetFreeRdsServersPaged(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return GetFreeRdsServersPagedInternal(filterColumn, filterValue, sortColumn, startRow, maximumRows); + } + + public static RdsServersPaged GetOrganizationRdsServersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return GetOrganizationRdsServersPagedInternal(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows); + } + + public static RdsServersPaged GetOrganizationFreeRdsServersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return GetOrganizationFreeRdsServersPagedInternal(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows); + } + + public static RdsServer GetRdsServer(int rdsSeverId) + { + return GetRdsServerInternal(rdsSeverId); + } + + public static List GetCollectionRdsServers(int collectionId) + { + return GetCollectionRdsServersInternal(collectionId); + } + + public static List GetOrganizationRdsServers(int itemId) + { + return GetOrganizationRdsServersInternal(itemId); + } + + public static ResultObject AddRdsServer(RdsServer rdsServer) + { + return AddRdsServerInternal(rdsServer); + } + + public static ResultObject AddRdsServerToCollection(int itemId, RdsServer rdsServer, RdsCollection rdsCollection) + { + return AddRdsServerToCollectionInternal(itemId, rdsServer, rdsCollection); + } + + public static ResultObject AddRdsServerToOrganization(int itemId, int serverId) + { + return AddRdsServerToOrganizationInternal(itemId, serverId); + } + + public static ResultObject RemoveRdsServer(int rdsServerId) + { + return RemoveRdsServerInternal(rdsServerId); + } + + public static ResultObject RemoveRdsServerFromCollection(int itemId, RdsServer rdsServer, RdsCollection rdsCollection) + { + return RemoveRdsServerFromCollectionInternal(itemId, rdsServer, rdsCollection); + } + + public static ResultObject RemoveRdsServerFromOrganization(int rdsServerId) + { + return RemoveRdsServerFromOrganizationInternal(rdsServerId); + } + + public static ResultObject UpdateRdsServer(RdsServer rdsServer) + { + return UpdateRdsServerInternal(rdsServer); + } + + public static List GetRdsCollectionUsers(int collectionId) + { + return GetRdsCollectionUsersInternal(collectionId); + } + + public static ResultObject SetUsersToRdsCollection(int itemId, int collectionId, List users) + { + return SetUsersToRdsCollectionInternal(itemId, collectionId, users); + } + + public static ResultObject AddRemoteApplicationToCollection(int itemId, RdsCollection collection, RemoteApplication application) + { + return AddRemoteApplicationToCollectionInternal(itemId, collection, application); + } + + public static List GetCollectionRemoteApplications(int itemId, string collectionName) + { + return GetCollectionRemoteApplicationsInternal(itemId, collectionName); + } + + public static ResultObject RemoveRemoteApplicationFromCollection(int itemId, RdsCollection collection, RemoteApplication application) + { + return RemoveRemoteApplicationFromCollectionInternal(itemId, collection, application); + } + + public static ResultObject SetRemoteApplicationsToRdsCollection(int itemId, int collectionId, List remoteApps) + { + return SetRemoteApplicationsToRdsCollectionInternal(itemId, collectionId, remoteApps); + } + + public static ResultObject DeleteRemoteDesktopService(int itemId) + { + return DeleteRemoteDesktopServiceInternal(itemId); + } + + public static int GetOrganizationRdsUsersCount(int itemId) + { + return GetOrganizationRdsUsersCountInternal(itemId); + } + + private static RdsCollection GetRdsCollectionInternal(int collectionId) + { + var collection = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRDSCollectionById(collectionId)); + + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "ADD_RDS_COLLECTION"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(4115); + if (org == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Organization not found")); + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + + rds.GetCollection(collection.Name); + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_COLLECTION", ex); + } + + FillRdsCollection(collection); + + return collection; + } + + private static List GetOrganizationRdsCollectionsInternal(int itemId) + { + var collections = ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSCollectionsByItemId(itemId)); + + foreach (var rdsCollection in collections) + { + FillRdsCollection(rdsCollection); + } + + return collections; + } + + private static ResultObject AddRdsCollectionInternal(int itemId, RdsCollection collection) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "ADD_RDS_COLLECTION"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Organization not found")); + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + + rds.CreateCollection(org.OrganizationId, collection); + + collection.Id = DataProvider.AddRDSCollection(itemId, collection.Name, collection.Description); + + foreach (var server in collection.Servers) + { + DataProvider.AddRDSServerToCollection(server.Id, collection.Id); + } + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_COLLECTION", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static RdsCollectionPaged GetRdsCollectionsPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + DataSet ds = DataProvider.GetRDSCollectionsPaged(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows); + + var result = new RdsCollectionPaged + { + RecordsCount = (int)ds.Tables[0].Rows[0][0] + }; + + List tmpCollections = new List(); + + ObjectUtils.FillCollectionFromDataView(tmpCollections, ds.Tables[1].DefaultView); + + foreach (var collection in tmpCollections) + { + collection.Servers = GetCollectionRdsServersInternal(collection.Id); + } + + result.Collections = tmpCollections.ToArray(); + + return result; + } + + private static ResultObject RemoveRdsCollectionInternal(int itemId, RdsCollection collection) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "REMOVE_RDS_COLLECTION"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Organization not found")); + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + + rds.RemoveCollection(org.OrganizationId, collection.Name); + + DataProvider.DeleteRDSCollection(collection.Id); + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_REMOVE_RDS_COLLECTION", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static List GetAvailableRemoteApplicationsInternal(int itemId, string collectionName) + { + var result = new List(); + + var taskResult = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", + "GET_AVAILABLE_REMOTE_APPLICATIOBNS"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + + if (org == null) + { + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + + result.AddRange(rds.GetAvailableRemoteApplications(collectionName)); + } + catch (Exception ex) + { + taskResult.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_COLLECTION", ex); + } + finally + { + if (!taskResult.IsSuccess) + { + TaskManager.CompleteResultTask(taskResult); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static RdsServersPaged GetRdsServersPagedInternal(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + DataSet ds = DataProvider.GetRDSServersPaged(null, null, filterColumn, filterValue, sortColumn, startRow, maximumRows, true, true); + + RdsServersPaged result = new RdsServersPaged(); + result.RecordsCount = (int)ds.Tables[0].Rows[0][0]; + + List tmpServers = new List(); + + ObjectUtils.FillCollectionFromDataView(tmpServers, ds.Tables[1].DefaultView); + + foreach (var tmpServer in tmpServers) + { + FillRdsServerData(tmpServer); + } + + result.Servers = tmpServers.ToArray(); + + return result; + } + + private static RdsServersPaged GetFreeRdsServersPagedInternal(string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + DataSet ds = DataProvider.GetRDSServersPaged(null, null, filterColumn, filterValue, sortColumn, startRow, maximumRows); + + RdsServersPaged result = new RdsServersPaged(); + result.RecordsCount = (int)ds.Tables[0].Rows[0][0]; + + List tmpServers = new List(); + + ObjectUtils.FillCollectionFromDataView(tmpServers, ds.Tables[1].DefaultView); + + result.Servers = tmpServers.ToArray(); + + return result; + } + + private static RdsServersPaged GetOrganizationRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + DataSet ds = DataProvider.GetRDSServersPaged(itemId, null, filterColumn, filterValue, sortColumn, startRow, maximumRows, ignoreRdsCollectionId: true); + + RdsServersPaged result = new RdsServersPaged(); + result.RecordsCount = (int)ds.Tables[0].Rows[0][0]; + + List tmpServers = new List(); + + ObjectUtils.FillCollectionFromDataView(tmpServers, ds.Tables[1].DefaultView); + + result.Servers = tmpServers.ToArray(); + + return result; + } + + private static RdsServersPaged GetOrganizationFreeRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + DataSet ds = DataProvider.GetRDSServersPaged(itemId, null, filterColumn, filterValue, sortColumn, startRow, maximumRows); + + RdsServersPaged result = new RdsServersPaged(); + result.RecordsCount = (int)ds.Tables[0].Rows[0][0]; + + List tmpServers = new List(); + + ObjectUtils.FillCollectionFromDataView(tmpServers, ds.Tables[1].DefaultView); + + result.Servers = tmpServers.ToArray(); + + return result; + } + + private static RdsServer GetRdsServerInternal(int rdsSeverId) + { + return ObjectUtils.FillObjectFromDataReader(DataProvider.GetRDSServerById(rdsSeverId)); + } + + private static int GetOrganizationRdsUsersCountInternal(int itemId) + { + return DataProvider.GetOrganizationRdsUsersCount(itemId); + } + + + private static List GetCollectionRdsServersInternal(int collectionId) + { + return ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSServersByCollectionId(collectionId)).ToList(); + } + + private static List GetOrganizationRdsServersInternal(int itemId) + { + return ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSServersByItemId(itemId)).ToList(); + } + + private static ResultObject AddRdsServerInternal(RdsServer rdsServer) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "ADD_RDS_SERVER"); + + try + { + if (1 == 1)//(CheckRDSServerAvaliable(rdsServer.FqdName)) + { + rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description); + } + else + { + result.AddError("", new Exception("The server that you are adding, is not available")); + return result; + } + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_SERVER", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static ResultObject AddRdsServerToCollectionInternal(int itemId, RdsServer rdsServer, RdsCollection rdsCollection) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "ADD_RDS_SERVER_TO_COLLECTION"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Organization not found")); + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + + if (!rds.CheckSessionHostFeatureInstallation(rdsServer.FqdName)) + { + rds.AddSessionHostFeatureToServer(rdsServer.FqdName); + } + + rds.AddSessionHostServerToCollection(org.OrganizationId, rdsCollection.Name, rdsServer); + + DataProvider.AddRDSServerToCollection(rdsServer.Id, rdsCollection.Id); + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_SERVER_TO_COLLECTION", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static ResultObject RemoveRdsServerFromCollectionInternal(int itemId, RdsServer rdsServer, RdsCollection rdsCollection) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "REMOVE_RDS_SERVER_FROM_COLLECTION"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Organization not found")); + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + + rds.RemoveSessionHostServerFromCollection(org.OrganizationId, rdsCollection.Name, rdsServer); + + DataProvider.RemoveRDSServerFromCollection(rdsServer.Id); + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_REMOVE_RDS_SERVER_FROM_COLLECTION", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static ResultObject UpdateRdsServerInternal(RdsServer rdsServer) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "UPDATE_RDS_SERVER"); + + try + { + DataProvider.UpdateRDSServer(rdsServer); + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_UPDATE_RDS_SERVER", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static ResultObject AddRdsServerToOrganizationInternal(int itemId, int serverId) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "ADD_RDS_SERVER_TO_ORGANIZATION"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Organization not found")); + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + + RdsServer rdsServer = GetRdsServer(serverId); + + if (!rds.CheckSessionHostFeatureInstallation(rdsServer.FqdName)) + { + rds.AddSessionHostFeatureToServer(rdsServer.FqdName); + } + + DataProvider.AddRDSServerToOrganization(itemId, serverId); + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_SERVER_TO_ORGANIZATION", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static ResultObject RemoveRdsServerFromOrganizationInternal(int rdsServerId) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "REMOVE_RDS_SERVER_FROM_ORGANIZATION"); + + try + { + DataProvider.RemoveRDSServerFromOrganization(rdsServerId); + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_REMOVE_RDS_SERVER_FROM_ORGANIZATION", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static ResultObject RemoveRdsServerInternal(int rdsServerId) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "REMOVE_RDS_SERVER"); + + try + { + DataProvider.DeleteRDSServer(rdsServerId); + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_REMOVE_RDS_SERVER", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static List GetRdsCollectionUsersInternal(int collectionId) + { + return ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSCollectionUsersByRDSCollectionId(collectionId)); + } + + private static ResultObject SetUsersToRdsCollectionInternal(int itemId, int collectionId, List users) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "ADD_USER_TO_RDS_COLLECTION"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Organization not found")); + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + + var collection = GetRdsCollection(collectionId); + + if (collection == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Collection not found")); + return result; + } + + foreach(var user in users) + { + var account = OrganizationController.GetAccountByAccountName(itemId, user.AccountName); + + user.AccountId = account.AccountId; + } + + var usersInDb = GetRdsCollectionUsers(collectionId); + + var usersAccountNames = users.Select(x => x.AccountName).ToList(); + + //Set on server + rds.SetUsersInCollection(org.OrganizationId, collection.Name, users.Select(x => x.AccountName).ToArray()); + + //Remove from db + foreach (var userInDb in usersInDb) + { + if (!usersAccountNames.Contains(userInDb.AccountName)) + { + DataProvider.RemoveRDSUserFromRDSCollection(collectionId, userInDb.AccountId); + } + } + + //Add to db + foreach (var user in users) + { + if (!usersInDb.Select(x => x.AccountName).Contains(user.AccountName)) + { + DataProvider.AddRDSUserToRDSCollection(collectionId, user.AccountId); + } + } + + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_ADD_USER_TO_RDS_COLLECTION", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static ResultObject AddRemoteApplicationToCollectionInternal(int itemId, RdsCollection collection, RemoteApplication remoteApp) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "ADD_REMOTE_APP_TO_COLLECTION"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Organization not found")); + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + + if (!string.IsNullOrEmpty(remoteApp.Alias)) + { + remoteApp.Alias = remoteApp.DisplayName; + } + + remoteApp.ShowInWebAccess = true; + + rds.AddRemoteApplication(collection.Name, remoteApp); + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_ADD_REMOTE_APP_TO_COLLECTION", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static List GetCollectionRemoteApplicationsInternal(int itemId, string collectionName) + { + var result = new List(); + + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + + if (org == null) + { + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + + result.AddRange(rds.GetCollectionRemoteApplications(collectionName)); + + return result; + } + + private static ResultObject RemoveRemoteApplicationFromCollectionInternal(int itemId, RdsCollection collection, RemoteApplication application) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "REMOVE_REMOTE_APP_FROM_COLLECTION"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Organization not found")); + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + + rds.RemoveRemoteApplication(collection.Name, application); + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_REMOVE_REMOTE_APP_FROM_COLLECTION", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static ResultObject SetRemoteApplicationsToRdsCollectionInternal(int itemId, int collectionId, List remoteApps) + { + ResultObject result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "SET_APPS_TO_RDS_COLLECTION"); ; + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Organization not found")); + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + + var collection = GetRdsCollection(collectionId); + + if (collection == null) + { + result.IsSuccess = false; + result.AddError("", new NullReferenceException("Collection not found")); + return result; + } + + List existingCollectionApps = GetCollectionRemoteApplications(itemId, collection.Name); + List remoteAppsToAdd = remoteApps.Where(x => !existingCollectionApps.Select(p => p.DisplayName).Contains(x.DisplayName)).ToList(); + foreach (var app in remoteAppsToAdd) + { + AddRemoteApplicationToCollection(itemId, collection, app); + } + + List remoteAppsToRemove = existingCollectionApps.Where(x => !remoteApps.Select(p => p.DisplayName).Contains(x.DisplayName)).ToList(); + foreach (var app in remoteAppsToRemove) + { + RemoveRemoteApplicationFromCollection(itemId, collection, app); + } + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_SET_APPS_TO_RDS_COLLECTION", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static RdsCollection FillRdsCollection(RdsCollection collection) + { + collection.Servers = GetCollectionRdsServers(collection.Id) ?? new List(); + + return collection; + } + + private static RdsServer FillRdsServerData(RdsServer server) + { + server.Address = GetServerIp(server.FqdName).ToString(); + + return server; + } + + private static System.Net.IPAddress GetServerIp(string hostname, AddressFamily addressFamily = AddressFamily.InterNetwork) + { + var address = GetServerIps(hostname); + + return address.FirstOrDefault(x => x.AddressFamily == addressFamily); + } + + private static IEnumerable GetServerIps(string hostname) + { + var address = Dns.GetHostAddresses(hostname); + + return address; + } + + private static bool CheckRDSServerAvaliable(string hostname) + { + bool result = false; + + try + { + var ping = new Ping(); + var reply = ping.Send(hostname, 1000); // 1 second time out (in ms) + + if (reply.Status == IPStatus.Success) + result = true; + } + catch (Exception) + { + result = false; + } + + return result; + } + + + private static ResultObject DeleteRemoteDesktopServiceInternal(int itemId) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "CLEANUP"); + + try + { + var collections = GetOrganizationRdsCollections(itemId); + + foreach (var collection in collections) + { + RemoveRdsCollection(itemId, collection); + } + + var servers = GetOrganizationRdsServers(itemId); + + foreach (var server in servers) + { + RemoveRdsServerFromOrganization(server.Id); + } + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_CLEANUP", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + private static int GetRemoteDesktopServiceID(int packageId) + { + return PackageController.GetPackageServiceId(packageId, ResourceGroups.RDS); + } + + private static RemoteDesktopServices GetRemoteDesktopServices(int serviceId) + { + var rds = new RemoteDesktopServices(); + ServiceProviderProxy.Init(rds, serviceId); + + return rds; + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs index a31cb925..48005ae8 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs @@ -36,7 +36,8 @@ using System.Web.Services.Protocols; using System.ComponentModel; using Microsoft.Web.Services3; - +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.RemoteDesktopServices; namespace WebsitePanel.EnterpriseServer @@ -50,14 +51,178 @@ namespace WebsitePanel.EnterpriseServer [ToolboxItem(false)] public class esRemoteDesktopServices : System.Web.Services.WebService { - /* + [WebMethod] - public DataSet GetRawOdbcSourcesPaged(int packageId, - string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + public RdsCollection GetRdsCollection(int collectionId) { - return OperatingSystemController.GetRawOdbcSourcesPaged(packageId, filterColumn, - filterValue, sortColumn, startRow, maximumRows); + return RemoteDesktopServicesController.GetRdsCollection(collectionId); } - */ + + [WebMethod] + public List GetOrganizationRdsCollections(int itemId) + { + return RemoteDesktopServicesController.GetOrganizationRdsCollections(itemId); + } + + [WebMethod] + public ResultObject AddRdsCollection(int itemId, RdsCollection collection) + { + return RemoteDesktopServicesController.AddRdsCollection(itemId, collection); + } + + [WebMethod] + public RdsCollectionPaged GetRdsCollectionsPaged(int itemId, string filterColumn, string filterValue, + string sortColumn, int startRow, int maximumRows) + { + return RemoteDesktopServicesController.GetRdsCollectionsPaged(itemId, filterColumn, filterValue, sortColumn, + startRow, maximumRows); + } + + [WebMethod] + public ResultObject RemoveRdsCollection(int itemId, RdsCollection collection) + { + return RemoteDesktopServicesController.RemoveRdsCollection(itemId, collection); + } + + [WebMethod] + public RdsServersPaged GetRdsServersPaged(string filterColumn, string filterValue, string sortColumn, + int startRow, int maximumRows) + { + return RemoteDesktopServicesController.GetRdsServersPaged(filterColumn, filterValue, sortColumn, startRow, + maximumRows); + } + + [WebMethod] + public RdsServersPaged GetFreeRdsServersPaged(string filterColumn, string filterValue, + string sortColumn, int startRow, int maximumRows) + { + return RemoteDesktopServicesController.GetFreeRdsServersPaged(filterColumn, filterValue, + sortColumn, startRow, maximumRows); + } + + [WebMethod] + public RdsServersPaged GetOrganizationRdsServersPaged(int itemId, string filterColumn, string filterValue, + string sortColumn, int startRow, int maximumRows) + { + return RemoteDesktopServicesController.GetOrganizationRdsServersPaged(itemId, filterColumn, filterValue, + sortColumn, startRow, maximumRows); + } + + [WebMethod] + public RdsServersPaged GetOrganizationFreeRdsServersPaged(int itemId, string filterColumn, string filterValue, + string sortColumn, int startRow, int maximumRows) + { + return RemoteDesktopServicesController.GetOrganizationFreeRdsServersPaged(itemId, filterColumn, filterValue, + sortColumn, startRow, maximumRows); + } + + [WebMethod] + public RdsServer GetRdsServer(int rdsSeverId) + { + return RemoteDesktopServicesController.GetRdsServer(rdsSeverId); + } + + [WebMethod] + public List GetCollectionRdsServers(int collectionId) + { + return RemoteDesktopServicesController.GetCollectionRdsServers(collectionId); + } + + [WebMethod] + public List GetOrganizationRdsServers(int itemId) + { + return RemoteDesktopServicesController.GetOrganizationRdsServers(itemId); + } + + [WebMethod] + public ResultObject AddRdsServer(RdsServer rdsServer) + { + return RemoteDesktopServicesController.AddRdsServer(rdsServer); + } + + [WebMethod] + public ResultObject AddRdsServerToCollection(int itemId, RdsServer rdsServer, RdsCollection rdsCollection) + { + return RemoteDesktopServicesController.AddRdsServerToCollection(itemId, rdsServer, rdsCollection); + } + + [WebMethod] + public ResultObject AddRdsServerToOrganization(int itemId, int serverId) + { + return RemoteDesktopServicesController.AddRdsServerToOrganization(itemId, serverId); + } + + [WebMethod] + public ResultObject RemoveRdsServer(int rdsServerId) + { + return RemoteDesktopServicesController.RemoveRdsServer(rdsServerId); + } + + [WebMethod] + public ResultObject RemoveRdsServerFromCollection(int itemId, RdsServer rdsServer, RdsCollection rdsCollection) + { + return RemoteDesktopServicesController.RemoveRdsServerFromCollection(itemId, rdsServer, rdsCollection); + } + + [WebMethod] + public ResultObject RemoveRdsServerFromOrganization(int rdsServerId) + { + return RemoteDesktopServicesController.RemoveRdsServerFromOrganization(rdsServerId); + } + + [WebMethod] + public ResultObject UpdateRdsServer(RdsServer rdsServer) + { + return RemoteDesktopServicesController.UpdateRdsServer(rdsServer); + } + + [WebMethod] + public List GetRdsCollectionUsers(int collectionId) + { + return RemoteDesktopServicesController.GetRdsCollectionUsers(collectionId); + } + + [WebMethod] + public ResultObject SetUsersToRdsCollection(int itemId, int collectionId, List users) + { + return RemoteDesktopServicesController.SetUsersToRdsCollection(itemId, collectionId, users); + } + + [WebMethod] + public List GetCollectionRemoteApplications(int itemId, string collectionName) + { + return RemoteDesktopServicesController.GetCollectionRemoteApplications(itemId, collectionName); + } + + [WebMethod] + public List GetAvailableRemoteApplications(int itemId, string collectionName) + { + return RemoteDesktopServicesController.GetAvailableRemoteApplications(itemId, collectionName); + } + + [WebMethod] + public ResultObject AddRemoteApplicationToCollection(int itemId, RdsCollection collection, RemoteApplication application) + { + return RemoteDesktopServicesController.AddRemoteApplicationToCollection(itemId, collection, application); + } + + [WebMethod] + public ResultObject RemoveRemoteApplicationFromCollection(int itemId, RdsCollection collection, RemoteApplication application) + { + return RemoteDesktopServicesController.RemoveRemoteApplicationFromCollection(itemId, collection, application); + } + + [WebMethod] + public ResultObject SetRemoteApplicationsToRdsCollection(int itemId, int collectionId, List remoteApps) + { + return RemoteDesktopServicesController.SetRemoteApplicationsToRdsCollection(itemId, collectionId, remoteApps); + } + + [WebMethod] + public int GetOrganizationRdsUsersCount(int itemId) + { + return RemoteDesktopServicesController.GetOrganizationRdsUsersCount(itemId); + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs index 447512ad..c9cfe32c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs @@ -130,6 +130,31 @@ namespace WebsitePanel.Providers.HostedSolution return res; } + public static bool IsComputerInGroup(string samAccountName, string group) + { + bool res = false; + DirectorySearcher deSearch = new DirectorySearcher + { + Filter = + ("(&(objectClass=computer)(samaccountname=" + samAccountName + "))") + }; + + //get the group result + SearchResult results = deSearch.FindOne(); + DirectoryEntry de = results.GetDirectoryEntry(); + PropertyValueCollection props = de.Properties["memberOf"]; + + foreach (string str in props) + { + if (str.IndexOf(group) != -1) + { + res = true; + break; + } + } + return res; + } + public static string CreateOrganizationalUnit(string name, string parentPath) { string ret; diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs index 224b6991..6cf5ec6b 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs @@ -28,6 +28,9 @@ using System; using System.Collections; +using System.Collections.Generic; +using System.Net; +using System.Net.Sockets; namespace WebsitePanel.Providers.RemoteDesktopServices { @@ -36,6 +39,24 @@ namespace WebsitePanel.Providers.RemoteDesktopServices /// public interface IRemoteDesktopServices { - + bool CreateCollection(string organizationId, RdsCollection collection); + RdsCollection GetCollection(string collectionName); + bool RemoveCollection(string organizationId, string collectionName); + bool SetUsersInCollection(string organizationId, string collectionName, List users); + void AddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server); + void AddSessionHostServersToCollection(string organizationId, string collectionName, List servers); + void RemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server); + void RemoveSessionHostServersFromCollection(string organizationId, string collectionName, List servers); + + List GetAvailableRemoteApplications(string collectionName); + List GetCollectionRemoteApplications(string collectionName); + bool AddRemoteApplication(string collectionName, RemoteApplication remoteApp); + bool AddRemoteApplications(string collectionName, List remoteApps); + bool RemoveRemoteApplication(string collectionName, RemoteApplication remoteApp); + + bool AddSessionHostFeatureToServer(string hostName); + bool CheckSessionHostFeatureInstallation(string hostName); + + bool CheckServerAvailability(string hostName); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollection.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollection.cs new file mode 100644 index 00000000..dda297f9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollection.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +namespace WebsitePanel.Providers.RemoteDesktopServices +{ + [Serializable] + public class RdsCollection + { + public RdsCollection() + { + Servers = new List(); + } + + public int Id { get; set; } + public int ItemId { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public List Servers { get; set; } + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollectionPaged.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollectionPaged.cs new file mode 100644 index 00000000..39e21c3d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollectionPaged.cs @@ -0,0 +1,8 @@ +namespace WebsitePanel.Providers.RemoteDesktopServices +{ + public class RdsCollectionPaged + { + public int RecordsCount { get; set; } + public RdsCollection[] Collections { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServer.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServer.cs new file mode 100644 index 00000000..5d44984f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServer.cs @@ -0,0 +1,22 @@ +using System.Net; + +namespace WebsitePanel.Providers.RemoteDesktopServices +{ + public class RdsServer + { + public int Id { get; set; } + public int? ItemId { get; set; } + public string Name + { + get + { + return string.IsNullOrEmpty(FqdName) ? string.Empty : FqdName.Split('.')[0]; + } + } + public string FqdName { get; set; } + public string Description { get; set; } + public string Address { get; set; } + public string ItemName { get; set; } + public int? RdsCollectionId { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServersPaged.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServersPaged.cs new file mode 100644 index 00000000..5849a04e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServersPaged.cs @@ -0,0 +1,8 @@ +namespace WebsitePanel.Providers.RemoteDesktopServices +{ + public class RdsServersPaged + { + public int RecordsCount { get; set; } + public RdsServer[] Servers { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs new file mode 100644 index 00000000..c80dde44 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs @@ -0,0 +1,11 @@ +namespace WebsitePanel.Providers.RemoteDesktopServices +{ + public class RemoteApplication + { + public string Alias { get; set; } + public string DisplayName { get; set; } + public string FilePath { get; set; } + public string FileVirtualPath { get; set; } + public bool ShowInWebAccess { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/SessionHostServer.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/SessionHostServer.cs new file mode 100644 index 00000000..1c23195e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/SessionHostServer.cs @@ -0,0 +1,11 @@ +using System.Net; + +namespace WebsitePanel.Providers.RemoteDesktopServices +{ + public class SessionHostServer + { + public string Name { get; set; } + public string FqdName { get; set; } + public string Address { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/StartMenuApp.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/StartMenuApp.cs new file mode 100644 index 00000000..9259c4ed --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/StartMenuApp.cs @@ -0,0 +1,9 @@ +namespace WebsitePanel.Providers.RemoteDesktopServices +{ + public class StartMenuApp + { + public string DisplayName { get; set; } + public string FilePath { get; set; } + public string FileVirtualPath { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index 3f7049a0..2efa81eb 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -123,6 +123,13 @@ + + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/WebsitePanel.Providers.RemoteDesktopServices.Windows2012.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/WebsitePanel.Providers.RemoteDesktopServices.Windows2012.csproj index 0bb44d32..66dd13d8 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/WebsitePanel.Providers.RemoteDesktopServices.Windows2012.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/WebsitePanel.Providers.RemoteDesktopServices.Windows2012.csproj @@ -33,6 +33,8 @@ + + {684C932A-6C75-46AC-A327-F3689D89EB42} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index e531a58c..934b2239 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -29,104 +29,1293 @@ using System; using System.IO; using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.NetworkInformation; +using System.Net.Sockets; +using System.Runtime.Remoting; using System.Text; using Microsoft.Win32; - +using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Server.Utils; using WebsitePanel.Providers.Utils; using WebsitePanel.Providers.OS; using WebsitePanel.Providers.Common; +using System.Management; +using System.Management.Automation; +using System.Management.Automation.Runspaces; +using System.Collections.ObjectModel; + namespace WebsitePanel.Providers.RemoteDesktopServices { - public class Windows2012 : HostingServiceProviderBase + public class Windows2012 : HostingServiceProviderBase, IRemoteDesktopServices { - #region Properties - protected string UsersHome - { - get { return FileUtils.EvaluateSystemVariables(ProviderSettings[Constants.UsersHome]); } - } + #region Constants + + private const string CapPath = @"RDS:\GatewayServer\CAP"; + private const string RapPath = @"RDS:\GatewayServer\RAP"; + private const string Computers = "Computers"; + private const string AdDcComputers = "Domain Controllers"; + private const string Users = "users"; + 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\""; #endregion + #region Properties + + internal string PrimaryDomainController + { + get + { + return ProviderSettings["PrimaryDomainController"]; + } + } + + private string RootOU + { + get + { + return ProviderSettings["RootOU"]; + } + } + + private string CentralNpsHost + { + get + { + return ProviderSettings["CentralNPS"]; + } + } + + private IEnumerable Gateways + { + get + { + return ProviderSettings["GWServrsList"].Split(';').Select(x => string.IsNullOrEmpty(x) ? x : x.Trim()); + } + } + + private bool CentralNps + { + get + { + return Convert.ToBoolean(ProviderSettings["UseCentralNPS"]); + } + } + + private string RootDomain + { + get + { + return ServerSettings.ADRootDomain; + } + } + + private string ConnectionBroker + { + get + { + return ProviderSettings["ConnectionBroker"]; + } + } + + #endregion #region HostingServiceProvider methods - public override string[] Install() - { - List messages = new List(); - - // create folder if it not exists - try - { - if (!FileUtils.DirectoryExists(UsersHome)) - { - FileUtils.CreateDirectory(UsersHome); - } - } - catch (Exception ex) - { - messages.Add(String.Format("Folder '{0}' could not be created: {1}", - UsersHome, ex.Message)); - } - return messages.ToArray(); - } - - public override void DeleteServiceItems(ServiceProviderItem[] items) - { - foreach (ServiceProviderItem item in items) - { - try - { - if (item is HomeFolder) - // delete home folder - FileUtils.DeleteFile(item.Name); - } - catch (Exception ex) - { - Log.WriteError(String.Format("Error deleting '{0}' {1}", item.Name, item.GetType().Name), ex); - } - } - } - - public override ServiceProviderItemDiskSpace[] GetServiceItemsDiskSpace(ServiceProviderItem[] items) - { - List itemsDiskspace = new List(); - foreach (ServiceProviderItem item in items) - { - if (item is HomeFolder) - { - try - { - string path = item.Name; - - Log.WriteStart(String.Format("Calculating '{0}' folder size", path)); - - // calculate disk space - ServiceProviderItemDiskSpace diskspace = new ServiceProviderItemDiskSpace(); - diskspace.ItemId = item.Id; - diskspace.DiskSpace = FileUtils.CalculateFolderSize(path); - itemsDiskspace.Add(diskspace); - - Log.WriteEnd(String.Format("Calculating '{0}' folder size", path)); - } - catch (Exception ex) - { - Log.WriteError(ex); - } - } - } - return itemsDiskspace.ToArray(); - } - #endregion public override bool IsInstalled() { // TODO: Remove it. - return true; - - //Server.Utils.OS.WindowsVersion version = WebsitePanel.Server.Utils.OS.GetVersion(); - //return version == WebsitePanel.Server.Utils.OS.WindowsVersion.WindowsServer2012; + //return true; + Server.Utils.OS.WindowsVersion version = WebsitePanel.Server.Utils.OS.GetVersion(); + return version == WebsitePanel.Server.Utils.OS.WindowsVersion.WindowsServer2012; } + + #endregion + + #region RDS Collections + + public bool CreateCollection(string organizationId, RdsCollection collection) + { + var result = true; + + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + + foreach (var server in collection.Servers) + { + //If server will restart it will not be added to collection + //Do not install feature here + + if (!ExistRdsServerInDeployment(runSpace, server)) + { + AddRdsServerToDeployment(runSpace, server); + } + } + + Command cmd = new Command("New-RDSessionCollection"); + cmd.Parameters.Add("CollectionName", collection.Name); + cmd.Parameters.Add("SessionHost", collection.Servers.Select(x => x.FqdName).ToArray()); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + + if (!string.IsNullOrEmpty(collection.Description)) + { + cmd.Parameters.Add("CollectionDescription", collection.Description); + } + + var collectionPs = ExecuteShellCommand(runSpace, cmd, false).FirstOrDefault(); + + if (collectionPs == null) + { + throw new Exception("Collection not created"); + } + + var orgPath = GetOrganizationPath(organizationId); + + if (!ActiveDirectoryUtils.AdObjectExists(GetComputerGroupPath(organizationId, collection.Name))) + { + //Create computer group + ActiveDirectoryUtils.CreateGroup(orgPath, GetComputersGroupName(collection.Name)); + + //todo Connection broker server must be added by default ??? + //ActiveDirectoryUtils.AddObjectToGroup(GetComputerPath(ConnectionBroker), GetComputerGroupPath(organizationId, collection.Name)); + } + + if (!ActiveDirectoryUtils.AdObjectExists(GetUsersGroupPath(organizationId, collection.Name))) + { + //Create user group + ActiveDirectoryUtils.CreateGroup(orgPath, GetUsersGroupName(collection.Name)); + } + + foreach (var gateway in Gateways) + { + if (!CentralNps) + { + CreateRdCapForce(runSpace, gateway, collection.Name, new List { GetUsersGroupName(collection.Name) }); + } + + CreateRdRapForce(runSpace, gateway, collection.Name, new List { GetUsersGroupName(collection.Name) }); + } + + if (CentralNps) + { + CreateCentralNpsPolicy(runSpace, CentralNpsHost, collection.Name, organizationId); + } + + //add user group to collection + AddUserGroupsToCollection(runSpace, collection.Name, new List { GetUsersGroupName(collection.Name) }); + + //add session servers to group + foreach (var rdsServer in collection.Servers) + { + AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer); + } + } + catch (Exception e) + { + result = false; + } + finally + { + CloseRunspace(runSpace); + } + + return result; + } + + public RdsCollection GetCollection(string collectionName) + { + RdsCollection collection =null; + + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-RDSessionCollection"); + cmd.Parameters.Add("CollectionName", collectionName); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + + var collectionPs = ExecuteShellCommand(runSpace, cmd, false).FirstOrDefault(); + + if (collectionPs != null) + { + collection = new RdsCollection(); + collection.Name = Convert.ToString(GetPSObjectProperty(collectionPs, "CollectionName")); + collection.Description = Convert.ToString(GetPSObjectProperty(collectionPs, "CollectionDescription")); + } + } + finally + { + CloseRunspace(runSpace); + } + + return collection; + } + + public bool RemoveCollection(string organizationId, string collectionName) + { + var result = true; + + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Remove-RDSessionCollection"); + cmd.Parameters.Add("CollectionName", collectionName); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + cmd.Parameters.Add("Force", true); + + ExecuteShellCommand(runSpace, cmd, false); + + foreach (var gateway in Gateways) + { + if (!CentralNps) + { + RemoveRdCap(runSpace, gateway, collectionName); + } + + RemoveRdRap(runSpace, gateway, collectionName); + } + + if (CentralNps) + { + RemoveNpsPolicy(runSpace, CentralNpsHost, collectionName); + } + + //Remove security group + + ActiveDirectoryUtils.DeleteADObject(GetComputerGroupPath(organizationId, collectionName)); + + ActiveDirectoryUtils.DeleteADObject(GetUsersGroupPath(organizationId, collectionName)); + } + catch (Exception e) + { + result = false; + } + finally + { + CloseRunspace(runSpace); + } + + return result; + } + + public List GetCollectionUsers(string collectionName) + { + return GetUsersToCollectionAdGroup(collectionName); + } + + public bool SetUsersInCollection(string organizationId, string collectionName, List users) + { + var result = true; + + try + { + SetUsersToCollectionAdGroup(collectionName, organizationId, users); + } + catch (Exception e) + { + result = false; + } + + return result; + } + + public void AddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server) + { + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + + if (!ExistRdsServerInDeployment(runSpace, server)) + { + AddRdsServerToDeployment(runSpace, server); + } + + Command cmd = new Command("Add-RDSessionHost"); + cmd.Parameters.Add("CollectionName", collectionName); + cmd.Parameters.Add("SessionHost", server.FqdName); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + + ExecuteShellCommand(runSpace, cmd, false); + + AddComputerToCollectionAdComputerGroup(organizationId, collectionName, server); + } + catch (Exception e) + { + + } + finally + { + CloseRunspace(runSpace); + } + } + + public void AddSessionHostServersToCollection(string organizationId, string collectionName, List servers) + { + foreach (var server in servers) + { + AddSessionHostServerToCollection(organizationId, collectionName, server); + } + } + + public void RemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server) + { + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Remove-RDSessionHost"); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + cmd.Parameters.Add("SessionHost", server.FqdName); + cmd.Parameters.Add("Force", true); + + ExecuteShellCommand(runSpace, cmd, false); + + RemoveComputerFromCollectionAdComputerGroup(organizationId, collectionName, server); + } + finally + { + CloseRunspace(runSpace); + } + } + + public void RemoveSessionHostServersFromCollection(string organizationId, string collectionName, List servers) + { + foreach (var server in servers) + { + RemoveSessionHostServerFromCollection(organizationId, collectionName, server); + } + } + + #endregion + + #region Remote Applications + + public List GetAvailableRemoteApplications(string collectionName) + { + var startApps = new List(); + + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-RDAvailableApp"); + cmd.Parameters.Add("CollectionName", collectionName); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + + var remoteApplicationsPS = ExecuteShellCommand(runSpace, cmd, false); + + if (remoteApplicationsPS != null) + { + startApps.AddRange(remoteApplicationsPS.Select(CreateStartMenuAppFromPsObject)); + } + } + finally + { + CloseRunspace(runSpace); + } + + return startApps; + } + + public List GetCollectionRemoteApplications(string collectionName) + { + var remoteApps = new List(); + + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-RDRemoteApp"); + cmd.Parameters.Add("CollectionName", collectionName); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + + var remoteAppsPs = ExecuteShellCommand(runSpace, cmd, false); + + if (remoteAppsPs != null) + { + remoteApps.AddRange(remoteAppsPs.Select(CreateRemoteApplicationFromPsObject)); + } + } + finally + { + CloseRunspace(runSpace); + } + + return remoteApps; + } + + public bool AddRemoteApplication(string collectionName, RemoteApplication remoteApp) + { + var result = false; + + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("New-RDRemoteApp"); + cmd.Parameters.Add("CollectionName", collectionName); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + cmd.Parameters.Add("Alias", remoteApp.Alias); + cmd.Parameters.Add("DisplayName", remoteApp.DisplayName); + cmd.Parameters.Add("FilePath", remoteApp.FilePath); + cmd.Parameters.Add("ShowInWebAccess", remoteApp.ShowInWebAccess); + + ExecuteShellCommand(runSpace, cmd, false); + + result = true; + } + finally + { + CloseRunspace(runSpace); + } + + return result; + } + + public bool AddRemoteApplications(string collectionName, List remoteApps) + { + var result = true; + + foreach (var remoteApp in remoteApps) + { + result = AddRemoteApplication(collectionName, remoteApp) && result; + } + + return result; + } + + public bool RemoveRemoteApplication(string collectionName, RemoteApplication remoteApp) + { + var result = false; + + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Remove-RDRemoteApp"); + cmd.Parameters.Add("CollectionName", collectionName); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + cmd.Parameters.Add("Alias", remoteApp.Alias); + cmd.Parameters.Add("Force", true); + + ExecuteShellCommand(runSpace, cmd, false); + } + finally + { + CloseRunspace(runSpace); + } + + return result; + } + + #endregion + + #region Gateaway (RD CAP | RD RAP) + + internal void CreateCentralNpsPolicy(Runspace runSpace, string centralNpshost, string collectionName, string organizationId) + { + var showCmd = new Command("netsh nps show np"); + + var showResult = ExecuteRemoteShellCommand(runSpace, centralNpshost, showCmd); + + var count = showResult.Count(x => Convert.ToString(x).Contains("policy conf")) + 1001; + + var groupAd = ActiveDirectoryUtils.GetADObject(GetUsersGroupPath(organizationId, collectionName)); + + var sid = (byte[])ActiveDirectoryUtils.GetADObjectProperty(groupAd, "objectSid"); + + var addCmdString = string.Format(AddNpsString, collectionName.Replace(" ", "_"), count, ConvertByteToStringSid(sid)); + + Command addCmd = new Command(addCmdString); + + var result = ExecuteRemoteShellCommand(runSpace, centralNpshost, addCmd); + } + + internal void RemoveNpsPolicy(Runspace runSpace, string centralNpshost, string collectionName) + { + var removeCmd = new Command(string.Format("netsh nps delete np {0}", collectionName.Replace(" ", "_"))); + + var removeResult = ExecuteRemoteShellCommand(runSpace, centralNpshost, removeCmd); + } + + internal void CreateRdCapForce(Runspace runSpace, string gatewayHost, string name, List groups) + { + //New-Item -Path "RDS:\GatewayServer\CAP" -Name "Allow Admins" -UserGroups "Administrators@." -AuthMethod 1 + //Set-Item -Path "RDS:\GatewayServer\CAP\Allow Admins\SessionTimeout" -Value 480 -SessionTimeoutAction 0 + + if (ItemExistsRemote(runSpace, gatewayHost, Path.Combine(CapPath, name))) + { + RemoveRdCap(runSpace, gatewayHost, name); + } + + var userGroupParametr = string.Format("@({0})",string.Join(",", groups.Select(x => string.Format("\"{0}@{1}\"", x, RootDomain)).ToArray())); + + Command rdCapCommand = new Command("New-Item"); + rdCapCommand.Parameters.Add("Path", string.Format("\"{0}\"", CapPath)); + rdCapCommand.Parameters.Add("Name", string.Format("\"{0}\"", name)); + rdCapCommand.Parameters.Add("UserGroups", userGroupParametr); + rdCapCommand.Parameters.Add("AuthMethod", 1); + + ExecuteRemoteShellCommand(runSpace, gatewayHost, rdCapCommand, RdsModuleName); + } + + internal void RemoveRdCap(Runspace runSpace, string gatewayHost, string name) + { + RemoveItemRemote(runSpace, gatewayHost, string.Format(@"{0}\{1}", CapPath, name), RdsModuleName); + } + + internal void CreateRdRapForce(Runspace runSpace, string gatewayHost, string name, List groups) + { + //New-Item -Path "RDS:\GatewayServer\RAP" -Name "Allow Connections To Everywhere" -UserGroups "Administrators@." -ComputerGroupType 1 + //Set-Item -Path "RDS:\GatewayServer\RAP\Allow Connections To Everywhere\PortNumbers" -Value 3389,3390 + + if (ItemExistsRemote(runSpace, gatewayHost, Path.Combine(RapPath, name))) + { + RemoveRdRap(runSpace, gatewayHost, name); + } + + var userGroupParametr = string.Format("@({0})", string.Join(",", groups.Select(x => string.Format("\"{0}@{1}\"", x, RootDomain)).ToArray())); + var computerGroupParametr = string.Format("\"{0}@{1}\"", GetComputersGroupName(name), RootDomain); + + Command rdRapCommand = new Command("New-Item"); + rdRapCommand.Parameters.Add("Path", string.Format("\"{0}\"", RapPath)); + rdRapCommand.Parameters.Add("Name", string.Format("\"{0}\"", name)); + rdRapCommand.Parameters.Add("UserGroups", userGroupParametr); + rdRapCommand.Parameters.Add("ComputerGroupType", 1); + rdRapCommand.Parameters.Add("ComputerGroup", computerGroupParametr); + + ExecuteRemoteShellCommand(runSpace, gatewayHost, rdRapCommand, RdsModuleName); + } + + internal void RemoveRdRap(Runspace runSpace, string gatewayHost, string name) + { + RemoveItemRemote(runSpace, gatewayHost, string.Format(@"{0}\{1}", RapPath, name), RdsModuleName); + } + + #endregion + + private void AddRdsServerToDeployment(Runspace runSpace, RdsServer server) + { + Command cmd = new Command("Add-RDserver"); + cmd.Parameters.Add("Server", server.FqdName); + cmd.Parameters.Add("Role", "RDS-RD-SERVER"); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + + ExecuteShellCommand(runSpace, cmd, false); + } + + private bool ExistRdsServerInDeployment(Runspace runSpace, RdsServer server) + { + Command cmd = new Command("Get-RDserver"); + cmd.Parameters.Add("Role", "RDS-RD-SERVER"); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + + var serversPs = ExecuteShellCommand(runSpace, cmd, false); + + if (serversPs != null) + { + foreach (var serverPs in serversPs) + { + var serverName = Convert.ToString( GetPSObjectProperty(serverPs, "Server")); + + if (string.Compare(serverName, server.FqdName, StringComparison.InvariantCultureIgnoreCase) == 0) + { + return true; + } + } + } + + return false; + } + + private void SetUsersToCollectionAdGroup(string collectionName, string organizationId, IEnumerable users) + { + var usersGroupName = GetUsersGroupName(collectionName); + var usersGroupPath = GetUsersGroupPath(organizationId, collectionName); + + //remove all users from group + foreach (string userPath in ActiveDirectoryUtils.GetGroupObjects(usersGroupName, "user")) + { + ActiveDirectoryUtils.RemoveObjectFromGroup(userPath, usersGroupPath); + } + + //adding users to group + foreach (var user in users) + { + var userPath = GetUserPath(organizationId, user); + + if (ActiveDirectoryUtils.AdObjectExists(userPath)) + { + var userObject = ActiveDirectoryUtils.GetADObject(userPath); + var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(userObject, "sAMAccountName"); + + if (!ActiveDirectoryUtils.IsUserInGroup(samName, usersGroupName)) + { + ActiveDirectoryUtils.AddObjectToGroup(userPath, GetUsersGroupPath(organizationId, collectionName)); + } + } + } + } + + private List GetUsersToCollectionAdGroup(string collectionName) + { + var users = new List(); + + var usersGroupName = GetUsersGroupName(collectionName); + + foreach (string userPath in ActiveDirectoryUtils.GetGroupObjects(usersGroupName, "user")) + { + var userObject = ActiveDirectoryUtils.GetADObject(userPath); + var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(userObject, "sAMAccountName"); + + users.Add(samName); + } + + return users; + } + + private void AddUserGroupsToCollection(Runspace runSpace, string collectionName, List groups) + { + Command cmd = new Command("Set-RDSessionCollectionConfiguration"); + cmd.Parameters.Add("CollectionName", collectionName); + cmd.Parameters.Add("UserGroup", groups); + cmd.Parameters.Add("ConnectionBroker", ConnectionBroker); + + ExecuteShellCommand(runSpace, cmd, false).FirstOrDefault(); + } + + private void AddComputerToCollectionAdComputerGroup(string organizationId, string collectionName, RdsServer server) + { + var computerPath = GetComputerPath(server.Name, false); + var computerGroupName = GetComputersGroupName( collectionName); + + if (!ActiveDirectoryUtils.AdObjectExists(computerPath)) + { + computerPath = GetComputerPath(server.Name, true); + } + + if (ActiveDirectoryUtils.AdObjectExists(computerPath)) + { + var computerObject = ActiveDirectoryUtils.GetADObject(computerPath); + var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName"); + + if (!ActiveDirectoryUtils.IsComputerInGroup(samName, computerGroupName)) + { + ActiveDirectoryUtils.AddObjectToGroup(computerPath, GetComputerGroupPath(organizationId, collectionName)); + } + } + } + + private void RemoveComputerFromCollectionAdComputerGroup(string organizationId, string collectionName, RdsServer server) + { + var computerPath = GetComputerPath(server.Name, false); + var computerGroupName = GetComputersGroupName(collectionName); + + if (!ActiveDirectoryUtils.AdObjectExists(computerPath)) + { + computerPath = GetComputerPath(server.Name, true); + } + + if (ActiveDirectoryUtils.AdObjectExists(computerPath)) + { + var computerObject = ActiveDirectoryUtils.GetADObject(computerPath); + var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName"); + + if (ActiveDirectoryUtils.IsComputerInGroup(samName, computerGroupName)) + { + ActiveDirectoryUtils.RemoveObjectFromGroup(computerPath, GetComputerGroupPath(organizationId, collectionName)); + } + } + } + + public bool AddSessionHostFeatureToServer(string hostName) + { + bool installationResult = false; + + Runspace runSpace = null; + + try + { + runSpace = OpenRunspace(); + + var feature = AddFeature(runSpace, hostName, "RDS-RD-Server", true, true); + + installationResult = (bool) GetPSObjectProperty(feature, "Success"); + } + finally + { + CloseRunspace(runSpace); + } + + return installationResult; + } + + public bool CheckSessionHostFeatureInstallation(string hostName) + { + bool isInstalled = false; + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-WindowsFeature"); + cmd.Parameters.Add("Name", "RDS-RD-Server"); + + var feature = ExecuteRemoteShellCommand(runSpace, hostName, cmd).FirstOrDefault(); + + if (feature != null) + { + isInstalled = (bool) GetPSObjectProperty(feature, "Installed"); + } + } + finally + { + CloseRunspace(runSpace); + } + + return isInstalled; + } + + public bool CheckServerAvailability(string hostName) + { + var ping = new Ping(); + + var ipAddress = GetServerIp(hostName); + + var reply = ping.Send(ipAddress, 3000); + + return reply != null && reply.Status == IPStatus.Success; + } + + #region Helpers + + private static string ConvertByteToStringSid(Byte[] sidBytes) + { + StringBuilder strSid = new StringBuilder(); + strSid.Append("S-"); + try + { + // Add SID revision. + strSid.Append(sidBytes[0].ToString()); + // Next six bytes are SID authority value. + if (sidBytes[6] != 0 || sidBytes[5] != 0) + { + string strAuth = String.Format + ("0x{0:2x}{1:2x}{2:2x}{3:2x}{4:2x}{5:2x}", + (Int16)sidBytes[1], + (Int16)sidBytes[2], + (Int16)sidBytes[3], + (Int16)sidBytes[4], + (Int16)sidBytes[5], + (Int16)sidBytes[6]); + strSid.Append("-"); + strSid.Append(strAuth); + } + else + { + Int64 iVal = (Int32)(sidBytes[1]) + + (Int32)(sidBytes[2] << 8) + + (Int32)(sidBytes[3] << 16) + + (Int32)(sidBytes[4] << 24); + strSid.Append("-"); + strSid.Append(iVal.ToString()); + } + + // Get sub authority count... + int iSubCount = Convert.ToInt32(sidBytes[7]); + int idxAuth = 0; + for (int i = 0; i < iSubCount; i++) + { + idxAuth = 8 + i * 4; + UInt32 iSubAuth = BitConverter.ToUInt32(sidBytes, idxAuth); + strSid.Append("-"); + strSid.Append(iSubAuth.ToString()); + } + } + catch + { + return ""; + } + return strSid.ToString(); + } + + private StartMenuApp CreateStartMenuAppFromPsObject(PSObject psObject) + { + var remoteApp = new StartMenuApp + { + DisplayName = Convert.ToString(GetPSObjectProperty(psObject, "DisplayName")), + FilePath = Convert.ToString(GetPSObjectProperty(psObject, "FilePath")), + FileVirtualPath = Convert.ToString(GetPSObjectProperty(psObject, "FileVirtualPath")) + }; + + return remoteApp; + } + + private RemoteApplication CreateRemoteApplicationFromPsObject(PSObject psObject) + { + var remoteApp = new RemoteApplication + { + DisplayName = Convert.ToString(GetPSObjectProperty(psObject, "DisplayName")), + FilePath = Convert.ToString(GetPSObjectProperty(psObject, "FilePath")), + Alias = Convert.ToString(GetPSObjectProperty(psObject, "Alias")), + ShowInWebAccess = Convert.ToBoolean(GetPSObjectProperty(psObject, "ShowInWebAccess")) + }; + + return remoteApp; + } + + internal IPAddress GetServerIp(string hostname, AddressFamily addressFamily = AddressFamily.InterNetwork) + { + var address = GetServerIps(hostname); + + return address.FirstOrDefault(x => x.AddressFamily == addressFamily); + } + + internal IEnumerable GetServerIps(string hostname) + { + var address = Dns.GetHostAddresses(hostname); + + return address; + } + + internal void RemoveItem(Runspace runSpace, string path) + { + Command rdRapCommand = new Command("Remove-Item"); + rdRapCommand.Parameters.Add("Path", path); + rdRapCommand.Parameters.Add("Force", true); + rdRapCommand.Parameters.Add("Recurse", true); + + ExecuteShellCommand(runSpace, rdRapCommand, false); + } + + internal void RemoveItemRemote(Runspace runSpace, string hostname, string path, params string[] imports) + { + Command rdRapCommand = new Command("Remove-Item"); + rdRapCommand.Parameters.Add("Path", string.Format("\"{0}\"", path)); + rdRapCommand.Parameters.Add("Force", ""); + rdRapCommand.Parameters.Add("Recurse", ""); + + ExecuteRemoteShellCommand(runSpace, hostname, rdRapCommand, imports); + } + + private string GetComputersGroupName(string collectionName) + { + return string.Format(RdsGroupFormat, collectionName, Computers.ToLowerInvariant()); + } + + private string GetUsersGroupName(string collectionName) + { + return string.Format(RdsGroupFormat, collectionName, Users.ToLowerInvariant()); + } + + internal string GetComputerGroupPath(string organizationId, string collection) + { + StringBuilder sb = new StringBuilder(); + // append provider + AppendProtocol(sb); + AppendDomainController(sb); + AppendCNPath(sb, GetComputersGroupName(collection)); + AppendOUPath(sb, organizationId); + AppendOUPath(sb, RootOU); + AppendDomainPath(sb, RootDomain); + + return sb.ToString(); + } + + internal string GetUsersGroupPath(string organizationId, string collection) + { + StringBuilder sb = new StringBuilder(); + // append provider + AppendProtocol(sb); + AppendDomainController(sb); + AppendCNPath(sb, GetUsersGroupName(collection)); + AppendOUPath(sb, organizationId); + AppendOUPath(sb, RootOU); + AppendDomainPath(sb, RootDomain); + + return sb.ToString(); + } + + private string GetUserPath(string organizationId, string loginName) + { + StringBuilder sb = new StringBuilder(); + // append provider + AppendProtocol(sb); + AppendDomainController(sb); + AppendCNPath(sb, loginName); + AppendOUPath(sb, organizationId); + AppendOUPath(sb, RootOU); + AppendDomainPath(sb, RootDomain); + + return sb.ToString(); + } + + private string GetOrganizationPath(string organizationId) + { + StringBuilder sb = new StringBuilder(); + // append provider + AppendProtocol(sb); + AppendDomainController(sb); + AppendOUPath(sb, organizationId); + AppendOUPath(sb, RootOU); + AppendDomainPath(sb, RootDomain); + + return sb.ToString(); + } + + private string GetComputerPath(string objName, bool domainController) + { + StringBuilder sb = new StringBuilder(); + // append provider + AppendProtocol(sb); + AppendDomainController(sb); + AppendCNPath(sb, objName); + if (domainController) + { + AppendOUPath(sb, AdDcComputers); + } + else + { + AppendCNPath(sb, Computers); + + } + AppendDomainPath(sb, RootDomain); + + return sb.ToString(); + } + + private static void AppendCNPath(StringBuilder sb, string organizationId) + { + if (string.IsNullOrEmpty(organizationId)) + return; + + sb.Append("CN=").Append(organizationId).Append(","); + } + + private void AppendDomainController(StringBuilder sb) + { + sb.Append(PrimaryDomainController + "/"); + } + + private static void AppendProtocol(StringBuilder sb) + { + sb.Append("LDAP://"); + } + + private static void AppendOUPath(StringBuilder sb, string ou) + { + if (string.IsNullOrEmpty(ou)) + return; + + string path = ou.Replace("/", "\\"); + string[] parts = path.Split('\\'); + for (int i = parts.Length - 1; i != -1; i--) + sb.Append("OU=").Append(parts[i]).Append(","); + } + + private static void AppendDomainPath(StringBuilder sb, string domain) + { + if (string.IsNullOrEmpty(domain)) + return; + + string[] parts = domain.Split('.'); + for (int i = 0; i < parts.Length; i++) + { + sb.Append("DC=").Append(parts[i]); + + if (i < (parts.Length - 1)) + sb.Append(","); + } + } + + #endregion + + #region Windows Feature PowerShell + + internal bool IsFeatureInstalled(string hostName, string featureName) + { + bool isInstalled = false; + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-WindowsFeature"); + cmd.Parameters.Add("Name", featureName); + + var feature = ExecuteRemoteShellCommand(runSpace, hostName, cmd).FirstOrDefault(); + + if (feature != null) + { + isInstalled = (bool) GetPSObjectProperty(feature, "Installed"); + } + } + finally + { + CloseRunspace(runSpace); + } + + return isInstalled; + } + + internal PSObject AddFeature(Runspace runSpace, string hostName, string featureName, bool includeAllSubFeature = true, bool restart = false) + { + PSObject feature; + + try + { + Command cmd = new Command("Add-WindowsFeature"); + cmd.Parameters.Add("Name", featureName); + + if (includeAllSubFeature) + { + cmd.Parameters.Add("IncludeAllSubFeature", ""); + } + + if (restart) + { + cmd.Parameters.Add("Restart", ""); + } + + feature = ExecuteRemoteShellCommand(runSpace, hostName, cmd).FirstOrDefault(); + } + finally + { + CloseRunspace(runSpace); + } + + return feature; + } + + #endregion + + #region PowerShell integration + + private static InitialSessionState session = null; + + internal virtual Runspace OpenRunspace() + { + Log.WriteStart("OpenRunspace"); + + if (session == null) + { + session = InitialSessionState.CreateDefault(); + session.ImportPSModule(new string[] { "ServerManager", "RemoteDesktop", "RemoteDesktopServices" }); + } + Runspace runSpace = RunspaceFactory.CreateRunspace(session); + // + runSpace.Open(); + // + runSpace.SessionStateProxy.SetVariable("ConfirmPreference", "none"); + Log.WriteEnd("OpenRunspace"); + return runSpace; + } + + internal void CloseRunspace(Runspace runspace) + { + try + { + if (runspace != null && runspace.RunspaceStateInfo.State == RunspaceState.Opened) + { + runspace.Close(); + } + } + catch (Exception ex) + { + Log.WriteError("Runspace error", ex); + } + } + + internal Collection ExecuteRemoteShellCommand(Runspace runSpace, string hostName, Command cmd, params string[] moduleImports) + { + Command invokeCommand = new Command("Invoke-Command"); + invokeCommand.Parameters.Add("ComputerName", hostName); + + RunspaceInvoke invoke = new RunspaceInvoke(); + + string commandString = moduleImports.Any() ? string.Format("import-module {0};", string.Join(",", moduleImports)) : string.Empty; + + commandString += cmd.CommandText; + + if (cmd.Parameters != null && cmd.Parameters.Any()) + { + commandString += " " + + string.Join(" ", + cmd.Parameters.Select(x => string.Format("-{0} {1}", x.Name, x.Value)).ToArray()); + } + + ScriptBlock sb = invoke.Invoke(string.Format("{{{0}}}", commandString))[0].BaseObject as ScriptBlock; + + invokeCommand.Parameters.Add("ScriptBlock", sb); + + return ExecuteShellCommand(runSpace, invokeCommand, false); + } + + internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd) + { + return ExecuteShellCommand(runSpace, cmd, true); + } + + internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController) + { + object[] errors; + return ExecuteShellCommand(runSpace, cmd, useDomainController, out errors); + } + + internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, out object[] errors) + { + return ExecuteShellCommand(runSpace, cmd, true, out errors); + } + + internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController, + out object[] errors) + { + Log.WriteStart("ExecuteShellCommand"); + List errorList = new List(); + + if (useDomainController) + { + CommandParameter dc = new CommandParameter("DomainController", PrimaryDomainController); + if (!cmd.Parameters.Contains(dc)) + { + cmd.Parameters.Add(dc); + } + } + + Collection results = null; + // Create a pipeline + Pipeline pipeLine = runSpace.CreatePipeline(); + using (pipeLine) + { + // Add the command + pipeLine.Commands.Add(cmd); + // Execute the pipeline and save the objects returned. + results = pipeLine.Invoke(); + + // Log out any errors in the pipeline execution + // NOTE: These errors are NOT thrown as exceptions! + // Be sure to check this to ensure that no errors + // happened while executing the command. + if (pipeLine.Error != null && pipeLine.Error.Count > 0) + { + foreach (object item in pipeLine.Error.ReadToEnd()) + { + errorList.Add(item); + string errorMessage = string.Format("Invoke error: {0}", item); + Log.WriteWarning(errorMessage); + } + } + } + pipeLine = null; + errors = errorList.ToArray(); + Log.WriteEnd("ExecuteShellCommand"); + return results; + } + + internal object GetPSObjectProperty(PSObject obj, string name) + { + return obj.Members[name].Value; + } + + /// + /// Returns the identity of the object from the shell execution result + /// + /// + /// + internal string GetResultObjectIdentity(Collection result) + { + Log.WriteStart("GetResultObjectIdentity"); + if (result == null) + throw new ArgumentNullException("result", "Execution result is not specified"); + + if (result.Count < 1) + throw new ArgumentException("Execution result is empty", "result"); + + if (result.Count > 1) + throw new ArgumentException("Execution result contains more than one object", "result"); + + PSMemberInfo info = result[0].Members["Identity"]; + if (info == null) + throw new ArgumentException("Execution result does not contain Identity property", "result"); + + string ret = info.Value.ToString(); + Log.WriteEnd("GetResultObjectIdentity"); + return ret; + } + + internal string GetResultObjectDN(Collection result) + { + Log.WriteStart("GetResultObjectDN"); + if (result == null) + throw new ArgumentNullException("result", "Execution result is not specified"); + + if (result.Count < 1) + throw new ArgumentException("Execution result does not contain any object"); + + if (result.Count > 1) + throw new ArgumentException("Execution result contains more than one object"); + + PSMemberInfo info = result[0].Members["DistinguishedName"]; + if (info == null) + throw new ArgumentException("Execution result does not contain DistinguishedName property", "result"); + + string ret = info.Value.ToString(); + Log.WriteEnd("GetResultObjectDN"); + return ret; + } + + internal bool ItemExists(Runspace runSpace, string path) + { + Command testPathCommand = new Command("Test-Path"); + testPathCommand.Parameters.Add("Path", path); + + var testPathResult = ExecuteShellCommand(runSpace, testPathCommand, false).First(); + + var result = Convert.ToBoolean(testPathResult.ToString()); + + return result; + } + + internal bool ItemExistsRemote(Runspace runSpace, string hostname,string path) + { + Command testPathCommand = new Command("Test-Path"); + testPathCommand.Parameters.Add("Path", string.Format("\"{0}\"", path)); + + var testPathResult = ExecuteRemoteShellCommand(runSpace, hostname, testPathCommand, RdsModuleName).First(); + + var result = Convert.ToBoolean(testPathResult.ToString()); + + return result; + } + + #endregion } } + diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs index 0b6d8aad..699cb445 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs @@ -43,25 +43,1326 @@ using WebsitePanel.Providers.HostedSolution; namespace WebsitePanel.Providers.RemoteDesktopServices { - using System.Xml.Serialization; - using System.Web.Services; - using System.ComponentModel; - using System.Web.Services.Protocols; using System; + using System.ComponentModel; using System.Diagnostics; - - + using System.Web.Services; + using System.Web.Services.Protocols; + using System.Xml.Serialization; + /// - // CODEGEN: No methods were found in the WSDL for this protocol. [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name="RemoteDesktopServicesSoap", Namespace="http://smbsaas/websitepanel/server/")] - public partial class RemoteDesktopServices : Microsoft.Web.Services3.WebServicesClientProtocol { - + [System.Web.Services.WebServiceBindingAttribute(Name = "RemoteDesktopServicesSoap", Namespace = "http://smbsaas/websitepanel/server/")] + public partial class RemoteDesktopServices : Microsoft.Web.Services3.WebServicesClientProtocol + { + public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; + + private System.Threading.SendOrPostCallback CreateCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback GetCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback SetUsersInCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback AddSessionHostServerToCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback AddSessionHostServersToCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveSessionHostServerFromCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveSessionHostServersFromCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback GetAvailableRemoteApplicationsOperationCompleted; + + private System.Threading.SendOrPostCallback GetCollectionRemoteApplicationsOperationCompleted; + + private System.Threading.SendOrPostCallback AddRemoteApplicationOperationCompleted; + + private System.Threading.SendOrPostCallback AddRemoteApplicationsOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveRemoteApplicationOperationCompleted; + + private System.Threading.SendOrPostCallback AddSessionHostFeatureToServerOperationCompleted; + + private System.Threading.SendOrPostCallback CheckSessionHostFeatureInstallationOperationCompleted; + + private System.Threading.SendOrPostCallback CheckServerAvailabilityOperationCompleted; + /// - public RemoteDesktopServices() { - this.Url = "http://localhost:9003/RemoteDesktopServices.asmx"; + public RemoteDesktopServices() + { + this.Url = "http://127.0.0.1:9003/RemoteDesktopServices.asmx"; + } + + /// + public event CreateCollectionCompletedEventHandler CreateCollectionCompleted; + + /// + public event GetCollectionCompletedEventHandler GetCollectionCompleted; + + /// + public event RemoveCollectionCompletedEventHandler RemoveCollectionCompleted; + + /// + public event SetUsersInCollectionCompletedEventHandler SetUsersInCollectionCompleted; + + /// + public event AddSessionHostServerToCollectionCompletedEventHandler AddSessionHostServerToCollectionCompleted; + + /// + public event AddSessionHostServersToCollectionCompletedEventHandler AddSessionHostServersToCollectionCompleted; + + /// + public event RemoveSessionHostServerFromCollectionCompletedEventHandler RemoveSessionHostServerFromCollectionCompleted; + + /// + public event RemoveSessionHostServersFromCollectionCompletedEventHandler RemoveSessionHostServersFromCollectionCompleted; + + /// + public event GetAvailableRemoteApplicationsCompletedEventHandler GetAvailableRemoteApplicationsCompleted; + + /// + public event GetCollectionRemoteApplicationsCompletedEventHandler GetCollectionRemoteApplicationsCompleted; + + /// + public event AddRemoteApplicationCompletedEventHandler AddRemoteApplicationCompleted; + + /// + public event AddRemoteApplicationsCompletedEventHandler AddRemoteApplicationsCompleted; + + /// + public event RemoveRemoteApplicationCompletedEventHandler RemoveRemoteApplicationCompleted; + + /// + public event AddSessionHostFeatureToServerCompletedEventHandler AddSessionHostFeatureToServerCompleted; + + /// + public event CheckSessionHostFeatureInstallationCompletedEventHandler CheckSessionHostFeatureInstallationCompleted; + + /// + public event CheckServerAvailabilityCompletedEventHandler CheckServerAvailabilityCompleted; + + /// + [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)] + public bool CreateCollection(string organizationId, RdsCollection collection) + { + object[] results = this.Invoke("CreateCollection", new object[] { + organizationId, + collection}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateCollection(string organizationId, RdsCollection collection, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("CreateCollection", new object[] { + organizationId, + collection}, callback, asyncState); + } + + /// + public bool EndCreateCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void CreateCollectionAsync(string organizationId, RdsCollection collection) + { + this.CreateCollectionAsync(organizationId, collection, null); + } + + /// + public void CreateCollectionAsync(string organizationId, RdsCollection collection, object userState) + { + if ((this.CreateCollectionOperationCompleted == null)) + { + this.CreateCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateCollectionOperationCompleted); + } + this.InvokeAsync("CreateCollection", new object[] { + organizationId, + collection}, this.CreateCollectionOperationCompleted, userState); + } + + private void OnCreateCollectionOperationCompleted(object arg) + { + if ((this.CreateCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateCollectionCompleted(this, new CreateCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetCollection", 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 RdsCollection GetCollection(string collectionName) + { + object[] results = this.Invoke("GetCollection", new object[] { + collectionName}); + return ((RdsCollection)(results[0])); + } + + /// + public System.IAsyncResult BeginGetCollection(string collectionName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetCollection", new object[] { + collectionName}, callback, asyncState); + } + + /// + public RdsCollection EndGetCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RdsCollection)(results[0])); + } + + /// + public void GetCollectionAsync(string collectionName) + { + this.GetCollectionAsync(collectionName, null); + } + + /// + public void GetCollectionAsync(string collectionName, object userState) + { + if ((this.GetCollectionOperationCompleted == null)) + { + this.GetCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCollectionOperationCompleted); + } + this.InvokeAsync("GetCollection", new object[] { + collectionName}, this.GetCollectionOperationCompleted, userState); + } + + private void OnGetCollectionOperationCompleted(object arg) + { + if ((this.GetCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetCollectionCompleted(this, new GetCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveCollection", 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 bool RemoveCollection(string organizationId, string collectionName) + { + object[] results = this.Invoke("RemoveCollection", new object[] { + organizationId, + collectionName}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginRemoveCollection(string organizationId, string collectionName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("RemoveCollection", new object[] { + organizationId, + collectionName}, callback, asyncState); + } + + /// + public bool EndRemoveCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void RemoveCollectionAsync(string organizationId, string collectionName) + { + this.RemoveCollectionAsync(organizationId, collectionName, null); + } + + /// + public void RemoveCollectionAsync(string organizationId, string collectionName, object userState) + { + if ((this.RemoveCollectionOperationCompleted == null)) + { + this.RemoveCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveCollectionOperationCompleted); + } + this.InvokeAsync("RemoveCollection", new object[] { + organizationId, + collectionName}, this.RemoveCollectionOperationCompleted, userState); + } + + private void OnRemoveCollectionOperationCompleted(object arg) + { + if ((this.RemoveCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveCollectionCompleted(this, new RemoveCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetUsersInCollection", 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 bool SetUsersInCollection(string organizationId, string collectionName, string[] users) + { + object[] results = this.Invoke("SetUsersInCollection", new object[] { + organizationId, + collectionName, + users}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginSetUsersInCollection(string organizationId, string collectionName, string[] users, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SetUsersInCollection", new object[] { + organizationId, + collectionName, + users}, callback, asyncState); + } + + /// + public bool EndSetUsersInCollection(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void SetUsersInCollectionAsync(string organizationId, string collectionName, string[] users) + { + this.SetUsersInCollectionAsync(organizationId, collectionName, users, null); + } + + /// + public void SetUsersInCollectionAsync(string organizationId, string collectionName, string[] users, object userState) + { + if ((this.SetUsersInCollectionOperationCompleted == null)) + { + this.SetUsersInCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUsersInCollectionOperationCompleted); + } + this.InvokeAsync("SetUsersInCollection", new object[] { + organizationId, + collectionName, + users}, this.SetUsersInCollectionOperationCompleted, userState); + } + + private void OnSetUsersInCollectionOperationCompleted(object arg) + { + if ((this.SetUsersInCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetUsersInCollectionCompleted(this, new SetUsersInCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddSessionHostServerToCollection", 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 AddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server) + { + this.Invoke("AddSessionHostServerToCollection", new object[] { + organizationId, + collectionName, + server}); + } + + /// + public System.IAsyncResult BeginAddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddSessionHostServerToCollection", new object[] { + organizationId, + collectionName, + server}, callback, asyncState); + } + + /// + public void EndAddSessionHostServerToCollection(System.IAsyncResult asyncResult) + { + this.EndInvoke(asyncResult); + } + + /// + public void AddSessionHostServerToCollectionAsync(string organizationId, string collectionName, RdsServer server) + { + this.AddSessionHostServerToCollectionAsync(organizationId, collectionName, server, null); + } + + /// + public void AddSessionHostServerToCollectionAsync(string organizationId, string collectionName, RdsServer server, object userState) + { + if ((this.AddSessionHostServerToCollectionOperationCompleted == null)) + { + this.AddSessionHostServerToCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddSessionHostServerToCollectionOperationCompleted); + } + this.InvokeAsync("AddSessionHostServerToCollection", new object[] { + organizationId, + collectionName, + server}, this.AddSessionHostServerToCollectionOperationCompleted, userState); + } + + private void OnAddSessionHostServerToCollectionOperationCompleted(object arg) + { + if ((this.AddSessionHostServerToCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddSessionHostServerToCollectionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddSessionHostServersToCollection", 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 AddSessionHostServersToCollection(string organizationId, string collectionName, RdsServer[] servers) + { + this.Invoke("AddSessionHostServersToCollection", new object[] { + organizationId, + collectionName, + servers}); + } + + /// + public System.IAsyncResult BeginAddSessionHostServersToCollection(string organizationId, string collectionName, RdsServer[] servers, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddSessionHostServersToCollection", new object[] { + organizationId, + collectionName, + servers}, callback, asyncState); + } + + /// + public void EndAddSessionHostServersToCollection(System.IAsyncResult asyncResult) + { + this.EndInvoke(asyncResult); + } + + /// + public void AddSessionHostServersToCollectionAsync(string organizationId, string collectionName, RdsServer[] servers) + { + this.AddSessionHostServersToCollectionAsync(organizationId, collectionName, servers, null); + } + + /// + public void AddSessionHostServersToCollectionAsync(string organizationId, string collectionName, RdsServer[] servers, object userState) + { + if ((this.AddSessionHostServersToCollectionOperationCompleted == null)) + { + this.AddSessionHostServersToCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddSessionHostServersToCollectionOperationCompleted); + } + this.InvokeAsync("AddSessionHostServersToCollection", new object[] { + organizationId, + collectionName, + servers}, this.AddSessionHostServersToCollectionOperationCompleted, userState); + } + + private void OnAddSessionHostServersToCollectionOperationCompleted(object arg) + { + if ((this.AddSessionHostServersToCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddSessionHostServersToCollectionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveSessionHostServerFromCollection", 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 RemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server) + { + this.Invoke("RemoveSessionHostServerFromCollection", new object[] { + organizationId, + collectionName, + server}); + } + + /// + public System.IAsyncResult BeginRemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("RemoveSessionHostServerFromCollection", new object[] { + organizationId, + collectionName, + server}, callback, asyncState); + } + + /// + public void EndRemoveSessionHostServerFromCollection(System.IAsyncResult asyncResult) + { + this.EndInvoke(asyncResult); + } + + /// + public void RemoveSessionHostServerFromCollectionAsync(string organizationId, string collectionName, RdsServer server) + { + this.RemoveSessionHostServerFromCollectionAsync(organizationId, collectionName, server, null); + } + + /// + public void RemoveSessionHostServerFromCollectionAsync(string organizationId, string collectionName, RdsServer server, object userState) + { + if ((this.RemoveSessionHostServerFromCollectionOperationCompleted == null)) + { + this.RemoveSessionHostServerFromCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveSessionHostServerFromCollectionOperationCompleted); + } + this.InvokeAsync("RemoveSessionHostServerFromCollection", new object[] { + organizationId, + collectionName, + server}, this.RemoveSessionHostServerFromCollectionOperationCompleted, userState); + } + + private void OnRemoveSessionHostServerFromCollectionOperationCompleted(object arg) + { + if ((this.RemoveSessionHostServerFromCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveSessionHostServerFromCollectionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveSessionHostServersFromCollection", 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 RemoveSessionHostServersFromCollection(string organizationId, string collectionName, RdsServer[] servers) + { + this.Invoke("RemoveSessionHostServersFromCollection", new object[] { + organizationId, + collectionName, + servers}); + } + + /// + public System.IAsyncResult BeginRemoveSessionHostServersFromCollection(string organizationId, string collectionName, RdsServer[] servers, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("RemoveSessionHostServersFromCollection", new object[] { + organizationId, + collectionName, + servers}, callback, asyncState); + } + + /// + public void EndRemoveSessionHostServersFromCollection(System.IAsyncResult asyncResult) + { + this.EndInvoke(asyncResult); + } + + /// + public void RemoveSessionHostServersFromCollectionAsync(string organizationId, string collectionName, RdsServer[] servers) + { + this.RemoveSessionHostServersFromCollectionAsync(organizationId, collectionName, servers, null); + } + + /// + public void RemoveSessionHostServersFromCollectionAsync(string organizationId, string collectionName, RdsServer[] servers, object userState) + { + if ((this.RemoveSessionHostServersFromCollectionOperationCompleted == null)) + { + this.RemoveSessionHostServersFromCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveSessionHostServersFromCollectionOperationCompleted); + } + this.InvokeAsync("RemoveSessionHostServersFromCollection", new object[] { + organizationId, + collectionName, + servers}, this.RemoveSessionHostServersFromCollectionOperationCompleted, userState); + } + + private void OnRemoveSessionHostServersFromCollectionOperationCompleted(object arg) + { + if ((this.RemoveSessionHostServersFromCollectionCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveSessionHostServersFromCollectionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetAvailableRemoteApplications", 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 StartMenuApp[] GetAvailableRemoteApplications(string collectionName) + { + object[] results = this.Invoke("GetAvailableRemoteApplications", new object[] { + collectionName}); + return ((StartMenuApp[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetAvailableRemoteApplications(string collectionName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetAvailableRemoteApplications", new object[] { + collectionName}, callback, asyncState); + } + + /// + public StartMenuApp[] EndGetAvailableRemoteApplications(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((StartMenuApp[])(results[0])); + } + + /// + public void GetAvailableRemoteApplicationsAsync(string collectionName) + { + this.GetAvailableRemoteApplicationsAsync(collectionName, null); + } + + /// + public void GetAvailableRemoteApplicationsAsync(string collectionName, object userState) + { + if ((this.GetAvailableRemoteApplicationsOperationCompleted == null)) + { + this.GetAvailableRemoteApplicationsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAvailableRemoteApplicationsOperationCompleted); + } + this.InvokeAsync("GetAvailableRemoteApplications", new object[] { + collectionName}, this.GetAvailableRemoteApplicationsOperationCompleted, userState); + } + + private void OnGetAvailableRemoteApplicationsOperationCompleted(object arg) + { + if ((this.GetAvailableRemoteApplicationsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetAvailableRemoteApplicationsCompleted(this, new GetAvailableRemoteApplicationsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetCollectionRemoteApplications", 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 RemoteApplication[] GetCollectionRemoteApplications(string collectionName) + { + object[] results = this.Invoke("GetCollectionRemoteApplications", new object[] { + collectionName}); + return ((RemoteApplication[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetCollectionRemoteApplications(string collectionName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetCollectionRemoteApplications", new object[] { + collectionName}, callback, asyncState); + } + + /// + public RemoteApplication[] EndGetCollectionRemoteApplications(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((RemoteApplication[])(results[0])); + } + + /// + public void GetCollectionRemoteApplicationsAsync(string collectionName) + { + this.GetCollectionRemoteApplicationsAsync(collectionName, null); + } + + /// + public void GetCollectionRemoteApplicationsAsync(string collectionName, object userState) + { + if ((this.GetCollectionRemoteApplicationsOperationCompleted == null)) + { + this.GetCollectionRemoteApplicationsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetCollectionRemoteApplicationsOperationCompleted); + } + this.InvokeAsync("GetCollectionRemoteApplications", new object[] { + collectionName}, this.GetCollectionRemoteApplicationsOperationCompleted, userState); + } + + private void OnGetCollectionRemoteApplicationsOperationCompleted(object arg) + { + if ((this.GetCollectionRemoteApplicationsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetCollectionRemoteApplicationsCompleted(this, new GetCollectionRemoteApplicationsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddRemoteApplication", 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 bool AddRemoteApplication(string collectionName, RemoteApplication remoteApp) + { + object[] results = this.Invoke("AddRemoteApplication", new object[] { + collectionName, + remoteApp}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginAddRemoteApplication(string collectionName, RemoteApplication remoteApp, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddRemoteApplication", new object[] { + collectionName, + remoteApp}, callback, asyncState); + } + + /// + public bool EndAddRemoteApplication(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void AddRemoteApplicationAsync(string collectionName, RemoteApplication remoteApp) + { + this.AddRemoteApplicationAsync(collectionName, remoteApp, null); + } + + /// + public void AddRemoteApplicationAsync(string collectionName, RemoteApplication remoteApp, object userState) + { + if ((this.AddRemoteApplicationOperationCompleted == null)) + { + this.AddRemoteApplicationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddRemoteApplicationOperationCompleted); + } + this.InvokeAsync("AddRemoteApplication", new object[] { + collectionName, + remoteApp}, this.AddRemoteApplicationOperationCompleted, userState); + } + + private void OnAddRemoteApplicationOperationCompleted(object arg) + { + if ((this.AddRemoteApplicationCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddRemoteApplicationCompleted(this, new AddRemoteApplicationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddRemoteApplications", 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 bool AddRemoteApplications(string collectionName, RemoteApplication[] remoteApps) + { + object[] results = this.Invoke("AddRemoteApplications", new object[] { + collectionName, + remoteApps}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginAddRemoteApplications(string collectionName, RemoteApplication[] remoteApps, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddRemoteApplications", new object[] { + collectionName, + remoteApps}, callback, asyncState); + } + + /// + public bool EndAddRemoteApplications(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void AddRemoteApplicationsAsync(string collectionName, RemoteApplication[] remoteApps) + { + this.AddRemoteApplicationsAsync(collectionName, remoteApps, null); + } + + /// + public void AddRemoteApplicationsAsync(string collectionName, RemoteApplication[] remoteApps, object userState) + { + if ((this.AddRemoteApplicationsOperationCompleted == null)) + { + this.AddRemoteApplicationsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddRemoteApplicationsOperationCompleted); + } + this.InvokeAsync("AddRemoteApplications", new object[] { + collectionName, + remoteApps}, this.AddRemoteApplicationsOperationCompleted, userState); + } + + private void OnAddRemoteApplicationsOperationCompleted(object arg) + { + if ((this.AddRemoteApplicationsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddRemoteApplicationsCompleted(this, new AddRemoteApplicationsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveRemoteApplication", 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 bool RemoveRemoteApplication(string collectionName, RemoteApplication remoteApp) + { + object[] results = this.Invoke("RemoveRemoteApplication", new object[] { + collectionName, + remoteApp}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginRemoveRemoteApplication(string collectionName, RemoteApplication remoteApp, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("RemoveRemoteApplication", new object[] { + collectionName, + remoteApp}, callback, asyncState); + } + + /// + public bool EndRemoveRemoteApplication(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void RemoveRemoteApplicationAsync(string collectionName, RemoteApplication remoteApp) + { + this.RemoveRemoteApplicationAsync(collectionName, remoteApp, null); + } + + /// + public void RemoveRemoteApplicationAsync(string collectionName, RemoteApplication remoteApp, object userState) + { + if ((this.RemoveRemoteApplicationOperationCompleted == null)) + { + this.RemoveRemoteApplicationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveRemoteApplicationOperationCompleted); + } + this.InvokeAsync("RemoveRemoteApplication", new object[] { + collectionName, + remoteApp}, this.RemoveRemoteApplicationOperationCompleted, userState); + } + + private void OnRemoveRemoteApplicationOperationCompleted(object arg) + { + if ((this.RemoveRemoteApplicationCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveRemoteApplicationCompleted(this, new RemoveRemoteApplicationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddSessionHostFeatureToServer", 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 bool AddSessionHostFeatureToServer(string hostName) + { + object[] results = this.Invoke("AddSessionHostFeatureToServer", new object[] { + hostName}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginAddSessionHostFeatureToServer(string hostName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddSessionHostFeatureToServer", new object[] { + hostName}, callback, asyncState); + } + + /// + public bool EndAddSessionHostFeatureToServer(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void AddSessionHostFeatureToServerAsync(string hostName) + { + this.AddSessionHostFeatureToServerAsync(hostName, null); + } + + /// + public void AddSessionHostFeatureToServerAsync(string hostName, object userState) + { + if ((this.AddSessionHostFeatureToServerOperationCompleted == null)) + { + this.AddSessionHostFeatureToServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddSessionHostFeatureToServerOperationCompleted); + } + this.InvokeAsync("AddSessionHostFeatureToServer", new object[] { + hostName}, this.AddSessionHostFeatureToServerOperationCompleted, userState); + } + + private void OnAddSessionHostFeatureToServerOperationCompleted(object arg) + { + if ((this.AddSessionHostFeatureToServerCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddSessionHostFeatureToServerCompleted(this, new AddSessionHostFeatureToServerCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckSessionHostFeatureInstallation", 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 bool CheckSessionHostFeatureInstallation(string hostName) + { + object[] results = this.Invoke("CheckSessionHostFeatureInstallation", new object[] { + hostName}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginCheckSessionHostFeatureInstallation(string hostName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("CheckSessionHostFeatureInstallation", new object[] { + hostName}, callback, asyncState); + } + + /// + public bool EndCheckSessionHostFeatureInstallation(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void CheckSessionHostFeatureInstallationAsync(string hostName) + { + this.CheckSessionHostFeatureInstallationAsync(hostName, null); + } + + /// + public void CheckSessionHostFeatureInstallationAsync(string hostName, object userState) + { + if ((this.CheckSessionHostFeatureInstallationOperationCompleted == null)) + { + this.CheckSessionHostFeatureInstallationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckSessionHostFeatureInstallationOperationCompleted); + } + this.InvokeAsync("CheckSessionHostFeatureInstallation", new object[] { + hostName}, this.CheckSessionHostFeatureInstallationOperationCompleted, userState); + } + + private void OnCheckSessionHostFeatureInstallationOperationCompleted(object arg) + { + if ((this.CheckSessionHostFeatureInstallationCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CheckSessionHostFeatureInstallationCompleted(this, new CheckSessionHostFeatureInstallationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckServerAvailability", 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 bool CheckServerAvailability(string hostName) + { + object[] results = this.Invoke("CheckServerAvailability", new object[] { + hostName}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginCheckServerAvailability(string hostName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("CheckServerAvailability", new object[] { + hostName}, callback, asyncState); + } + + /// + public bool EndCheckServerAvailability(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void CheckServerAvailabilityAsync(string hostName) + { + this.CheckServerAvailabilityAsync(hostName, null); + } + + /// + public void CheckServerAvailabilityAsync(string hostName, object userState) + { + if ((this.CheckServerAvailabilityOperationCompleted == null)) + { + this.CheckServerAvailabilityOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckServerAvailabilityOperationCompleted); + } + this.InvokeAsync("CheckServerAvailability", new object[] { + hostName}, this.CheckServerAvailabilityOperationCompleted, userState); + } + + private void OnCheckServerAvailabilityOperationCompleted(object arg) + { + if ((this.CheckServerAvailabilityCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CheckServerAvailabilityCompleted(this, new CheckServerAvailabilityCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) + { + base.CancelAsync(userState); } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void CreateCollectionCompletedEventHandler(object sender, CreateCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal CreateCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetCollectionCompletedEventHandler(object sender, GetCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RdsCollection Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RdsCollection)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void RemoveCollectionCompletedEventHandler(object sender, RemoveCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RemoveCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal RemoveCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void SetUsersInCollectionCompletedEventHandler(object sender, SetUsersInCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetUsersInCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SetUsersInCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddSessionHostServerToCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddSessionHostServersToCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void RemoveSessionHostServerFromCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void RemoveSessionHostServersFromCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetAvailableRemoteApplicationsCompletedEventHandler(object sender, GetAvailableRemoteApplicationsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetAvailableRemoteApplicationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetAvailableRemoteApplicationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public StartMenuApp[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((StartMenuApp[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetCollectionRemoteApplicationsCompletedEventHandler(object sender, GetCollectionRemoteApplicationsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetCollectionRemoteApplicationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetCollectionRemoteApplicationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public RemoteApplication[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((RemoteApplication[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddRemoteApplicationCompletedEventHandler(object sender, AddRemoteApplicationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddRemoteApplicationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal AddRemoteApplicationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddRemoteApplicationsCompletedEventHandler(object sender, AddRemoteApplicationsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddRemoteApplicationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal AddRemoteApplicationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void RemoveRemoteApplicationCompletedEventHandler(object sender, RemoveRemoteApplicationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RemoveRemoteApplicationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal RemoveRemoteApplicationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddSessionHostFeatureToServerCompletedEventHandler(object sender, AddSessionHostFeatureToServerCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddSessionHostFeatureToServerCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal AddSessionHostFeatureToServerCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void CheckSessionHostFeatureInstallationCompletedEventHandler(object sender, CheckSessionHostFeatureInstallationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CheckSessionHostFeatureInstallationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal CheckSessionHostFeatureInstallationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void CheckServerAvailabilityCompletedEventHandler(object sender, CheckServerAvailabilityCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CheckServerAvailabilityCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal CheckServerAvailabilityCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs index d6825a2a..96836db9 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs @@ -27,7 +27,10 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Collections.Generic; using System.Data; +using System.Net; +using System.Net.Sockets; using System.Web; using System.Collections; using System.Web.Services; @@ -36,6 +39,7 @@ using System.ComponentModel; using Microsoft.Web.Services3; using WebsitePanel.Providers; +using WebsitePanel.Providers.OS; using WebsitePanel.Providers.RemoteDesktopServices; using WebsitePanel.Server.Utils; @@ -55,7 +59,273 @@ namespace WebsitePanel.Server get { return (IRemoteDesktopServices)Provider; } } + [WebMethod, SoapHeader("settings")] + public bool CreateCollection(string organizationId, RdsCollection collection) + { + try + { + Log.WriteStart("'{0}' CreateCollection", ProviderSettings.ProviderName); + var result = RDSProvider.CreateCollection(organizationId, collection); + Log.WriteEnd("'{0}' CreateCollection", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' CreateCollection", ProviderSettings.ProviderName), ex); + throw; + } + } + [WebMethod, SoapHeader("settings")] + public RdsCollection GetCollection(string collectionName) + { + try + { + Log.WriteStart("'{0}' GetCollection", ProviderSettings.ProviderName); + var result = RDSProvider.GetCollection(collectionName); + Log.WriteEnd("'{0}' GetCollection", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetCollection", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool RemoveCollection(string organizationId, string collectionName) + { + try + { + Log.WriteStart("'{0}' RemoveCollection", ProviderSettings.ProviderName); + var result = RDSProvider.RemoveCollection(organizationId,collectionName); + Log.WriteEnd("'{0}' RemoveCollection", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' RemoveCollection", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool SetUsersInCollection(string organizationId, string collectionName, List users) + { + try + { + Log.WriteStart("'{0}' UpdateUsersInCollection", ProviderSettings.ProviderName); + var result = RDSProvider.SetUsersInCollection(organizationId, collectionName, users); + Log.WriteEnd("'{0}' UpdateUsersInCollection", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' UpdateUsersInCollection", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void AddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server) + { + try + { + Log.WriteStart("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName); + RDSProvider.AddSessionHostServerToCollection(organizationId, collectionName, server); + Log.WriteEnd("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void AddSessionHostServersToCollection(string organizationId, string collectionName, List servers) + { + try + { + Log.WriteStart("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName); + RDSProvider.AddSessionHostServersToCollection(organizationId, collectionName, servers); + Log.WriteEnd("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void RemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server) + { + try + { + Log.WriteStart("'{0}' RemoveSessionHostServerFromCollection", ProviderSettings.ProviderName); + RDSProvider.RemoveSessionHostServerFromCollection(organizationId, collectionName, server); + Log.WriteEnd("'{0}' RemoveSessionHostServerFromCollection", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' RemoveSessionHostServerFromCollection", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void RemoveSessionHostServersFromCollection(string organizationId, string collectionName, List servers) + { + try + { + Log.WriteStart("'{0}' RemoveSessionHostServersFromCollection", ProviderSettings.ProviderName); + RDSProvider.RemoveSessionHostServersFromCollection(organizationId, collectionName, servers); + Log.WriteEnd("'{0}' RemoveSessionHostServersFromCollection", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' RemoveSessionHostServersFromCollection", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public List GetAvailableRemoteApplications(string collectionName) + { + try + { + Log.WriteStart("'{0}' GetAvailableRemoteApplications", ProviderSettings.ProviderName); + var result = RDSProvider.GetAvailableRemoteApplications(collectionName); + Log.WriteEnd("'{0}' GetAvailableRemoteApplications", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' UpdateUsersInCollection", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public List GetCollectionRemoteApplications(string collectionName) + { + try + { + Log.WriteStart("'{0}' GetCollectionRemoteApplications", ProviderSettings.ProviderName); + var result = RDSProvider.GetCollectionRemoteApplications(collectionName); + Log.WriteEnd("'{0}' GetCollectionRemoteApplications", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetCollectionRemoteApplications", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool AddRemoteApplication(string collectionName, RemoteApplication remoteApp) + { + try + { + Log.WriteStart("'{0}' AddRemoteApplication", ProviderSettings.ProviderName); + var result = RDSProvider.AddRemoteApplication(collectionName, remoteApp); + Log.WriteEnd("'{0}' AddRemoteApplication", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' AddRemoteApplication", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool AddRemoteApplications(string collectionName, List remoteApps) + { + try + { + Log.WriteStart("'{0}' AddRemoteApplications", ProviderSettings.ProviderName); + var result = RDSProvider.AddRemoteApplications(collectionName, remoteApps); + Log.WriteEnd("'{0}' AddRemoteApplications", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' AddRemoteApplications", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool RemoveRemoteApplication(string collectionName, RemoteApplication remoteApp) + { + try + { + Log.WriteStart("'{0}' RemoveRemoteApplication", ProviderSettings.ProviderName); + var result = RDSProvider.RemoveRemoteApplication(collectionName, remoteApp); + Log.WriteEnd("'{0}' RemoveRemoteApplication", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' RemoveRemoteApplication", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool AddSessionHostFeatureToServer(string hostName) + { + try + { + Log.WriteStart("'{0}' AddSessionHostFeatureToServer", ProviderSettings.ProviderName); + var result = RDSProvider.AddSessionHostFeatureToServer(hostName); + Log.WriteEnd("'{0}' AddSessionHostFeatureToServer", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool CheckSessionHostFeatureInstallation(string hostName) + { + try + { + Log.WriteStart("'{0}' CheckSessionHostFeatureInstallation", ProviderSettings.ProviderName); + var result = RDSProvider.CheckSessionHostFeatureInstallation(hostName); + Log.WriteEnd("'{0}' CheckSessionHostFeatureInstallation", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' CheckSessionHostFeatureInstallation", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool CheckServerAvailability(string hostName) + { + try + { + Log.WriteStart("'{0}' CheckServerAvailability", ProviderSettings.ProviderName); + var result = RDSProvider.CheckServerAvailability(hostName); + Log.WriteEnd("'{0}' CheckServerAvailability", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' CheckServerAvailability", ProviderSettings.ProviderName), ex); + throw; + } + } } }