diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Installer/App.config b/WebsitePanel.Installer/Sources/WebsitePanel.Installer/App.config deleted file mode 100644 index 60bc4b39..00000000 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Installer/App.config +++ /dev/null @@ -1,20 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Installer/WebsitePanel.Installer.csproj b/WebsitePanel.Installer/Sources/WebsitePanel.Installer/WebsitePanel.Installer.csproj index 2e547b11..b4f667e7 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Installer/WebsitePanel.Installer.csproj +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Installer/WebsitePanel.Installer.csproj @@ -247,10 +247,10 @@ Designer ProgressIcon.cs - + diff --git a/WebsitePanel/Database/install_db.sql b/WebsitePanel/Database/install_db.sql index b9a05217..d3f98948 100644 --- a/WebsitePanel/Database/install_db.sql +++ b/WebsitePanel/Database/install_db.sql @@ -29,7 +29,7 @@ CREATE TABLE [dbo].[ExchangeAccounts]( [AccountID] [int] IDENTITY(1,1) NOT NULL, [ItemID] [int] NOT NULL, [AccountType] [int] NOT NULL, - [AccountName] [nvarchar](20) COLLATE Latin1_General_CI_AS NOT NULL, + [AccountName] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL, [DisplayName] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL, [PrimaryEmailAddress] [nvarchar](300) COLLATE Latin1_General_CI_AS NULL, [MailEnabledPublicFolder] [bit] NULL, @@ -37,6 +37,8 @@ CREATE TABLE [dbo].[ExchangeAccounts]( [SamAccountName] [nvarchar](100) COLLATE Latin1_General_CI_AS NULL, [AccountPassword] [nvarchar](200) COLLATE Latin1_General_CI_AS NULL, [CreatedDate] [datetime] NOT NULL, + [MailboxPlanId] [int] NULL, + [SubscriberNumber] [nvarchar] (32) COLLATE Latin1_General_CI_AS NULL, CONSTRAINT [PK_ExchangeAccounts] PRIMARY KEY CLUSTERED ( [AccountID] ASC @@ -54,6 +56,32 @@ SET QUOTED_IDENTIFIER ON GO +CREATE TABLE [dbo].[ExchangeMailboxPlans]( + [MailboxPlanId] [int] IDENTITY(1,1) NOT NULL, + [ItemID] [int] NOT NULL, + [MailboxPlan] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL, + [EnableActiveSync] [bit] NOT NULL, + [EnableIMAP] [bit] NOT NULL, + [EnableMAPI] [bit] NOT NULL, + [EnableOWA] [bit] NOT NULL, + [EnablePOP] [bit] NOT NULL, + [IsDefault] [bit] NOT NULL, + [IssueWarningPct] [int] NOT NULL, + [KeepDeletedItemsDays] [int] NOT NULL, + [MailboxSizeMB] [int] NOT NULL, + [MaxReceiveMessageSizeKB] [int] NOT NULL, + [MaxRecipients] [int] NOT NULL, + [MaxSendMessageSizeKB] [int] NOT NULL, + [ProhibitSendPct] [int] NOT NULL, + [ProhibitSendReceivePct] [int] NOT NULL, + [HideFromAddressBook] [bit] NOT NULL, + CONSTRAINT [PK_ExchangeMailboxPlans] PRIMARY KEY CLUSTERED +( + [MailboxPlanId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO @@ -80,7 +108,8 @@ SELECT AccountName, DisplayName, PrimaryEmailAddress, - MailEnabledPublicFolder + MailEnabledPublicFolder, + SubscriberNumber FROM ExchangeAccounts WHERE @@ -109,6 +138,7 @@ END + GO @@ -150,21 +180,137 @@ CREATE PROCEDURE [dbo].[GetExchangeAccounts] ) AS SELECT - AccountID, - ItemID, - AccountType, - AccountName, - DisplayName, - PrimaryEmailAddress, - MailEnabledPublicFolder + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber FROM - ExchangeAccounts + ExchangeAccounts AS E +INNER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId WHERE - ItemID = @ItemID AND - (AccountType = @AccountType OR @AccountType IS NULL) + E.ItemID = @ItemID AND + (E.AccountType = @AccountType OR @AccountType IS NULL) ORDER BY DisplayName RETURN +GO + + + + + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetExchangeAccountByMailboxPlanId] +( + @ItemID int, + @MailboxPlanId int +) +AS + +DECLARE @condition nvarchar(64) + +IF (@MailboxPlanId < 0) +BEGIN +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.MailboxPlanId IS NULL AND + E.AccountType IN (1,5) +RETURN + +END +ELSE +BEGIN +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.MailboxPlanId = @MailboxPlanId AND + E.AccountType IN (1,5) +RETURN +END +GO + + + + + + + + +CREATE PROCEDURE [dbo].[GetExchangeAccountByAccountName] +( + @ItemID int, + @AccountName nvarchar(300) +) +AS +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.AccountName = @AccountName +RETURN @@ -231,21 +377,25 @@ CREATE PROCEDURE [dbo].[GetExchangeAccount] ) AS SELECT - AccountID, - ItemID, - AccountType, - AccountName, - DisplayName, - PrimaryEmailAddress, - MailEnabledPublicFolder, - MailboxManagerActions, - SamAccountName, - AccountPassword + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber FROM - ExchangeAccounts + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId WHERE - ItemID = @ItemID AND - AccountID = @AccountID + E.ItemID = @ItemID AND + E.AccountID = @AccountID RETURN @@ -311,14 +461,14 @@ GO -CREATE PROCEDURE ExchangeAccountExists +CREATE PROCEDURE [dbo].[ExchangeAccountExists] ( @AccountName nvarchar(20), @Exists bit OUTPUT ) AS SET @Exists = 0 -IF EXISTS(SELECT * FROM ExchangeAccounts WHERE AccountName = @AccountName) +IF EXISTS(SELECT * FROM ExchangeAccounts WHERE sAMAccountName LIKE '%\'+@AccountName) BEGIN SET @Exists = 1 END @@ -352,6 +502,10 @@ RETURN + + + + @@ -936,7 +1090,7 @@ GO -CREATE PROCEDURE SearchExchangeAccounts +CREATE PROCEDURE [dbo].[SearchExchangeAccounts] ( @ActorID int, @ItemID int, @@ -986,7 +1140,8 @@ SELECT EA.AccountName, EA.DisplayName, EA.PrimaryEmailAddress, - EA.MailEnabledPublicFolder + EA.MailEnabledPublicFolder, + EA.SubscriberNumber FROM ExchangeAccounts AS EA WHERE ' + @condition @@ -1026,6 +1181,7 @@ RETURN + GO @@ -1080,6 +1236,10 @@ END IF @SortColumn IS NULL OR @SortColumn = '' SET @SortColumn = 'EA.DisplayName ASC' +DECLARE @joincondition nvarchar(700) + SET @joincondition = ',P.MailboxPlan FROM ExchangeAccounts AS EA + LEFT OUTER JOIN ExchangeMailboxPlans AS P ON EA.MailboxPlanId = P.MailboxPlanId' + DECLARE @sql nvarchar(3500) set @sql = ' @@ -1094,9 +1254,10 @@ WITH Accounts AS ( EA.AccountName, EA.DisplayName, EA.PrimaryEmailAddress, - EA.MailEnabledPublicFolder - FROM ExchangeAccounts AS EA - WHERE ' + @condition + ' + EA.MailEnabledPublicFolder, + EA.MailboxPlanId, + EA.SubscriberNumber ' + @joincondition + + ' WHERE ' + @condition + ' ) SELECT * FROM Accounts @@ -1118,6 +1279,7 @@ RETURN + GO SET ANSI_NULLS ON GO @@ -1407,13 +1569,15 @@ CREATE PROCEDURE [dbo].[AddExchangeAccount] @AccountID int OUTPUT, @ItemID int, @AccountType int, - @AccountName nvarchar(20), + @AccountName nvarchar(300), @DisplayName nvarchar(300), @PrimaryEmailAddress nvarchar(300), @MailEnabledPublicFolder bit, @MailboxManagerActions varchar(200), @SamAccountName nvarchar(100), - @AccountPassword nvarchar(200) + @AccountPassword nvarchar(200), + @MailboxPlanId int, + @SubscriberNumber nvarchar(32) ) AS @@ -1427,7 +1591,9 @@ INSERT INTO ExchangeAccounts MailEnabledPublicFolder, MailboxManagerActions, SamAccountName, - AccountPassword + AccountPassword, + MailboxPlanId, + SubscriberNumber ) VALUES ( @@ -1439,7 +1605,9 @@ VALUES @MailEnabledPublicFolder, @MailboxManagerActions, @SamAccountName, - @AccountPassword + @AccountPassword, + @MailboxPlanId, + @SubscriberNumber ) SET @AccountID = SCOPE_IDENTITY() @@ -1475,6 +1643,7 @@ RETURN + GO @@ -3538,9 +3707,9 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (75, 1, 8, N'OS.ExtraApplications', N'Extra Application Packs', 1, 0, NULL) GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (77, 12, 2, N'Exchange2007.DiskSpace', N'Organization Disk Space, MB', 3, 0, NULL) +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (77, 12, 2, N'Exchange2007.DiskSpace', N'Organization Disk Space, MB', 2, 0, NULL) GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (78, 12, 3, N'Exchange2007.Mailboxes', N'Mailboxes per Organization', 3, 0, NULL) +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (78, 12, 3, N'Exchange2007.Mailboxes', N'Mailboxes per Organization', 2, 0, NULL) GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (79, 12, 4, N'Exchange2007.Contacts', N'Contacts per Organization', 3, 0, NULL) GO @@ -3560,16 +3729,6 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (88, 12, 8, N'Exchange2007.MailEnabledPublicFolders', N'Mail Enabled Public Folders Allowed', 1, 0, NULL) GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (89, 12, 10, N'Exchange2007.POP3Enabled', N'POP3 Enabled by default', 1, 0, NULL) -GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (90, 12, 12, N'Exchange2007.IMAPEnabled', N'IMAP Enabled by default', 1, 0, NULL) -GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (91, 12, 14, N'Exchange2007.OWAEnabled', N'OWA Enabled by default', 1, 0, NULL) -GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (92, 12, 16, N'Exchange2007.MAPIEnabled', N'MAPI Enabled by default', 1, 0, NULL) -GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (93, 12, 18, N'Exchange2007.ActiveSyncEnabled', N'ActiveSync Enabled by default', 1, 0, NULL) -GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (94, 2, 17, N'Web.ColdFusion', N'ColdFusion', 1, 0, NULL) GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (95, 2, 1, N'Web.WebAppGallery', N'Web Application Gallery', 1, 0, NULL) @@ -3602,7 +3761,7 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (205, 13, 1, N'HostedSolution.Organizations', N'Organizations', 2, 0, 29) GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (206, 13, 2, N'HostedSolution.Users', N'Users', 3, 0, 30) +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (206, 13, 2, N'HostedSolution.Users', N'Users', 2, 0, 30) GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (207, 13, 3, N'HostedSolution.Domains', N'Domains per Organizations', 3, 0, NULL) GO @@ -3708,14 +3867,6 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (332, 2, 21, N'Web.SSL', N'SSL', 1, 0, NULL) GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (340, 33, 1, N'ExchangeHostedEdition.Domains', N'Domains', 3, 0, NULL) -GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (341, 33, 2, N'ExchangeHostedEdition.Mailboxes', N'Mailboxes', 3, 0, NULL) -GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (342, 33, 3, N'ExchangeHostedEdition.Contacts', N'Contacts', 3, 0, NULL) -GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (343, 33, 4, N'ExchangeHostedEdition.DistributionLists', N'Distribution Lists', 3, 0, NULL) -GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (344, 2, 9, N'Web.Htaccess', N'htaccess', 1, 0, NULL) GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (345, 40, 1, N'VPSForPC.ServersNumber', N'Number of VPS', 2, 0, 35) @@ -3756,6 +3907,36 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (363, 40, 12, N'VPSForPC.Bandwidth', N'Monthly bandwidth, GB', 2, 0, NULL) GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (364, 12, 19, N'Exchange2007.KeepDeletedItemsDays', N'Keep Deleted Items (days)', 3, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (365, 12, 20, N'Exchange2007.MaxRecipients', N'Maximum Recipients', 3, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (366, 12, 21, N'Exchange2007.MaxSendMessageSizeKB', N'Maximum Send Message Size (Kb)', 3, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (367, 12, 22, N'Exchange2007.MaxReceiveMessageSizeKB', N'Maximum Receive Message Size (Kb)', 3, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (368, 12, 1, N'Exchange2007.IsConsumer',N'Is Consumer Organization',1, 0 , NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (370, 41, 1, N'Lync.Users', N'Users',2 ,0 , NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (371, 41, 2, N'Lync.Federation' , N'Allow Federation', 1, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (372, 41, 3, N'Lync.Conferencing', N'Allow Conferencing', 1, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (373, 41, 4, N'Lync.MaxParticipants', N'Maximum Conference Particiapants', 3, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (374, 41, 5, N'Lync.AllowVideo', N'Allow Video in Conference', 1, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (375, 41, 6, N'Lync.EnterpriseVoice', N'Allow EnterpriseVoice', 1, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (376, 41, 7, N'Lync.EVUsers', N'Number of Enterprise Voice Users', 2, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (377, 41, 8, N'Lync.EVNational', N'Allow National Calls', 1, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (378, 41, 9, N'Lync.EVMobile', N'Allow Mobile Calls', 1, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (379, 41, 10, N'Lync.EVInternational', N'Allow International Calls', 1, 0, NULL) +GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (400, 20, 3, N'HostedSharePoint.UseSharedSSL', N'Use shared SSL Root', 1, 0, NULL) GO @@ -5874,7 +6055,7 @@ SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ExchangeOrganizations]( [ItemID] [int] NOT NULL, - [OrganizationID] [nvarchar](10) COLLATE Latin1_General_CI_AS NOT NULL, + [OrganizationID] [nvarchar](128) COLLATE Latin1_General_CI_AS NOT NULL, CONSTRAINT [PK_ExchangeOrganizations] PRIMARY KEY CLUSTERED ( [ItemID] ASC @@ -5988,8 +6169,10 @@ CREATE PROCEDURE DeleteExchangeOrganization @ItemID int ) AS -DELETE FROM ExchangeOrganizations -WHERE ItemID = @ItemID +BEGIN TRAN + DELETE FROM ExchangeMailboxPlans WHERE ItemID = @ItemID + DELETE FROM ExchangeOrganizations WHERE ItemID = @ItemID +COMMIT TRAN RETURN @@ -6061,7 +6244,7 @@ GO CREATE PROCEDURE AddExchangeOrganization ( @ItemID int, - @OrganizationID nvarchar(10) + @OrganizationID nvarchar(128) ) AS @@ -6249,7 +6432,8 @@ SELECT (SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 2 AND ItemID = @ItemID) AS CreatedContacts, (SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 3 AND ItemID = @ItemID) AS CreatedDistributionLists, (SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 4 AND ItemID = @ItemID) AS CreatedPublicFolders, - (SELECT COUNT(*) FROM ExchangeOrganizationDomains WHERE ItemID = @ItemID) AS CreatedDomains + (SELECT COUNT(*) FROM ExchangeOrganizationDomains WHERE ItemID = @ItemID) AS CreatedDomains, + (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS A INNER JOIN ExchangeMailboxPlans AS B ON A.MailboxPlanId = B.MailboxPlanId WHERE A.ItemID=@ItemID) AS UsedDiskSpace RETURN @@ -6280,7 +6464,6 @@ RETURN - GO @@ -6619,18 +6802,26 @@ GO CREATE PROCEDURE [dbo].[UpdateExchangeAccount] ( @AccountID int, - @AccountName nvarchar(20), + @AccountName nvarchar(300), @DisplayName nvarchar(300), @PrimaryEmailAddress nvarchar(300), @AccountType int, @SamAccountName nvarchar(100), @MailEnabledPublicFolder bit, @MailboxManagerActions varchar(200), - @Password varchar(200) + @Password varchar(200), + @MailboxPlanId int, + @SubscriberNumber varchar(32) ) AS BEGIN TRAN + +IF (@MailboxPlanId = -1) +BEGIN + SET @MailboxPlanId = NULL +END + UPDATE ExchangeAccounts SET AccountName = @AccountName, DisplayName = @DisplayName, @@ -6638,7 +6829,9 @@ UPDATE ExchangeAccounts SET MailEnabledPublicFolder = @MailEnabledPublicFolder, MailboxManagerActions = @MailboxManagerActions, AccountType =@AccountType, - SamAccountName = @SamAccountName + SamAccountName = @SamAccountName, + MailboxPlanId = @MailboxPlanId, + SubscriberNumber = @SubscriberNumber WHERE AccountID = @AccountID @@ -6675,6 +6868,10 @@ RETURN + + + + GO @@ -8907,7 +9104,8 @@ SELECT EA.AccountType, EA.AccountName, EA.DisplayName, - EA.PrimaryEmailAddress + EA.PrimaryEmailAddress, + EA.SubscriberNumber FROM ExchangeAccounts AS EA WHERE ' + @condition @@ -8944,6 +9142,8 @@ RETURN + + @@ -10470,6 +10670,7 @@ CREATE TABLE [dbo].[ResourceGroups]( [GroupName] [nvarchar](100) COLLATE Latin1_General_CI_AS NOT NULL, [GroupOrder] [int] NOT NULL, [GroupController] [nvarchar](1000) COLLATE Latin1_General_CI_AS NULL, + [ShowGroup] [bit] NULL, CONSTRAINT [PK_ResourceGroups] PRIMARY KEY CLUSTERED ( [GroupID] ASC @@ -10477,49 +10678,49 @@ CREATE TABLE [dbo].[ResourceGroups]( ) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (1, N'OS', 1, N'WebsitePanel.EnterpriseServer.OperatingSystemController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (1, N'OS', 1, N'WebsitePanel.EnterpriseServer.OperatingSystemController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (2, N'Web', 2, N'WebsitePanel.EnterpriseServer.WebServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (2, N'Web', 2, N'WebsitePanel.EnterpriseServer.WebServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (3, N'FTP', 3, N'WebsitePanel.EnterpriseServer.FtpServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (3, N'FTP', 3, N'WebsitePanel.EnterpriseServer.FtpServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (4, N'Mail', 4, N'WebsitePanel.EnterpriseServer.MailServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (4, N'Mail', 4, N'WebsitePanel.EnterpriseServer.MailServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (5, N'MsSQL2000', 8, N'WebsitePanel.EnterpriseServer.DatabaseServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (5, N'MsSQL2000', 8, N'WebsitePanel.EnterpriseServer.DatabaseServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (6, N'MySQL4', 12, N'WebsitePanel.EnterpriseServer.DatabaseServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (6, N'MySQL4', 12, N'WebsitePanel.EnterpriseServer.DatabaseServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (7, N'DNS', 17, N'WebsitePanel.EnterpriseServer.DnsServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (7, N'DNS', 17, N'WebsitePanel.EnterpriseServer.DnsServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (8, N'Statistics', 18, N'WebsitePanel.EnterpriseServer.StatisticsServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (8, N'Statistics', 18, N'WebsitePanel.EnterpriseServer.StatisticsServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (9, N'SharePoint', 14, N'WebsitePanel.EnterpriseServer.SharePointServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (9, N'SharePoint', 14, N'WebsitePanel.EnterpriseServer.SharePointServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (10, N'MsSQL2005', 9, N'WebsitePanel.EnterpriseServer.DatabaseServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (10, N'MsSQL2005', 9, N'WebsitePanel.EnterpriseServer.DatabaseServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (11, N'MySQL5', 13, N'WebsitePanel.EnterpriseServer.DatabaseServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (11, N'MySQL5', 13, N'WebsitePanel.EnterpriseServer.DatabaseServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (12, N'Exchange', 5, NULL) +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (12, N'Exchange', 5, NULL, 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (13, N'Hosted Organizations', 6, NULL) +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (13, N'Hosted Organizations', 6, NULL, 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (20, N'Hosted SharePoint', 15, N'WebsitePanel.EnterpriseServer.HostedSharePointServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (20, N'Hosted SharePoint', 15, N'WebsitePanel.EnterpriseServer.HostedSharePointServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (21, N'Hosted CRM', 16, NULL) +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (21, N'Hosted CRM', 16, NULL, 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (22, N'MsSQL2008', 10, N'WebsitePanel.EnterpriseServer.DatabaseServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (22, N'MsSQL2008', 10, N'WebsitePanel.EnterpriseServer.DatabaseServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (23, N'MsSQL2012', 11, N'WebsitePanel.EnterpriseServer.DatabaseServerController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (23, N'MsSQL2012', 11, N'WebsitePanel.EnterpriseServer.DatabaseServerController', 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (30, N'VPS', 19, NULL) +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (30, N'VPS', 19, NULL, 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (31, N'BlackBerry', 21, NULL) +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (31, N'BlackBerry', 21, NULL, 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (32, N'OCS', 22, NULL) +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (32, N'OCS', 22, NULL, 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (33, N'ExchangeHostedEdition', 7, N'WebsitePanel.EnterpriseServer.ExchangeHostedEditionController') +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (41, N'Lync',23, NULL, 1) GO -INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (40, N'VPSForPC', 20, NULL) +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (40, N'VPSForPC', 20, NULL, 1) GO SET ANSI_NULLS ON GO @@ -13125,6 +13326,62 @@ GO +CREATE TABLE [dbo].[LyncUserPlans]( + [LyncUserPlanId] [int] IDENTITY(1,1) NOT NULL, + [ItemID] [int] NOT NULL, + [LyncUserPlanName] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL, + [IM] [bit] NOT NULL, + [Mobility] [bit] NOT NULL, + [MobilityEnableOutsideVoice] [bit] NOT NULL, + [Federation] [bit] NOT NULL, + [Conferencing] [bit] NOT NULL, + [EnterpriseVoice] [bit] NOT NULL, + [VoicePolicy] [int] NOT NULL, + [IsDefault] [bit] NOT NULL, + CONSTRAINT [PK_LyncUserPlans] PRIMARY KEY CLUSTERED +( + [LyncUserPlanId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + + + + + + + + + +CREATE TABLE [dbo].[LyncUsers]( + [LyncUserID] [int] IDENTITY(1,1) NOT NULL, + [AccountID] [int] NOT NULL, + [LyncUserPlanID] [int] NOT NULL, + [CreatedDate] [datetime] NOT NULL, + [ModifiedDate] [datetime] NOT NULL, + CONSTRAINT [PK_LyncUsers] PRIMARY KEY CLUSTERED +( + [LyncUserID] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + + + + + + + + + + + + + + + @@ -20042,16 +20299,6 @@ INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [R GO INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (17, 4, 12, N'CNAME', N'owa', N'', 0) GO -INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (18, 1, 33, N'A', N'smtp', N'[IP]', 0) -GO -INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (19, 2, 33, N'MX', N'', N'smtp.[DOMAIN_NAME]', 10) -GO -INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (20, 3, 33, N'CNAME', N'autodiscover', N'', 0) -GO -INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (21, 4, 33, N'CNAME', N'owa', N'', 0) -GO -INSERT [dbo].[ResourceGroupDnsRecords] ([RecordID], [RecordOrder], [GroupID], [RecordType], [RecordName], [RecordData], [MXPriority]) VALUES (22, 5, 33, N'CNAME', N'ecp', N'', 0) -GO SET IDENTITY_INSERT [dbo].[ResourceGroupDnsRecords] OFF GO SET ANSI_NULLS ON @@ -20561,7 +20808,7 @@ GO -CREATE PROCEDURE GetPackages +CREATE PROCEDURE [dbo].[GetPackages] ( @ActorID int, @UserID int @@ -20600,8 +20847,7 @@ INNER JOIN Users AS U ON P.UserID = U.UserID INNER JOIN Servers AS S ON P.ServerID = S.ServerID INNER JOIN HostingPlans AS HP ON P.PlanID = HP.PlanID WHERE - P.UserID <> @UserID - AND dbo.CheckUserParent(@UserID, P.UserID) = 1 + P.UserID = @UserID RETURN @@ -22300,8 +22546,6 @@ INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeNa GO INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (38, 23, N'MsSQL2012User', N'WebsitePanel.Providers.Database.SqlUser, WebsitePanel.Providers.Base', 1, 0, 0, 0, 1, 1, 1, 1) GO -INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (40, 33, N'ExchangeOrganization', N'WebsitePanel.Providers.ExchangeHostedEdition.ExchangeOrganization, WebsitePanel.Providers.Base', 1, 0, 0, 1, 1, 1, 0, 0) -GO INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (200, 20, N'SharePointSiteCollection', N'WebsitePanel.Providers.SharePoint.SharePointSiteCollection, WebsitePanel.Providers.Base', 25, 1, 0, 0, 1, 1, 1, 1) GO SET ANSI_NULLS ON @@ -23259,18 +23503,20 @@ INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName] GO INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (206, 32, N'OCSEdge', N'OCS Edge server', N'WebsitePanel.Providers.HostedSolution.OCSEdge2007R2, WebsitePanel.Providers.HostedSolution', N'OCS_Edge', 1) GO -INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (207, 33, N'Exchange2010SP1', N'Exchange Server 2010 SP1 Hosting Mode', N'WebsitePanel.Providers.ExchangeHostedEdition.Exchange2010SP1, WebsitePanel.Providers.ExchangeHostedEdition', N'Exchange2010SP1', 1) -GO INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (208, 20, N'HostedSharePoint2010', N'Hosted SharePoint Foundation 2010', N'WebsitePanel.Providers.HostedSolution.HostedSharePointServer2010, WebsitePanel.Providers.HostedSolution', N'HostedSharePoint30', NULL) GO INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (209, 23, N'MsSQL', N'Microsoft SQL Server 2012', N'WebsitePanel.Providers.Database.MsSqlServer2012, WebsitePanel.Providers.Database.SqlServer', N'MSSQL', NULL) GO +INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (250, 41, N'Lync2010', N'Microsoft Lync Server 2010 Multitenant Hosting Pack', 'WebsitePanel.Providers.HostedSolution.Lync2010, WebsitePanel.Providers.HostedSolution', 'Lync', 1) +GO INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (300, 30, N'HyperV', N'Microsoft Hyper-V', N'WebsitePanel.Providers.Virtualization.HyperV, WebsitePanel.Providers.Virtualization.HyperV', N'HyperV', 1) GO INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (301, 11, N'MySQL', N'MySQL Server 5.5', N'WebsitePanel.Providers.Database.MySqlServer55, WebsitePanel.Providers.Database.MySQL', N'MySQL', NULL) GO INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (400, 40, N'HyperVForPC', N'Microsoft Hyper-V For Private Cloud', N'WebsitePanel.Providers.VirtualizationForPC.HyperVForPC, WebsitePanel.Providers.VirtualizationForPC.HyperVForPC', N'HyperVForPrivateCloud', 1) GO +INSERT [dbo].[Providers] ([ProviderId], [GroupId], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES(90, 12, N'Exchange2010SP2', N'Hosted Microsoft Exchange Server 2010 SP2', N'WebsitePanel.Providers.HostedSolution.Exchange2010SP2, WebsitePanel.Providers.HostedSolution', N'Exchange', 1) +GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON @@ -24474,10 +24720,6 @@ INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [Property GO INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (204, N'UtilityPath', N'C:\Program Files\Research In Motion\BlackBerry Enterprise Server Resource Kit\BlackBerry Enterprise Server User Administration Tool') GO -INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (207, N'ecpURL', N'http://ecp.[DOMAIN_NAME]') -GO -INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (207, N'location', N'en-us') -GO INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'CpuLimit', N'100') GO INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (300, N'CpuReserve', N'0') @@ -25752,21 +25994,40 @@ AS INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) ELSE IF @QuotaID = 319 -- BB Users - SET @Result = (SELECT COUNT(ea.AccountID) - FROM - ExchangeAccounts ea - INNER JOIN - BlackBerryUsers bu - ON - ea.AccountID = bu.AccountID - INNER JOIN - ServiceItems si - ON - ea.ItemID = si.ItemID - INNER JOIN - PackagesTreeCache pt ON si.PackageID = pt.PackageID - WHERE - pt.ParentPackageID = @PackageID) + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts ea + INNER JOIN BlackBerryUsers bu ON ea.AccountID = bu.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 206 -- HostedSolution.Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (1,5,6,7)) + ELSE IF @QuotaID = 78 -- Exchange2007.Mailboxes + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND ea.MailboxPlanId IS NOT NULL) + ELSE IF @QuotaID = 77 -- Exchange2007.DiskSpace + SET @Result = (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS ea + INNER JOIN ExchangeMailboxPlans AS B ON ea.MailboxPlanId = B.MailboxPlanId + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 370 -- Lync.Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 376 -- Lync.EVUsers + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID + INNER JOIN LyncUserPlans lp ON lu.LyncUserPlanId = lp.LyncUserPlanId + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND lp.EnterpriseVoice = 1) ELSE SET @Result = (SELECT COUNT(SI.ItemID) FROM Quotas AS Q INNER JOIN ServiceItems AS SI ON SI.ItemTypeID = Q.ItemTypeID @@ -25775,14 +26036,10 @@ AS RETURN @Result END +GO -GO -SET ANSI_NULLS ON -GO -SET QUOTED_IDENTIFIER ON -GO @@ -26026,7 +26283,7 @@ GO -CREATE PROCEDURE GetHostingPlanQuotas +CREATE PROCEDURE [dbo].[GetHostingPlanQuotas] ( @ActorID int, @PlanID int, @@ -26056,8 +26313,9 @@ SELECT dbo.GetPackageAllocatedResource(@PackageID, RG.GroupID, @ServerID) AS ParentEnabled, ISNULL(HPR.CalculateDiskSpace, 1) AS CalculateDiskSpace, ISNULL(HPR.CalculateBandwidth, 1) AS CalculateBandwidth -FROM ResourceGroups AS RG +FROM ResourceGroups AS RG LEFT OUTER JOIN HostingPlanResources AS HPR ON RG.GroupID = HPR.GroupID AND HPR.PlanID = @PlanID +WHERE (ShowGroup = 1) ORDER BY RG.GroupOrder -- get quotas by groups @@ -26106,7 +26364,6 @@ RETURN - GO @@ -40293,7 +40550,7 @@ GO -CREATE PROCEDURE GetRawServicesByServerID +CREATE PROCEDURE [dbo].[GetRawServicesByServerID] ( @ActorID int, @ServerID int @@ -40309,7 +40566,7 @@ SELECT GroupID, GroupName FROM ResourceGroups -WHERE @IsAdmin = 1 +WHERE @IsAdmin = 1 AND (ShowGroup = 1) ORDER BY GroupOrder -- services @@ -40328,7 +40585,7 @@ WHERE AND @IsAdmin = 1 ORDER BY RG.GroupOrder -RETURN +RETURN @@ -43796,7 +44053,7 @@ GO -CREATE PROCEDURE GetVirtualServices +CREATE PROCEDURE [dbo].[GetVirtualServices] ( @ActorID int, @ServerID int @@ -43817,7 +44074,7 @@ SELECT FROM ResourceGroups AS RG LEFT OUTER JOIN VirtualGroups AS VRG ON RG.GroupID = VRG.GroupID AND VRG.ServerID = @ServerID WHERE - @IsAdmin = 1 + @IsAdmin = 1 AND (ShowGroup = 1) ORDER BY RG.GroupOrder -- services @@ -43836,7 +44093,7 @@ WHERE VS.ServerID = @ServerID AND @IsAdmin = 1 -RETURN +RETURN @@ -44465,6 +44722,7 @@ EXEC sp_xml_removedocument @idoc COMMIT TRAN RETURN +GO @@ -44487,33 +44745,748 @@ RETURN +CREATE PROCEDURE [dbo].[AddExchangeMailboxPlan] +( + @MailboxPlanId int OUTPUT, + @ItemID int, + @MailboxPlan nvarchar(300), + @EnableActiveSync bit, + @EnableIMAP bit, + @EnableMAPI bit, + @EnableOWA bit, + @EnablePOP bit, + @IsDefault bit, + @IssueWarningPct int, + @KeepDeletedItemsDays int, + @MailboxSizeMB int, + @MaxReceiveMessageSizeKB int, + @MaxRecipients int, + @MaxSendMessageSizeKB int, + @ProhibitSendPct int, + @ProhibitSendReceivePct int , + @HideFromAddressBook bit +) +AS +INSERT INTO ExchangeMailboxPlans +( + ItemID, + MailboxPlan, + EnableActiveSync, + EnableIMAP, + EnableMAPI, + EnableOWA, + EnablePOP, + IsDefault, + IssueWarningPct, + KeepDeletedItemsDays, + MailboxSizeMB, + MaxReceiveMessageSizeKB, + MaxRecipients, + MaxSendMessageSizeKB, + ProhibitSendPct, + ProhibitSendReceivePct, + HideFromAddressBook +) +VALUES +( + @ItemID, + @MailboxPlan, + @EnableActiveSync, + @EnableIMAP, + @EnableMAPI, + @EnableOWA, + @EnablePOP, + @IsDefault, + @IssueWarningPct, + @KeepDeletedItemsDays, + @MailboxSizeMB, + @MaxReceiveMessageSizeKB, + @MaxRecipients, + @MaxSendMessageSizeKB, + @ProhibitSendPct, + @ProhibitSendReceivePct, + @HideFromAddressBook +) +SET @MailboxPlanId = SCOPE_IDENTITY() - - - - - - - - - - +RETURN GO + + + + + + + + + + + + + + +CREATE PROCEDURE [dbo].[SetExchangeAccountMailboxplan] +( + @AccountID int, + @MailboxPlanId int +) +AS + +UPDATE ExchangeAccounts SET + MailboxPlanId = @MailboxPlanId +WHERE + AccountID = @AccountID + +RETURN +GO + + + + + + + + + + + +CREATE PROCEDURE [dbo].[SetOrganizationDefaultExchangeMailboxPlan] +( + @ItemId int, + @MailboxPlanId int +) +AS + +UPDATE ExchangeMailboxPlans SET IsDefault=0 WHERE ItemId=@ItemId +UPDATE ExchangeMailboxPlans SET IsDefault=1 WHERE MailboxPlanId=@MailboxPlanId + +RETURN +GO + + + + + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetExchangeMailboxPlan] +( + @MailboxPlanId int +) +AS +SELECT + MailboxPlanId, + ItemID, + MailboxPlan, + EnableActiveSync, + EnableIMAP, + EnableMAPI, + EnableOWA, + EnablePOP, + IsDefault, + IssueWarningPct, + KeepDeletedItemsDays, + MailboxSizeMB, + MaxReceiveMessageSizeKB, + MaxRecipients, + MaxSendMessageSizeKB, + ProhibitSendPct, + ProhibitSendReceivePct, + HideFromAddressBook +FROM + ExchangeMailboxPlans +WHERE + MailboxPlanId = @MailboxPlanId +RETURN +GO + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetExchangeMailboxPlans] +( + @ItemID int +) +AS +SELECT + MailboxPlanId, + ItemID, + MailboxPlan, + EnableActiveSync, + EnableIMAP, + EnableMAPI, + EnableOWA, + EnablePOP, + IsDefault, + IssueWarningPct, + KeepDeletedItemsDays, + MailboxSizeMB, + MaxReceiveMessageSizeKB, + MaxRecipients, + MaxSendMessageSizeKB, + ProhibitSendPct, + ProhibitSendReceivePct, + HideFromAddressBook +FROM + ExchangeMailboxPlans +WHERE + ItemID = @ItemID +ORDER BY MailboxPlan +RETURN +GO + + + + + + + + + + + + + +CREATE PROCEDURE [dbo].[DeleteExchangeMailboxPlan] +( + @MailboxPlanId int +) +AS + +-- delete mailboxplan +DELETE FROM ExchangeMailboxPlans +WHERE MailboxPlanId = @MailboxPlanId + +RETURN +GO + + + + + + + + + + + +CREATE PROCEDURE [dbo].[AddLyncUser] + @AccountID int, + @LyncUserPlanID int +AS +BEGIN + SET NOCOUNT ON; + +INSERT INTO + dbo.LyncUsers + ( + + AccountID, + LyncUserPlanID, + CreatedDate, + ModifiedDate) +VALUES +( + @AccountID, + @LyncUserPlanID, + getdate(), + getdate() +) +END +GO + + + + + + + + +CREATE PROCEDURE [dbo].[AddLyncUserPlan] +( + @LyncUserPlanId int OUTPUT, + @ItemID int, + @LyncUserPlanName nvarchar(300), + @IM bit, + @Mobility bit, + @MobilityEnableOutsideVoice bit, + @Federation bit, + @Conferencing bit, + @EnterpriseVoice bit, + @VoicePolicy int, + @IsDefault bit +) +AS + +INSERT INTO LyncUserPlans +( + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +) +VALUES +( + @ItemID, + @LyncUserPlanName, + @IM, + @Mobility, + @MobilityEnableOutsideVoice, + @Federation, + @Conferencing, + @EnterpriseVoice, + @VoicePolicy, + @IsDefault +) + +SET @LyncUserPlanId = SCOPE_IDENTITY() + +RETURN +GO + + + + + + + + + + +CREATE PROCEDURE [dbo].[CheckLyncUserExists] + @AccountID int +AS +BEGIN + SELECT + COUNT(AccountID) + FROM + dbo.LyncUsers + WHERE AccountID = @AccountID +END +GO + + + + + + + + + + +CREATE PROCEDURE [dbo].[DeleteLyncUser] +( + @AccountId int +) +AS + +DELETE FROM + LyncUsers +WHERE + AccountId = @AccountId + +RETURN +GO + + + + + + + + + + +CREATE PROCEDURE [dbo].[DeleteLyncUserPlan] +( + @LyncUserPlanId int +) +AS + +-- delete lyncuserplan +DELETE FROM LyncUserPlans +WHERE LyncUserPlanId = @LyncUserPlanId + +RETURN +GO + + + + + + + + + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetLyncUserPlan] +( + @LyncUserPlanId int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +FROM + LyncUserPlans +WHERE + LyncUserPlanId = @LyncUserPlanId +RETURN +GO + + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetLyncUserPlanByAccountId] +( + @AccountID int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +FROM + LyncUserPlans +WHERE + LyncUserPlanId IN (SELECT LyncUserPlanId FROM LyncUsers WHERE AccountID = @AccountID) +RETURN +GO + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetLyncUserPlans] +( + @ItemID int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +FROM + LyncUserPlans +WHERE + ItemID = @ItemID +ORDER BY LyncUserPlanName +RETURN +GO + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetLyncUsers] +( + @ItemID int, + @SortColumn nvarchar(40), + @SortDirection nvarchar(20), + @StartRow int, + @Count int +) +AS + +CREATE TABLE #TempLyncUsers +( + [ID] [int] IDENTITY(1,1) NOT NULL, + [AccountID] [int], + [ItemID] [int] NOT NULL, + [AccountName] [nvarchar](300) NOT NULL, + [DisplayName] [nvarchar](300) NOT NULL, + [PrimaryEmailAddress] [nvarchar](300) NULL, + [SamAccountName] [nvarchar](100) NULL, + [LyncUserPlanId] [int] NOT NULL, + [LyncUserPlanName] [nvarchar] (300) NOT NULL, +) + + +DECLARE @condition nvarchar(700) +SET @condition = '' + +IF (@SortColumn = 'DisplayName') +BEGIN + SET @condition = 'ORDER BY ea.DisplayName' +END + +IF (@SortColumn = 'PrimaryEmailAddress') +BEGIN + SET @condition = 'ORDER BY ea.PrimaryEmailAddress' +END + +IF (@SortColumn = 'LyncUserPlanName') +BEGIN + SET @condition = 'ORDER BY lp.LyncUserPlanName' +END + +DECLARE @sql nvarchar(3500) + +set @sql = ' + INSERT INTO + #TempLyncUsers + SELECT + ea.AccountID, + ea.ItemID, + ea.AccountName, + ea.DisplayName, + ea.PrimaryEmailAddress, + ea.SamAccountName, + ou.LyncUserPlanId, + lp.LyncUserPlanName + FROM + ExchangeAccounts ea + INNER JOIN + LyncUsers ou + INNER JOIN + LyncUserPlans lp + ON + ou.LyncUserPlanId = lp.LyncUserPlanId + ON + ea.AccountID = ou.AccountID + WHERE + ea.ItemID = @ItemID ' + @condition + +exec sp_executesql @sql, N'@ItemID int',@ItemID + +DECLARE @RetCount int +SELECT @RetCount = COUNT(ID) FROM #TempLyncUsers + +IF (@SortDirection = 'ASC') +BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID > @StartRow AND ID <= (@StartRow + @Count) +END +ELSE +BEGIN + IF @SortColumn <> '' AND @SortColumn IS NOT NULL + BEGIN + IF (@SortColumn = 'DisplayName') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY DisplayName DESC + END + IF (@SortColumn = 'PrimaryEmailAddress') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress DESC + END + IF (@SortColumn = 'LyncUserPlanName') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY LyncUserPlanName DESC + END + END + ELSE + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress DESC + END + + +END + + +DROP TABLE #TempLyncUsers +GO + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetLyncUsersCount] +( + @ItemID int +) +AS + +SELECT + COUNT(ea.AccountID) +FROM + ExchangeAccounts ea +INNER JOIN + LyncUsers ou +ON + ea.AccountID = ou.AccountID +WHERE + ea.ItemID = @ItemID +GO + + + + + + + + + +CREATE PROCEDURE [dbo].[SetLyncUserLyncUserPlan] +( + @AccountID int, + @LyncUserPlanId int +) +AS + +UPDATE LyncUsers SET + LyncUserPlanId = @LyncUserPlanId +WHERE + AccountID = @AccountID + +RETURN +GO + + + + + + + + + + + +CREATE PROCEDURE [dbo].[SetOrganizationDefaultLyncUserPlan] +( + @ItemId int, + @LyncUserPlanId int +) +AS + +UPDATE LyncUserPlans SET IsDefault=0 WHERE ItemId=@ItemId +UPDATE LyncUserPlans SET IsDefault=1 WHERE LyncUserPlanId=@LyncUserPlanId + +RETURN +GO + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ALTER TABLE [dbo].[ScheduleParameters] WITH CHECK ADD CONSTRAINT [FK_ScheduleParameters_Schedule] FOREIGN KEY([ScheduleID]) REFERENCES [dbo].[Schedule] ([ScheduleID]) ON DELETE CASCADE GO ALTER TABLE [dbo].[ScheduleParameters] CHECK CONSTRAINT [FK_ScheduleParameters_Schedule] GO -ALTER TABLE [dbo].[ExchangeAccounts] WITH CHECK ADD CONSTRAINT [FK_ExchangeAccounts_ServiceItems] FOREIGN KEY([ItemID]) -REFERENCES [dbo].[ServiceItems] ([ItemID]) -ON DELETE CASCADE -GO -ALTER TABLE [dbo].[ExchangeAccounts] CHECK CONSTRAINT [FK_ExchangeAccounts_ServiceItems] -GO + ALTER TABLE [dbo].[ExchangeAccounts] ADD CONSTRAINT [DF__ExchangeA__Creat__59B045BD] DEFAULT (getdate()) FOR [CreatedDate] GO ALTER TABLE [dbo].[HostingPlans] WITH CHECK ADD CONSTRAINT [FK_HostingPlans_Packages] FOREIGN KEY([PackageID]) @@ -44721,12 +45694,21 @@ ALTER TABLE [dbo].[BlackBerryUsers] CHECK CONSTRAINT [FK_BlackBerryUsers_Exchang GO ALTER TABLE [dbo].[BlackBerryUsers] ADD CONSTRAINT [DF_BlackBerryUsers_CreatedDate] DEFAULT (getdate()) FOR [CreatedDate] GO + +ALTER TABLE [dbo].[ExchangeAccounts] WITH CHECK ADD CONSTRAINT [FK_ExchangeAccounts_ServiceItems] FOREIGN KEY([ItemID]) +REFERENCES [dbo].[ServiceItems] ([ItemID]) +ON DELETE CASCADE +GO +ALTER TABLE [dbo].[ExchangeAccounts] CHECK CONSTRAINT [FK_ExchangeAccounts_ServiceItems] +GO + ALTER TABLE [dbo].[ExchangeOrganizations] WITH CHECK ADD CONSTRAINT [FK_ExchangeOrganizations_ServiceItems] FOREIGN KEY([ItemID]) REFERENCES [dbo].[ServiceItems] ([ItemID]) ON DELETE CASCADE GO ALTER TABLE [dbo].[ExchangeOrganizations] CHECK CONSTRAINT [FK_ExchangeOrganizations_ServiceItems] GO + ALTER TABLE [dbo].[ExchangeOrganizationDomains] WITH CHECK ADD CONSTRAINT [FK_ExchangeOrganizationDomains_ServiceItems] FOREIGN KEY([ItemID]) REFERENCES [dbo].[ServiceItems] ([ItemID]) ON DELETE CASCADE @@ -44922,12 +45904,14 @@ ALTER TABLE [dbo].[Servers] ADD CONSTRAINT [DF_Servers_VirtualServer] DEFAULT GO ALTER TABLE [dbo].[Servers] ADD CONSTRAINT [DF_Servers_ADEnabled] DEFAULT ((0)) FOR [ADEnabled] GO + ALTER TABLE [dbo].[ResourceGroupDnsRecords] WITH CHECK ADD CONSTRAINT [FK_ResourceGroupDnsRecords_ResourceGroups] FOREIGN KEY([GroupID]) REFERENCES [dbo].[ResourceGroups] ([GroupID]) ON DELETE CASCADE GO ALTER TABLE [dbo].[ResourceGroupDnsRecords] CHECK CONSTRAINT [FK_ResourceGroupDnsRecords_ResourceGroups] GO + ALTER TABLE [dbo].[ResourceGroupDnsRecords] ADD CONSTRAINT [DF_ResourceGroupDnsRecords_RecordOrder] DEFAULT ((1)) FOR [RecordOrder] GO ALTER TABLE [dbo].[ecProduct] WITH CHECK ADD CONSTRAINT [FK_ecProduct_ecProductType] FOREIGN KEY([TypeID]) @@ -45131,4 +46115,53 @@ ON DELETE CASCADE GO ALTER TABLE [dbo].[ServiceProperties] CHECK CONSTRAINT [FK_ServiceProperties_Services] GO - \ No newline at end of file + +ALTER TABLE dbo.ExchangeMailboxPlans ADD CONSTRAINT + IX_ExchangeMailboxPlans UNIQUE NONCLUSTERED + ( + MailboxPlanId + ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + +GO + +ALTER TABLE [dbo].[ExchangeAccounts] WITH CHECK ADD CONSTRAINT [FK_ExchangeAccounts_ExchangeMailboxPlans] FOREIGN KEY([MailboxPlanId]) +REFERENCES [dbo].[ExchangeMailboxPlans] ([MailboxPlanId]) +GO +ALTER TABLE [dbo].[ExchangeAccounts] CHECK CONSTRAINT [FK_ExchangeAccounts_ExchangeMailboxPlans] +GO + +ALTER TABLE [dbo].[ExchangeMailboxPlans] WITH CHECK ADD CONSTRAINT [FK_ExchangeMailboxPlans_ExchangeOrganizations] FOREIGN KEY([ItemID]) +REFERENCES [dbo].[ExchangeOrganizations] ([ItemID]) +ON DELETE CASCADE +GO + +ALTER TABLE [dbo].[LyncUsers] ADD CONSTRAINT [DF_LyncUsers_CreatedDate] DEFAULT (getdate()) FOR [CreatedDate] +GO + +ALTER TABLE [dbo].[LyncUsers] ADD CONSTRAINT [DF_LyncUsers_ChangedDate] DEFAULT (getdate()) FOR [ModifiedDate] +GO + +ALTER TABLE [dbo].[LyncUsers] WITH CHECK ADD CONSTRAINT [FK_LyncUsers_LyncUserPlans] FOREIGN KEY([LyncUserPlanId]) +REFERENCES [dbo].[LyncUserPlans] ([LyncUserPlanId]) +GO + +ALTER TABLE [dbo].[LyncUsers] CHECK CONSTRAINT [FK_LyncUsers_LyncUserPlans] +GO + +ALTER TABLE dbo.LyncUserPlans ADD CONSTRAINT + IX_LyncUserPlans UNIQUE NONCLUSTERED + ( + LyncUserPlanId + ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + +GO +ALTER TABLE dbo.LyncUserPlans ADD CONSTRAINT + FK_LyncUserPlans_ExchangeOrganizations FOREIGN KEY + ( + ItemID + ) REFERENCES dbo.ExchangeOrganizations + ( + ItemID + ) ON UPDATE NO ACTION + ON DELETE CASCADE + diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 56c023d4..f615c958 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -9,10 +9,15 @@ SET @build_date = '${release.date}T00:00:00' -- ISO 8601 Format (YYYY-MM-DDTHH:M IF NOT EXISTS (SELECT * FROM [dbo].[Versions] WHERE [DatabaseVersion] = @build_version) BEGIN INSERT [dbo].[Versions] ([DatabaseVersion], [BuildDate]) VALUES (@build_version, @build_date) - INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'EnableParkingPageTokens', N'False') END GO + +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE ([UserID] = 1) AND ([SettingsName] = 'WebPolicy') AND ([PropertyName] = 'EnableParkingPageTokens')) +BEGIN + INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'EnableParkingPageTokens', N'False') +END + IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE [GroupName] = 'MsSQL2012') BEGIN INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (23, N'MsSQL2012', 10, N'WebsitePanel.EnterpriseServer.DatabaseServerController') @@ -31,39 +36,45 @@ UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 5 WHERE [GroupName] = N'Exchang GO UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 6 WHERE [GroupName] = N'Hosted Organizations' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 7 WHERE [GroupName] = N'ExchangeHostedEdition' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 7 WHERE [GroupName] = N'MsSQL2000' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 8 WHERE [GroupName] = N'MsSQL2000' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 8 WHERE [GroupName] = N'MsSQL2005' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 9 WHERE [GroupName] = N'MsSQL2005' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 9 WHERE [GroupName] = N'MsSQL2008' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 10 WHERE [GroupName] = N'MsSQL2008' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 10 WHERE [GroupName] = N'MsSQL2012' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 11 WHERE [GroupName] = N'MsSQL2012' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 11 WHERE [GroupName] = N'MySQL4' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 12 WHERE [GroupName] = N'MySQL4' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 12 WHERE [GroupName] = N'MySQL5' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 13 WHERE [GroupName] = N'MySQL5' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 13 WHERE [GroupName] = N'SharePoint' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 14 WHERE [GroupName] = N'SharePoint' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 14 WHERE [GroupName] = N'Hosted SharePoint' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 15 WHERE [GroupName] = N'Hosted SharePoint' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 15 WHERE [GroupName] = N'Hosted CRM' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 16 WHERE [GroupName] = N'Hosted CRM' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 16 WHERE [GroupName] = N'DNS' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 17 WHERE [GroupName] = N'DNS' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 17 WHERE [GroupName] = N'Statistics' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 18 WHERE [GroupName] = N'Statistics' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 18 WHERE [GroupName] = N'VPS' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 19 WHERE [GroupName] = N'VPS' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 19 WHERE [GroupName] = N'VPSForPC' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 20 WHERE [GroupName] = N'VPSForPC' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 20 WHERE [GroupName] = N'BlackBerry' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 21 WHERE [GroupName] = N'BlackBerry' +UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 21 WHERE [GroupName] = N'OCS' GO -UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 22 WHERE [GroupName] = N'OCS' + +IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE [GroupName] = 'Lync') +BEGIN +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (41, N'Lync',22, NULL) +END GO + + IF NOT EXISTS (SELECT * FROM [dbo].[ServiceItemTypes] WHERE [DisplayName] = 'MsSQL2012Database') BEGIN INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (37, 23, N'MsSQL2012Database', N'WebsitePanel.Providers.Database.SqlDatabase, WebsitePanel.Providers.Base', 1, 1, 0, 0, 1, 1, 1, 1) @@ -132,6 +143,132 @@ END GO +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.KeepDeletedItemsDays') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (364, 12, 19, N'Exchange2007.KeepDeletedItemsDays', N'Keep Deleted Items (days)', 3, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.MaxRecipients') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (365, 12, 20, N'Exchange2007.MaxRecipients', N'Maximum Recipients', 3, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.MaxSendMessageSizeKB') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (366, 12, 21, N'Exchange2007.MaxSendMessageSizeKB', N'Maximum Send Message Size (Kb)', 3, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.MaxReceiveMessageSizeKB') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (367, 12, 22, N'Exchange2007.MaxReceiveMessageSizeKB', N'Maximum Receive Message Size (Kb)', 3, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.IsConsumer') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (368, 12, 1, N'Exchange2007.IsConsumer',N'Is Consumer Organization', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.Users') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (370, 41, 1, N'Lync.Users', N'Users',2 ,0 , NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.Federation') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (371, 41, 2, N'Lync.Federation' , N'Allow Federation', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.Conferencing') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (372, 41, 3, N'Lync.Conferencing', N'Allow Conferencing', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.MaxParticipants') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (373, 41, 4, N'Lync.MaxParticipants', N'Maximum Conference Particiapants', 3, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.AllowVideo') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (374, 41, 5, N'Lync.AllowVideo', N'Allow Video in Conference', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.EnterpriseVoice') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (375, 41, 6, N'Lync.EnterpriseVoice', N'Allow EnterpriseVoice', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.EVUsers') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (376, 41, 7, N'Lync.EVUsers', N'Number of Enterprise Voice Users', 2, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.EVNational') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (377, 41, 8, N'Lync.EVNational', N'Allow National Calls', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.EVMobile') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (378, 41, 9, N'Lync.EVMobile', N'Allow Mobile Calls', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.EVInternational') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (379, 41, 10, N'Lync.EVInternational', N'Allow International Calls', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSharePoint.UseSharedSSL') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (400, 20, 3, N'HostedSharePoint.UseSharedSSL', N'Use shared SSL Root', 1, 0, NULL) +END +GO + + + +IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Hosted Microsoft Exchange Server 2010 SP2') +BEGIN +INSERT [dbo].[Providers] ([ProviderId], [GroupId], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES(90, 12, N'Exchange2010SP2', N'Hosted Microsoft Exchange Server 2010 SP2', N'WebsitePanel.Providers.HostedSolution.Exchange2010SP2, WebsitePanel.Providers.HostedSolution', N'Exchange', 1) +END +GO + + +IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Microsoft Lync Server 2010 Multitenant Hosting Pack') +BEGIN +INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (250, 41, N'Lync2010', N'Microsoft Lync Server 2010 Multitenant Hosting Pack', 'WebsitePanel.Providers.HostedSolution.Lync2010, WebsitePanel.Providers.HostedSolution', 'Lync', 1) +END +GO + + + + +DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.POP3Enabled') +DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.POP3Enabled' +DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.IMAPEnabled') +DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.IMAPEnabled' +DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.OWAEnabled') +DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.OWAEnabled' +DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.MAPIEnabled') +DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.MAPIEnabled' +DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.ActiveSyncEnabled') +DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.ActiveSyncEnabled' + + UPDATE [dbo].[ScheduleTaskParameters] SET DefaultValue = N'MsSQL2000=SQL Server 2000;MsSQL2005=SQL Server 2005;MsSQL2008=SQL Server 2008;MsSQL2012=SQL Server 2012;MySQL4=MySQL 4.0;MySQL5=MySQL 5.0' WHERE [ParameterID] = N'DATABASE_GROUP' GO @@ -865,6 +1002,14 @@ ALTER TABLE [dbo].[GlobalDnsRecords] ADD END GO +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ResourceGroups' AND COLS.name='ShowGroup') +BEGIN +ALTER TABLE [dbo].[ResourceGroups] ADD [ShowGroup] [bit] NULL +END +GO + +UPDATE [dbo].[ResourceGroups] SET ShowGroup=1 +GO ALTER PROCEDURE [dbo].[AddDnsRecord] @@ -1492,4 +1637,2078 @@ GO UPDATE dbo.Quotas SET QuotaTypeID = 2 WHERE QuotaName = 'HostedSharePoint.Sites' -GO \ No newline at end of file +GO +UPDATE dbo.Quotas SET QuotaTypeID = 2 WHERE QuotaName = 'HostedSolution.Users' +GO +UPDATE dbo.Quotas SET QuotaTypeID = 2 WHERE QuotaName = 'Exchange2007.Mailboxes' +GO +UPDATE dbo.Quotas SET QuotaTypeID = 2 WHERE QuotaName = 'Exchange2007.DiskSpace' +GO + + + + + + +-- Remove ExchangeHostedEdition Quotas +DELETE FROM Quotas WHERE QuotaID = 340 +GO +DELETE FROM Quotas WHERE QuotaID = 341 +GO +DELETE FROM Quotas WHERE QuotaID = 342 +GO +DELETE FROM Quotas WHERE QuotaID = 343 +GO + + +-- Remove ExchangeHostedEdition ServiceItemType +DELETE FROM ServiceItemTypes WHERE ItemTypeID = 40 +GO + + +-- Remove ExchangeHostedEdition ServiceDefaultProperties +DELETE FROM ServiceDefaultProperties WHERE ProviderID = 207 +GO + + + +-- Remove ExchangeHostedEdition Provider +DELETE FROM Providers WHERE ProviderID = 207 +GO + + + +-- Remove ExchangeHostedEdition VirtualGroups +DELETE FROM VirtualGroups WHERE GroupID = 33 +GO + + + +-- Remove ExchangeHostedEdition ResourceGroups +DELETE FROM ResourceGroups WHERE GRoupID = 33 +GO + + +-- Create Exchange Mailbox Plans +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ExchangeMailboxPlans]') AND type in (N'U')) +BEGIN +CREATE TABLE [dbo].[ExchangeMailboxPlans]( + [MailboxPlanId] [int] IDENTITY(1,1) NOT NULL, + [ItemID] [int] NOT NULL, + [MailboxPlan] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL, + [EnableActiveSync] [bit] NOT NULL, + [EnableIMAP] [bit] NOT NULL, + [EnableMAPI] [bit] NOT NULL, + [EnableOWA] [bit] NOT NULL, + [EnablePOP] [bit] NOT NULL, + [IsDefault] [bit] NOT NULL, + [IssueWarningPct] [int] NOT NULL, + [KeepDeletedItemsDays] [int] NOT NULL, + [MailboxSizeMB] [int] NOT NULL, + [MaxReceiveMessageSizeKB] [int] NOT NULL, + [MaxRecipients] [int] NOT NULL, + [MaxSendMessageSizeKB] [int] NOT NULL, + [ProhibitSendPct] [int] NOT NULL, + [ProhibitSendReceivePct] [int] NOT NULL, + [HideFromAddressBook] [bit] NOT NULL, + CONSTRAINT [PK_ExchangeMailboxPlans] PRIMARY KEY CLUSTERED +( + [MailboxPlanId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +/****** Object: Table [dbo].[ExchangeAccounts] ******/ +ALTER TABLE [dbo].[ExchangeAccounts] ALTER COLUMN [AccountName] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL + +/****** Object: Table [dbo].[ExchangeAccounts] ******/ +ALTER TABLE [dbo].[ExchangeAccounts] ADD [MailboxPlanId] int NULL + +/****** Object: Table [dbo].[ExchangeAccounts] ******/ +ALTER TABLE [dbo].[ExchangeAccounts] WITH CHECK ADD CONSTRAINT [FK_ExchangeAccounts_ExchangeMailboxPlans] FOREIGN KEY([MailboxPlanId]) +REFERENCES [dbo].[ExchangeMailboxPlans] ([MailboxPlanId]) + +ALTER TABLE [dbo].[ExchangeAccounts] CHECK CONSTRAINT [FK_ExchangeAccounts_ExchangeMailboxPlans] + +/****** Object: Table [dbo].[ExchangeAccounts] ******/ +ALTER TABLE [dbo].[ExchangeMailboxPlans] WITH CHECK ADD CONSTRAINT [FK_ExchangeMailboxPlans_ExchangeOrganizations] FOREIGN KEY([ItemID]) +REFERENCES [dbo].[ExchangeOrganizations] ([ItemID]) +ON DELETE CASCADE + +/****** Object: Table [dbo].[ExchangeAccounts] ******/ +ALTER TABLE dbo.ExchangeMailboxPlans ADD CONSTRAINT + IX_ExchangeMailboxPlans UNIQUE NONCLUSTERED + ( + MailboxPlanId + ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + +END +GO + +/****** Object: Table [dbo].[ExchangeAccounts] Extend Exchange Accounts with MailboxplanID ******/ +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeAccounts' AND COLS.name='MailboxPlanId') +BEGIN +ALTER TABLE [dbo].[ExchangeAccounts] ADD [MailboxPlanId] [int] NULL +END +GO + +/****** Object: Table [dbo].[ExchangeAccounts] Extend Exchange Accounts with SubscriberNumber ******/ +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeAccounts' AND COLS.name='SubscriberNumber') +BEGIN +ALTER TABLE [dbo].[ExchangeAccounts] ADD [SubscriberNumber] [nvarchar] (32) COLLATE Latin1_General_CI_AS NULL +END +GO + +/****** Object: Table [dbo].[ExchangeOrganizations] ******/ +ALTER TABLE [dbo].[ExchangeOrganizations] ALTER COLUMN [OrganizationID] [nvarchar](128) COLLATE Latin1_General_CI_AS NOT NULL +GO + + + +-- LyncUsers +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LyncUsers]') AND type in (N'U')) +BEGIN +CREATE TABLE [dbo].[LyncUsers]( + [LyncUserID] [int] IDENTITY(1,1) NOT NULL, + [AccountID] [int] NOT NULL, + [LyncUserPlanID] [int] NOT NULL, + [CreatedDate] [datetime] NOT NULL, + [ModifiedDate] [datetime] NOT NULL, + CONSTRAINT [PK_LyncUsers] PRIMARY KEY CLUSTERED +( + [LyncUserID] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + + +ALTER TABLE [dbo].[LyncUsers] ADD CONSTRAINT [DF_LyncUsers_CreatedDate] DEFAULT (getdate()) FOR [CreatedDate] + +ALTER TABLE [dbo].[LyncUsers] ADD CONSTRAINT [DF_LyncUsers_ChangedDate] DEFAULT (getdate()) FOR [ModifiedDate] + +END +GO + + + + + +-- LyncUserPlans +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LyncUserPlans]') AND type in (N'U')) +BEGIN +CREATE TABLE [dbo].[LyncUserPlans]( + [LyncUserPlanId] [int] IDENTITY(1,1) NOT NULL, + [ItemID] [int] NOT NULL, + [LyncUserPlanName] [nvarchar](300) NOT NULL, + [IM] [bit] NOT NULL, + [Mobility] [bit] NOT NULL, + [MobilityEnableOutsideVoice] [bit] NOT NULL, + [Federation] [bit] NOT NULL, + [Conferencing] [bit] NOT NULL, + [EnterpriseVoice] [bit] NOT NULL, + [VoicePolicy] [int] NOT NULL, + [IsDefault] [bit] NOT NULL, + CONSTRAINT [PK_LyncUserPlans] PRIMARY KEY CLUSTERED +( + [LyncUserPlanId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +ALTER TABLE dbo.LyncUserPlans ADD CONSTRAINT + IX_LyncUserPlans UNIQUE NONCLUSTERED + ( + LyncUserPlanId + ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + +ALTER TABLE dbo.LyncUserPlans ADD CONSTRAINT + FK_LyncUserPlans_ExchangeOrganizations FOREIGN KEY + ( + ItemID + ) REFERENCES dbo.ExchangeOrganizations + ( + ItemID + ) ON UPDATE NO ACTION + ON DELETE CASCADE + +ALTER TABLE [dbo].[LyncUsers] WITH CHECK ADD CONSTRAINT [FK_LyncUsers_LyncUserPlans] FOREIGN KEY([LyncUserPlanId]) +REFERENCES [dbo].[LyncUserPlans] ([LyncUserPlanId]) + +ALTER TABLE [dbo].[LyncUsers] CHECK CONSTRAINT [FK_LyncUsers_LyncUserPlans] + +END +GO + + + + +/****** Object: Table [dbo].[AddExchangeAccount] ******/ +ALTER PROCEDURE [dbo].[AddExchangeAccount] +( + @AccountID int OUTPUT, + @ItemID int, + @AccountType int, + @AccountName nvarchar(300), + @DisplayName nvarchar(300), + @PrimaryEmailAddress nvarchar(300), + @MailEnabledPublicFolder bit, + @MailboxManagerActions varchar(200), + @SamAccountName nvarchar(100), + @AccountPassword nvarchar(200), + @MailboxPlanId int, + @SubscriberNumber nvarchar(32) +) +AS + +INSERT INTO ExchangeAccounts +( + ItemID, + AccountType, + AccountName, + DisplayName, + PrimaryEmailAddress, + MailEnabledPublicFolder, + MailboxManagerActions, + SamAccountName, + AccountPassword, + MailboxPlanId, + SubscriberNumber +) +VALUES +( + @ItemID, + @AccountType, + @AccountName, + @DisplayName, + @PrimaryEmailAddress, + @MailEnabledPublicFolder, + @MailboxManagerActions, + @SamAccountName, + @AccountPassword, + @MailboxPlanId, + @SubscriberNumber +) + +SET @AccountID = SCOPE_IDENTITY() + +RETURN +GO + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'AddExchangeMailboxPlan') +BEGIN +EXEC sp_executesql N' +CREATE PROCEDURE [dbo].[AddExchangeMailboxPlan] +( + @MailboxPlanId int OUTPUT, + @ItemID int, + @MailboxPlan nvarchar(300), + @EnableActiveSync bit, + @EnableIMAP bit, + @EnableMAPI bit, + @EnableOWA bit, + @EnablePOP bit, + @IsDefault bit, + @IssueWarningPct int, + @KeepDeletedItemsDays int, + @MailboxSizeMB int, + @MaxReceiveMessageSizeKB int, + @MaxRecipients int, + @MaxSendMessageSizeKB int, + @ProhibitSendPct int, + @ProhibitSendReceivePct int , + @HideFromAddressBook bit +) +AS + +INSERT INTO ExchangeMailboxPlans +( + ItemID, + MailboxPlan, + EnableActiveSync, + EnableIMAP, + EnableMAPI, + EnableOWA, + EnablePOP, + IsDefault, + IssueWarningPct, + KeepDeletedItemsDays, + MailboxSizeMB, + MaxReceiveMessageSizeKB, + MaxRecipients, + MaxSendMessageSizeKB, + ProhibitSendPct, + ProhibitSendReceivePct, + HideFromAddressBook +) +VALUES +( + @ItemID, + @MailboxPlan, + @EnableActiveSync, + @EnableIMAP, + @EnableMAPI, + @EnableOWA, + @EnablePOP, + @IsDefault, + @IssueWarningPct, + @KeepDeletedItemsDays, + @MailboxSizeMB, + @MaxReceiveMessageSizeKB, + @MaxRecipients, + @MaxSendMessageSizeKB, + @ProhibitSendPct, + @ProhibitSendReceivePct, + @HideFromAddressBook +) + +SET @MailboxPlanId = SCOPE_IDENTITY() + +RETURN' +END +GO + + + + + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[AddExchangeOrganization] +( + @ItemID int, + @OrganizationID nvarchar(128) +) +AS + +IF NOT EXISTS(SELECT * FROM ExchangeOrganizations WHERE OrganizationID = @OrganizationID) +BEGIN + INSERT INTO ExchangeOrganizations + (ItemID, OrganizationID) + VALUES + (@ItemID, @OrganizationID) +END + +RETURN +GO + + + + + + + + + + + + +ALTER FUNCTION [dbo].[CalculateQuotaUsage] +( + @PackageID int, + @QuotaID int +) +RETURNS int +AS + BEGIN + + DECLARE @QuotaTypeID int + SELECT @QuotaTypeID = QuotaTypeID FROM Quotas + WHERE QuotaID = @QuotaID + + IF @QuotaTypeID <> 2 + RETURN 0 + + DECLARE @Result int + + IF @QuotaID = 52 -- diskspace + SET @Result = dbo.CalculatePackageDiskspace(@PackageID) + ELSE IF @QuotaID = 51 -- bandwidth + SET @Result = dbo.CalculatePackageBandwidth(@PackageID) + ELSE IF @QuotaID = 53 -- domains + SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT + INNER JOIN Domains AS D ON D.PackageID = PT.PackageID + WHERE IsSubDomain = 0 AND IsInstantAlias = 0 AND IsDomainPointer = 0 AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 54 -- sub-domains + SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT + INNER JOIN Domains AS D ON D.PackageID = PT.PackageID + WHERE IsSubDomain = 1 AND IsInstantAlias = 0 AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 220 -- domain pointers + SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT + INNER JOIN Domains AS D ON D.PackageID = PT.PackageID + WHERE IsDomainPointer = 1 AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 71 -- scheduled tasks + SET @Result = (SELECT COUNT(S.ScheduleID) FROM PackagesTreeCache AS PT + INNER JOIN Schedule AS S ON S.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 305 -- RAM of VPS + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 306 -- HDD of VPS + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 309 -- External IP addresses of VPS + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) + ELSE IF @QuotaID = 100 -- Dedicated Web IP addresses + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 2) + ELSE IF @QuotaID = 350 -- RAM of VPSforPc + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'Memory' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 351 -- HDD of VPSforPc + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 354 -- External IP addresses of VPSforPc + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) + ELSE IF @QuotaID = 319 -- BB Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts ea + INNER JOIN BlackBerryUsers bu ON ea.AccountID = bu.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 206 -- HostedSolution.Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (1,5,6,7)) + ELSE IF @QuotaID = 78 -- Exchange2007.Mailboxes + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND ea.MailboxPlanId IS NOT NULL) + ELSE IF @QuotaID = 77 -- Exchange2007.DiskSpace + SET @Result = (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS ea + INNER JOIN ExchangeMailboxPlans AS B ON ea.MailboxPlanId = B.MailboxPlanId + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 370 -- Lync.Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 376 -- Lync.EVUsers + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID + INNER JOIN LyncUserPlans lp ON lu.LyncUserPlanId = lp.LyncUserPlanId + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND lp.EnterpriseVoice = 1) + ELSE + SET @Result = (SELECT COUNT(SI.ItemID) FROM Quotas AS Q + INNER JOIN ServiceItems AS SI ON SI.ItemTypeID = Q.ItemTypeID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID AND PT.ParentPackageID = @PackageID + WHERE Q.QuotaID = @QuotaID) + + RETURN @Result + END + +GO + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'DeleteExchangeMailboxPlan') +BEGIN +EXEC sp_executesql N' +CREATE PROCEDURE [dbo].[DeleteExchangeMailboxPlan] +( + @MailboxPlanId int +) +AS + +-- delete mailboxplan +DELETE FROM ExchangeMailboxPlans +WHERE MailboxPlanId = @MailboxPlanId + +RETURN' +END +GO + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[DeleteExchangeOrganization] +( + @ItemID int +) +AS +BEGIN TRAN + DELETE FROM ExchangeMailboxPlans WHERE ItemID = @ItemID + DELETE FROM ExchangeOrganizations WHERE ItemID = @ItemID +COMMIT TRAN +RETURN +GO + + + + + + + + + + + +ALTER PROCEDURE [dbo].[ExchangeAccountExists] +( + @AccountName nvarchar(20), + @Exists bit OUTPUT +) +AS +SET @Exists = 0 +IF EXISTS(SELECT * FROM ExchangeAccounts WHERE sAMAccountName LIKE '%\'+@AccountName) +BEGIN + SET @Exists = 1 +END + +RETURN + +GO + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetExchangeAccounts] +( + @ItemID int, + @AccountType int +) +AS +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber +FROM + ExchangeAccounts AS E +INNER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + (E.AccountType = @AccountType OR @AccountType IS NULL) +ORDER BY DisplayName +RETURN + +GO + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetExchangeAccountsPaged] +( + @ActorID int, + @ItemID int, + @AccountTypes nvarchar(30), + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50), + @StartRow int, + @MaximumRows int +) +AS + +DECLARE @PackageID int +SELECT @PackageID = PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- start +DECLARE @condition nvarchar(700) +SET @condition = ' +EA.AccountType IN (' + @AccountTypes + ') +AND EA.ItemID = @ItemID +' + +IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL +AND @FilterValue <> '' AND @FilterValue IS NOT NULL +BEGIN + IF @FilterColumn = 'PrimaryEmailAddress' AND @AccountTypes <> '2' + BEGIN + SET @condition = @condition + ' AND EA.AccountID IN (SELECT EAEA.AccountID FROM ExchangeAccountEmailAddresses EAEA WHERE EAEA.EmailAddress LIKE ''' + @FilterValue + ''')' + END + ELSE + BEGIN + SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + '''' + END +END + +IF @SortColumn IS NULL OR @SortColumn = '' +SET @SortColumn = 'EA.DisplayName ASC' + +DECLARE @joincondition nvarchar(700) + SET @joincondition = ',P.MailboxPlan FROM ExchangeAccounts AS EA + LEFT OUTER JOIN ExchangeMailboxPlans AS P ON EA.MailboxPlanId = P.MailboxPlanId' + +DECLARE @sql nvarchar(3500) + +set @sql = ' +SELECT COUNT(EA.AccountID) FROM ExchangeAccounts AS EA +WHERE ' + @condition + '; + +WITH Accounts AS ( + SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row, + EA.AccountID, + EA.ItemID, + EA.AccountType, + EA.AccountName, + EA.DisplayName, + EA.PrimaryEmailAddress, + EA.MailEnabledPublicFolder, + EA.MailboxPlanId, + EA.SubscriberNumber ' + @joincondition + + ' WHERE ' + @condition + ' +) + +SELECT * FROM Accounts +WHERE Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows +' + +print @sql + +exec sp_executesql @sql, N'@ItemID int, @StartRow int, @MaximumRows int', +@ItemID, @StartRow, @MaximumRows + +RETURN + + + + +GO + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeAccountByAccountName') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetExchangeAccountByAccountName] +( + @ItemID int, + @AccountName nvarchar(300) +) +AS +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.AccountName = @AccountName +RETURN' +END +GO + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeAccountByMailboxPlanId') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetExchangeAccountByMailboxPlanId] +( + @ItemID int, + @MailboxPlanId int +) +AS + +IF (@MailboxPlanId < 0) +BEGIN +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.MailboxPlanId IS NULL AND + E.AccountType IN (1,5) +RETURN + +END +ELSE +BEGIN +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.MailboxPlanId = @MailboxPlanId AND + E.AccountType IN (1,5) +RETURN +END' +END +GO + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeMailboxPlan') +BEGIN +EXEC sp_executesql N' CREATE PROCEDURE [dbo].[GetExchangeMailboxPlan] +( + @MailboxPlanId int +) +AS +SELECT + MailboxPlanId, + ItemID, + MailboxPlan, + EnableActiveSync, + EnableIMAP, + EnableMAPI, + EnableOWA, + EnablePOP, + IsDefault, + IssueWarningPct, + KeepDeletedItemsDays, + MailboxSizeMB, + MaxReceiveMessageSizeKB, + MaxRecipients, + MaxSendMessageSizeKB, + ProhibitSendPct, + ProhibitSendReceivePct, + HideFromAddressBook +FROM + ExchangeMailboxPlans +WHERE + MailboxPlanId = @MailboxPlanId +RETURN' +END +GO + + + + + + + + + + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeMailboxPlans') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetExchangeMailboxPlans] +( + @ItemID int +) +AS +SELECT + MailboxPlanId, + ItemID, + MailboxPlan, + EnableActiveSync, + EnableIMAP, + EnableMAPI, + EnableOWA, + EnablePOP, + IsDefault, + IssueWarningPct, + KeepDeletedItemsDays, + MailboxSizeMB, + MaxReceiveMessageSizeKB, + MaxRecipients, + MaxSendMessageSizeKB, + ProhibitSendPct, + ProhibitSendReceivePct, + HideFromAddressBook +FROM + ExchangeMailboxPlans +WHERE + ItemID = @ItemID +ORDER BY MailboxPlan +RETURN' +END +GO + + + + + + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetExchangeOrganizationStatistics] +( + @ItemID int +) +AS +SELECT + (SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 1 OR AccountType = 5 OR AccountType = 6) AND ItemID = @ItemID) AS CreatedMailboxes, + (SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 2 AND ItemID = @ItemID) AS CreatedContacts, + (SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 3 AND ItemID = @ItemID) AS CreatedDistributionLists, + (SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 4 AND ItemID = @ItemID) AS CreatedPublicFolders, + (SELECT COUNT(*) FROM ExchangeOrganizationDomains WHERE ItemID = @ItemID) AS CreatedDomains, + (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS A INNER JOIN ExchangeMailboxPlans AS B ON A.MailboxPlanId = B.MailboxPlanId WHERE A.ItemID=@ItemID) AS UsedDiskSpace + +RETURN +GO + + + + + + + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetPackages] +( + @ActorID int, + @UserID int +) +AS + +IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0 +RAISERROR('You are not allowed to access this account', 16, 1) + +SELECT + P.PackageID, + P.ParentPackageID, + P.PackageName, + P.StatusID, + P.PurchaseDate, + + -- server + ISNULL(P.ServerID, 0) AS ServerID, + ISNULL(S.ServerName, 'None') AS ServerName, + ISNULL(S.Comments, '') AS ServerComments, + ISNULL(S.VirtualServer, 1) AS VirtualServer, + + -- hosting plan + P.PlanID, + HP.PlanName, + + -- user + P.UserID, + U.Username, + U.FirstName, + U.LastName, + U.RoleID, + U.Email +FROM Packages AS P +INNER JOIN Users AS U ON P.UserID = U.UserID +INNER JOIN Servers AS S ON P.ServerID = S.ServerID +INNER JOIN HostingPlans AS HP ON P.PlanID = HP.PlanID +WHERE + P.UserID = @UserID +RETURN + +GO + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'SetExchangeAccountMailboxplan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[SetExchangeAccountMailboxplan] +( + @AccountID int, + @MailboxPlanId int +) +AS + +UPDATE ExchangeAccounts SET + MailboxPlanId = @MailboxPlanId +WHERE + AccountID = @AccountID + +RETURN' +END +GO + + + + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'SetOrganizationDefaultExchangeMailboxPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[SetOrganizationDefaultExchangeMailboxPlan] +( + @ItemId int, + @MailboxPlanId int +) +AS + +UPDATE ExchangeMailboxPlans SET IsDefault=0 WHERE ItemId=@ItemId +UPDATE ExchangeMailboxPlans SET IsDefault=1 WHERE MailboxPlanId=@MailboxPlanId + +RETURN' +END +GO + + + + + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[UpdateExchangeAccount] +( + @AccountID int, + @AccountName nvarchar(300), + @DisplayName nvarchar(300), + @PrimaryEmailAddress nvarchar(300), + @AccountType int, + @SamAccountName nvarchar(100), + @MailEnabledPublicFolder bit, + @MailboxManagerActions varchar(200), + @Password varchar(200), + @MailboxPlanId int, + @SubscriberNumber varchar(32) +) +AS + +BEGIN TRAN + +IF (@MailboxPlanId = -1) +BEGIN + SET @MailboxPlanId = NULL +END + +UPDATE ExchangeAccounts SET + AccountName = @AccountName, + DisplayName = @DisplayName, + PrimaryEmailAddress = @PrimaryEmailAddress, + MailEnabledPublicFolder = @MailEnabledPublicFolder, + MailboxManagerActions = @MailboxManagerActions, + AccountType =@AccountType, + SamAccountName = @SamAccountName, + MailboxPlanId = @MailboxPlanId, + SubscriberNumber = @SubscriberNumber + +WHERE + AccountID = @AccountID + +IF (@@ERROR <> 0 ) + BEGIN + ROLLBACK TRANSACTION + RETURN -1 + END + +UPDATE ExchangeAccounts SET + AccountPassword = @Password WHERE AccountID = @AccountID AND @Password IS NOT NULL + +IF (@@ERROR <> 0 ) + BEGIN + ROLLBACK TRANSACTION + RETURN -1 + END +COMMIT TRAN +RETURN +GO + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetExchangeAccount] +( + @ItemID int, + @AccountID int +) +AS +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.AccountID = @AccountID +RETURN +GO + + + + + + + + + +ALTER PROCEDURE [dbo].[GetExchangeMailboxes] + @ItemID int +AS +BEGIN +SELECT + AccountID, + ItemID, + AccountType, + AccountName, + DisplayName, + PrimaryEmailAddress, + MailEnabledPublicFolder, + SubscriberNumber +FROM + ExchangeAccounts +WHERE + ItemID = @ItemID AND + (AccountType =1 OR AccountType=5 OR AccountType=6) +ORDER BY 1 + +END + +GO + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[SearchExchangeAccount] +( + @ActorID int, + @AccountType int, + @PrimaryEmailAddress nvarchar(300) +) +AS + +DECLARE @PackageID int +DECLARE @ItemID int +DECLARE @AccountID int + +SELECT + @AccountID = AccountID, + @ItemID = ItemID +FROM ExchangeAccounts +WHERE PrimaryEmailAddress = @PrimaryEmailAddress +AND AccountType = @AccountType + + +-- check space rights +SELECT @PackageID = PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +SELECT + AccountID, + ItemID, + @PackageID AS PackageID, + AccountType, + AccountName, + DisplayName, + PrimaryEmailAddress, + MailEnabledPublicFolder, + MailboxManagerActions, + SamAccountName, + AccountPassword, + SubscriberNumber +FROM ExchangeAccounts +WHERE AccountID = @AccountID + +RETURN + +GO + + + + + + + + + + + +ALTER PROCEDURE [dbo].[SearchExchangeAccounts] +( + @ActorID int, + @ItemID int, + @IncludeMailboxes bit, + @IncludeContacts bit, + @IncludeDistributionLists bit, + @IncludeRooms bit, + @IncludeEquipment bit, + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50) +) +AS +DECLARE @PackageID int +SELECT @PackageID = PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- start +DECLARE @condition nvarchar(700) +SET @condition = ' +((@IncludeMailboxes = 1 AND EA.AccountType = 1) +OR (@IncludeContacts = 1 AND EA.AccountType = 2) +OR (@IncludeDistributionLists = 1 AND EA.AccountType = 3) +OR (@IncludeRooms = 1 AND EA.AccountType = 5) +OR (@IncludeEquipment = 1 AND EA.AccountType = 6)) +AND EA.ItemID = @ItemID +' + +IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL +AND @FilterValue <> '' AND @FilterValue IS NOT NULL +SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + '''' + +IF @SortColumn IS NULL OR @SortColumn = '' +SET @SortColumn = 'EA.DisplayName ASC' + +DECLARE @sql nvarchar(3500) + +set @sql = ' +SELECT + EA.AccountID, + EA.ItemID, + EA.AccountType, + EA.AccountName, + EA.DisplayName, + EA.PrimaryEmailAddress, + EA.MailEnabledPublicFolder, + EA.SubscriberNumber +FROM ExchangeAccounts AS EA +WHERE ' + @condition + +print @sql + +exec sp_executesql @sql, N'@ItemID int, @IncludeMailboxes int, @IncludeContacts int, + @IncludeDistributionLists int, @IncludeRooms bit, @IncludeEquipment bit', +@ItemID, @IncludeMailboxes, @IncludeContacts, @IncludeDistributionLists, @IncludeRooms, @IncludeEquipment + +RETURN + +GO + + + + + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[SearchOrganizationAccounts] +( + @ActorID int, + @ItemID int, + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50), + @IncludeMailboxes bit +) +AS +DECLARE @PackageID int +SELECT @PackageID = PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- start +DECLARE @condition nvarchar(700) +SET @condition = ' +(EA.AccountType = 7 OR (EA.AccountType = 1 AND @IncludeMailboxes = 1) ) +AND EA.ItemID = @ItemID +' + +IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL +AND @FilterValue <> '' AND @FilterValue IS NOT NULL +SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + '''' + +IF @SortColumn IS NULL OR @SortColumn = '' +SET @SortColumn = 'EA.DisplayName ASC' + +DECLARE @sql nvarchar(3500) + +set @sql = ' +SELECT + EA.AccountID, + EA.ItemID, + EA.AccountType, + EA.AccountName, + EA.DisplayName, + EA.PrimaryEmailAddress, + EA.SubscriberNumber +FROM ExchangeAccounts AS EA +WHERE ' + @condition + +print @sql + +exec sp_executesql @sql, N'@ItemID int, @IncludeMailboxes bit', +@ItemID, @IncludeMailboxes + +RETURN + +GO + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'AddLyncUser') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[AddLyncUser] + @AccountID int, + @LyncUserPlanID int +AS +INSERT INTO + dbo.LyncUsers + (AccountID, + LyncUserPlanID, + CreatedDate, + ModifiedDate) +VALUES +( + @AccountID, + @LyncUserPlanID, + getdate(), + getdate() +)' +END +GO + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'AddLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[AddLyncUserPlan] +( + @LyncUserPlanId int OUTPUT, + @ItemID int, + @LyncUserPlanName nvarchar(300), + @IM bit, + @Mobility bit, + @MobilityEnableOutsideVoice bit, + @Federation bit, + @Conferencing bit, + @EnterpriseVoice bit, + @VoicePolicy int, + @IsDefault bit +) +AS + +INSERT INTO LyncUserPlans +( + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +) +VALUES +( + @ItemID, + @LyncUserPlanName, + @IM, + @Mobility, + @MobilityEnableOutsideVoice, + @Federation, + @Conferencing, + @EnterpriseVoice, + @VoicePolicy, + @IsDefault +) + +SET @LyncUserPlanId = SCOPE_IDENTITY() + +RETURN' +END +GO + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'CheckLyncUserExists') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[CheckLyncUserExists] + @AccountID int +AS + SELECT + COUNT(AccountID) + FROM + dbo.LyncUsers + WHERE AccountID = @AccountID' +END +GO + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'CheckLyncUserExists') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[CheckLyncUserExists] + @AccountID int +AS +BEGIN + SELECT + COUNT(AccountID) + FROM + dbo.LyncUsers + WHERE AccountID = @AccountID' +END +GO + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'DeleteLyncUser') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[DeleteLyncUser] +( + @AccountId int +) +AS + +DELETE FROM + LyncUsers +WHERE + AccountId = @AccountId + +RETURN' +END +GO + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'DeleteLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[DeleteLyncUserPlan] +( + @LyncUserPlanId int +) +AS + +-- delete lyncuserplan +DELETE FROM LyncUserPlans +WHERE LyncUserPlanId = @LyncUserPlanId + +RETURN' +END +GO + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetLyncUserPlan] +( + @LyncUserPlanId int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +FROM + LyncUserPlans +WHERE + LyncUserPlanId = @LyncUserPlanId +RETURN' +END +GO + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUserPlanByAccountId') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetLyncUserPlanByAccountId] +( + @AccountID int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +FROM + LyncUserPlans +WHERE + LyncUserPlanId IN (SELECT LyncUserPlanId FROM LyncUsers WHERE AccountID = @AccountID) +RETURN' +END +GO + + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUserPlans') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetLyncUserPlans] +( + @ItemID int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +FROM + LyncUserPlans +WHERE + ItemID = @ItemID +ORDER BY LyncUserPlanName +RETURN' +END +GO + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUsers') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetLyncUsers] +( + @ItemID int, + @SortColumn nvarchar(40), + @SortDirection nvarchar(20), + @StartRow int, + @Count int +) +AS + +CREATE TABLE #TempLyncUsers +( + [ID] [int] IDENTITY(1,1) NOT NULL, + [AccountID] [int], + [ItemID] [int] NOT NULL, + [AccountName] [nvarchar](300) NOT NULL, + [DisplayName] [nvarchar](300) NOT NULL, + [PrimaryEmailAddress] [nvarchar](300) NULL, + [SamAccountName] [nvarchar](100) NULL, + [LyncUserPlanId] [int] NOT NULL, + [LyncUserPlanName] [nvarchar] (300) NOT NULL, +) + + +DECLARE @condition nvarchar(700) +SET @condition = '''' + +IF (@SortColumn = ''DisplayName'') +BEGIN + SET @condition = ''ORDER BY ea.DisplayName'' +END + +IF (@SortColumn = ''PrimaryEmailAddress'') +BEGIN + SET @condition = ''ORDER BY ea.PrimaryEmailAddress'' +END + +IF (@SortColumn = ''LyncUserPlanName'') +BEGIN + SET @condition = ''ORDER BY lp.LyncUserPlanName'' +END + +DECLARE @sql nvarchar(3500) + +set @sql = '' + INSERT INTO + #TempLyncUsers + SELECT + ea.AccountID, + ea.ItemID, + ea.AccountName, + ea.DisplayName, + ea.PrimaryEmailAddress, + ea.SamAccountName, + ou.LyncUserPlanId, + lp.LyncUserPlanName + FROM + ExchangeAccounts ea + INNER JOIN + LyncUsers ou + INNER JOIN + LyncUserPlans lp + ON + ou.LyncUserPlanId = lp.LyncUserPlanId + ON + ea.AccountID = ou.AccountID + WHERE + ea.ItemID = @ItemID '' + @condition + +exec sp_executesql @sql, N''@ItemID int'',@ItemID + +DECLARE @RetCount int +SELECT @RetCount = COUNT(ID) FROM #TempLyncUsers + +IF (@SortDirection = ''ASC'') +BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID > @StartRow AND ID <= (@StartRow + @Count) +END +ELSE +BEGIN + IF @SortColumn <> '''' AND @SortColumn IS NOT NULL + BEGIN + IF (@SortColumn = ''DisplayName'') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY DisplayName DESC + END + IF (@SortColumn = ''PrimaryEmailAddress'') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress DESC + END + IF (@SortColumn = ''LyncUserPlanName'') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY LyncUserPlanName DESC + END + END + ELSE + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress DESC + END + + +END + +DROP TABLE #TempLyncUsers' +END +GO + + + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUsersCount') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetLyncUsersCount] +( + @ItemID int +) +AS + +SELECT + COUNT(ea.AccountID) +FROM + ExchangeAccounts ea +INNER JOIN + LyncUsers ou +ON + ea.AccountID = ou.AccountID +WHERE + ea.ItemID = @ItemID' +END +GO + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'SetLyncUserLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[SetLyncUserLyncUserPlan] +( + @AccountID int, + @LyncUserPlanId int +) +AS + +UPDATE LyncUsers SET + LyncUserPlanId = @LyncUserPlanId +WHERE + AccountID = @AccountID + +RETURN' +END +GO + + + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'SetOrganizationDefaultLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[SetOrganizationDefaultLyncUserPlan] +( + @ItemId int, + @LyncUserPlanId int +) +AS + +UPDATE LyncUserPlans SET IsDefault=0 WHERE ItemId=@ItemId +UPDATE LyncUserPlans SET IsDefault=1 WHERE LyncUserPlanId=@LyncUserPlanId + +RETURN' +END +GO + + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetHostingPlanQuotas] +( + @ActorID int, + @PlanID int, + @PackageID int, + @ServerID int +) +AS + +-- check rights +IF dbo.CheckActorParentPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +DECLARE @IsAddon bit + +IF @ServerID = 0 +SELECT @ServerID = ServerID FROM Packages +WHERE PackageID = @PackageID + +-- get resource groups +SELECT + RG.GroupID, + RG.GroupName, + CASE + WHEN HPR.CalculateDiskSpace IS NULL THEN CAST(0 as bit) + ELSE CAST(1 as bit) + END AS Enabled, + dbo.GetPackageAllocatedResource(@PackageID, RG.GroupID, @ServerID) AS ParentEnabled, + ISNULL(HPR.CalculateDiskSpace, 1) AS CalculateDiskSpace, + ISNULL(HPR.CalculateBandwidth, 1) AS CalculateBandwidth +FROM ResourceGroups AS RG +LEFT OUTER JOIN HostingPlanResources AS HPR ON RG.GroupID = HPR.GroupID AND HPR.PlanID = @PlanID +WHERE (RG.ShowGroup = 1) +ORDER BY RG.GroupOrder + +-- get quotas by groups +SELECT + Q.QuotaID, + Q.GroupID, + Q.QuotaName, + Q.QuotaDescription, + Q.QuotaTypeID, + ISNULL(HPQ.QuotaValue, 0) AS QuotaValue, + dbo.GetPackageAllocatedQuota(@PackageID, Q.QuotaID) AS ParentQuotaValue +FROM Quotas AS Q +LEFT OUTER JOIN HostingPlanQuotas AS HPQ ON Q.QuotaID = HPQ.QuotaID AND HPQ.PlanID = @PlanID +ORDER BY Q.QuotaOrder +RETURN +GO + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetRawServicesByServerID] +( + @ActorID int, + @ServerID int +) +AS + +-- check rights +DECLARE @IsAdmin bit +SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID) + +-- resource groups +SELECT + GroupID, + GroupName +FROM ResourceGroups +WHERE @IsAdmin = 1 AND (ShowGroup = 1) +ORDER BY GroupOrder + +-- services +SELECT + S.ServiceID, + S.ServerID, + S.ServiceName, + S.Comments, + RG.GroupID, + PROV.DisplayName AS ProviderName +FROM Services AS S +INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID +INNER JOIN ResourceGroups AS RG ON PROV.GroupID = RG.GroupID +WHERE + S.ServerID = @ServerID + AND @IsAdmin = 1 +ORDER BY RG.GroupOrder + +RETURN +GO + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetVirtualServices] +( + @ActorID int, + @ServerID int +) +AS + +-- check rights +DECLARE @IsAdmin bit +SET @IsAdmin = dbo.CheckIsUserAdmin(@ActorID) + +-- virtual groups +SELECT + VRG.VirtualGroupID, + RG.GroupID, + RG.GroupName, + ISNULL(VRG.DistributionType, 1) AS DistributionType, + ISNULL(VRG.BindDistributionToPrimary, 1) AS BindDistributionToPrimary +FROM ResourceGroups AS RG +LEFT OUTER JOIN VirtualGroups AS VRG ON RG.GroupID = VRG.GroupID AND VRG.ServerID = @ServerID +WHERE + @IsAdmin = 1 AND (ShowGroup = 1) +ORDER BY RG.GroupOrder + +-- services +SELECT + VS.ServiceID, + S.ServiceName, + S.Comments, + P.GroupID, + P.DisplayName, + SRV.ServerName +FROM VirtualServices AS VS +INNER JOIN Services AS S ON VS.ServiceID = S.ServiceID +INNER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID +INNER JOIN Providers AS P ON S.ProviderID = P.ProviderID +WHERE + VS.ServerID = @ServerID + AND @IsAdmin = 1 + +RETURN +GO + + + + + + + + + + + + + + + + + + + diff --git a/WebsitePanel/Lib/References/Microsoft/Microsoft.Exchange.Data.Common.dll b/WebsitePanel/Lib/References/Microsoft/Microsoft.Exchange.Data.Common.dll new file mode 100644 index 00000000..6357f145 Binary files /dev/null and b/WebsitePanel/Lib/References/Microsoft/Microsoft.Exchange.Data.Common.dll differ diff --git a/WebsitePanel/Lib/References/Microsoft/Microsoft.Exchange.Data.Transport.dll b/WebsitePanel/Lib/References/Microsoft/Microsoft.Exchange.Data.Transport.dll new file mode 100644 index 00000000..971c863e Binary files /dev/null and b/WebsitePanel/Lib/References/Microsoft/Microsoft.Exchange.Data.Transport.dll differ diff --git a/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.Core.dll b/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.Core.dll new file mode 100644 index 00000000..beb6e4ab Binary files /dev/null and b/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.Core.dll differ diff --git a/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.Hosted.dll b/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.Hosted.dll new file mode 100644 index 00000000..fb643522 Binary files /dev/null and b/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.Hosted.dll differ diff --git a/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.WritableConfig.dll b/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.WritableConfig.dll new file mode 100644 index 00000000..aec9421d Binary files /dev/null and b/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.WritableConfig.dll differ diff --git a/WebsitePanel/Sources/Tools/WSPTransportAgent.sln b/WebsitePanel/Sources/Tools/WSPTransportAgent.sln new file mode 100644 index 00000000..ef592cfc --- /dev/null +++ b/WebsitePanel/Sources/Tools/WSPTransportAgent.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WSPTransportAgent", "WSPTransportAgent\WSPTransportAgent.csproj", "{D959F137-A56F-4F4E-BA80-599FBE3700E3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D959F137-A56F-4F4E-BA80-599FBE3700E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D959F137-A56F-4F4E-BA80-599FBE3700E3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D959F137-A56F-4F4E-BA80-599FBE3700E3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D959F137-A56F-4F4E-BA80-599FBE3700E3}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/WebsitePanel/Sources/Tools/WSPTransportAgent/App.config b/WebsitePanel/Sources/Tools/WSPTransportAgent/App.config new file mode 100644 index 00000000..f3d7ccd1 --- /dev/null +++ b/WebsitePanel/Sources/Tools/WSPTransportAgent/App.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/Tools/WSPTransportAgent/Properties/AssemblyInfo.cs b/WebsitePanel/Sources/Tools/WSPTransportAgent/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..2235d8fb --- /dev/null +++ b/WebsitePanel/Sources/Tools/WSPTransportAgent/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WSPTransportAgent")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WSPTransportAgent")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("e28cac4e-9660-4174-8010-c6a00c81bf57")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WebsitePanel/Sources/Tools/WSPTransportAgent/WSPRoutingAgent.cs b/WebsitePanel/Sources/Tools/WSPTransportAgent/WSPRoutingAgent.cs new file mode 100644 index 00000000..84fe075b --- /dev/null +++ b/WebsitePanel/Sources/Tools/WSPTransportAgent/WSPRoutingAgent.cs @@ -0,0 +1,260 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; +using System.IO; +using System.Configuration; +using System.Collections.ObjectModel; +using System.Collections; +using System.Collections.Specialized; +using System.Xml; +using Microsoft.Exchange.Data.Transport; +using Microsoft.Exchange.Data.Transport.Routing; +using Microsoft.Exchange.Data.Mime; +using System.DirectoryServices; + + +namespace WSPTransportAgent +{ + public class WSPRoutingAgentFactory : RoutingAgentFactory + { + public override RoutingAgent CreateAgent(SmtpServer server) + { + return new WSPRoutingAgent(server); + } + } + + public class WSPRoutingAgent : RoutingAgent + { + private string routingDomain; + private bool enableVerboseLogging; + private string logFile; + private Hashtable htAcceptedDomains; + private bool blockInternalInterTenantOOF; + + public WSPRoutingAgent(SmtpServer server) + { + //subscribe to different events + loadConfiguration(); + + WriteLine("WSPRoutingAgent Registration started"); + loadAcceptedDomains(server); + //GetAcceptedDomains(); + WriteLine("\trouting Domain: " + routingDomain); + + base.OnResolvedMessage += new ResolvedMessageEventHandler(WSPRoutingAgent_OnResolvedMessage); + + WriteLine("WSPRoutingAgent Registration completed"); + } + + private void loadConfiguration() + { + this.routingDomain = ".tmpdefault"; + this.enableVerboseLogging = true; + this.logFile = "C:\\WSP.LOG"; + + try + { + ExeConfigurationFileMap map = new ExeConfigurationFileMap(); + map.ExeConfigFilename = System.Reflection.Assembly.GetExecutingAssembly().Location + ".config"; + Configuration libConfig = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None); + AppSettingsSection section = (libConfig.GetSection("appSettings") as AppSettingsSection); + + this.routingDomain = section.Settings["routingDomain"].Value; + this.enableVerboseLogging = (section.Settings["enableVerboseLogging"].Value == "true"); + this.blockInternalInterTenantOOF = (section.Settings["blockInternalInterTenantOOF"].Value == "true"); + this.logFile = section.Settings["logFile"].Value; + } + catch (Exception ex) + { + WriteLine("\t[Error] " + ex.Message); + LogErrorToEventLog("[Error] [loadConfiguration] Error :" + ex.Message); + } + + + } + + + private void loadAcceptedDomains(SmtpServer server) + { + try + { + if (htAcceptedDomains == null) + this.htAcceptedDomains = new Hashtable(); + else + this.htAcceptedDomains.Clear(); + + foreach (AcceptedDomain domain in server.AcceptedDomains) + { + htAcceptedDomains.Add(domain.ToString(), "1"); + WriteLine("\tAccepted Domain: " + domain.ToString()); + } + } + catch (Exception ex) + { + WriteLine("\t[Error] " + ex.Message); + LogErrorToEventLog("[Error] [loadAcceptedDomains] Error :" + ex.Message); + } + } + + + void WSPRoutingAgent_OnResolvedMessage(ResolvedMessageEventSource source, QueuedMessageEventArgs e) + { + try + { + + WriteLine("Start WSPRoutingAgent_OnResolvedMessage"); + + WriteLine("\tFromAddress: " + e.MailItem.FromAddress.ToString()); + WriteLine("\tSubject: " + e.MailItem.Message.Subject.ToString()); + WriteLine("\tMapiMessageClass: " + e.MailItem.Message.MapiMessageClass.ToString()); + + MimeDocument mdMimeDoc = e.MailItem.Message.MimeDocument; + HeaderList hlHeaderlist = mdMimeDoc.RootPart.Headers; + Header mhProcHeader = hlHeaderlist.FindFirst("X-WSP"); + + if (mhProcHeader == null) + { + WriteLine("\tTouched: " + "No"); + + if (!e.MailItem.Message.IsSystemMessage) + { + bool touched = false; + + if (e.MailItem.FromAddress.DomainPart != null) + { + foreach (EnvelopeRecipient recp in e.MailItem.Recipients) + { + WriteLine("\t\tTo: " + recp.Address.ToString().ToLower()); + if (IsMessageBetweenTenants(e.MailItem.FromAddress.DomainPart.ToLower(), recp.Address.DomainPart.ToLower())) + { + WriteLine("\t\tMessage routed to domain: " + recp.Address.DomainPart.ToLower() + routingDomain); + RoutingDomain myRoutingDomain = new RoutingDomain(recp.Address.DomainPart.ToLower() + routingDomain); + RoutingOverride myRoutingOverride = new RoutingOverride(myRoutingDomain, DeliveryQueueDomain.UseOverrideDomain); + source.SetRoutingOverride(recp, myRoutingOverride); + touched = true; + } + } + } + else + { + if ((e.MailItem.Message.MapiMessageClass.ToString() == "IPM.Note.Rules.OofTemplate.Microsoft") & + blockInternalInterTenantOOF) + { + WriteLine("\t\tOOF From: " + e.MailItem.Message.From.SmtpAddress); + if (e.MailItem.Message.From.SmtpAddress.Contains("@")) + { + string[] tmp = e.MailItem.Message.From.SmtpAddress.Split('@'); + foreach (EnvelopeRecipient recp in e.MailItem.Recipients) + { + WriteLine("\t\tTo: " + recp.Address.ToString().ToLower()); + if (IsMessageBetweenTenants(tmp[1].ToLower(), recp.Address.DomainPart.ToLower())) + { + WriteLine("\t\tRemove: " + recp.Address.DomainPart.ToLower()); + e.MailItem.Recipients.Remove(recp); + } + } + } + } + } + + if (touched) + { + MimeNode lhLasterHeader = hlHeaderlist.LastChild; + TextHeader nhNewHeader = new TextHeader("X-WSP", "Logged00"); + hlHeaderlist.InsertBefore(nhNewHeader, lhLasterHeader); + } + } + else + WriteLine("\tSystem Message"); + } + else + WriteLine("\tTouched: " + "Yes"); + + } + + catch (Exception ex) + { + WriteLine("\t[Error] Error :" + ex.Message); + LogErrorToEventLog("[Error] [OnResolvedMessage] Error :" + ex.Message); + } + + WriteLine("End WSPRoutingAgent_OnResolvedMessage"); + } + + private bool IsMessageBetweenTenants(string senderDomain, string recipientDomain) + { + if (senderDomain == recipientDomain) return false; + + if ((htAcceptedDomains[senderDomain] != null) && + (htAcceptedDomains[recipientDomain] != null)) + return true; + + return false; + } + + /* + private void GetAcceptedDomains() + { + try + { + htAcceptedDomains.Clear(); + DirectoryEntry rdRootDSE = new DirectoryEntry("LDAP://RootDSE"); + DirectoryEntry cfConfigPartition = new DirectoryEntry("LDAP://" + rdRootDSE.Properties["configurationnamingcontext"].Value); + DirectorySearcher cfConfigPartitionSearch = new DirectorySearcher(cfConfigPartition); + cfConfigPartitionSearch.Filter = "(objectClass=msExchAcceptedDomain)"; + cfConfigPartitionSearch.SearchScope = SearchScope.Subtree; + SearchResultCollection srSearchResults = cfConfigPartitionSearch.FindAll(); + + foreach (SearchResult srSearchResult in srSearchResults) + { + DirectoryEntry acDomain = srSearchResult.GetDirectoryEntry(); + htAcceptedDomains.Add(acDomain.Properties["msexchaccepteddomainname"].Value.ToString().ToLower(), "1"); + WriteLine("\tAccepted Domain :" + acDomain.Properties["msexchaccepteddomainname"].Value.ToString().ToLower()); + } + } + catch (Exception ex) + { + WriteLine("\tError :" + ex.Message); + EventLog.WriteEntry("WSP Transport Agent", ex.Message, EventLogEntryType.Error); + } + } + */ + + + private void WriteLine(string Line) + { + if (!enableVerboseLogging) return; + + try + { + StreamWriter writer = new StreamWriter(logFile, true, System.Text.Encoding.ASCII); + writer.WriteLine("[" + DateTime.Now.ToString() + "]" + Line); + writer.Close(); + } + catch (Exception e) + { + + } + } + + + private void LogErrorToEventLog(string Line) + { + try + { + if (EventLog.SourceExists("WSPTransportAgent")) + { + EventLog.WriteEntry("WSPTransportAgent", Line, EventLogEntryType.Error); + } + } + catch (Exception ex) + { + WriteLine("[Error] WritingEventLog :" + ex.Message); + } + } + + + } + +} diff --git a/WebsitePanel/Sources/Tools/WSPTransportAgent/WSPTransportAgent.csproj b/WebsitePanel/Sources/Tools/WSPTransportAgent/WSPTransportAgent.csproj new file mode 100644 index 00000000..20efc18d --- /dev/null +++ b/WebsitePanel/Sources/Tools/WSPTransportAgent/WSPTransportAgent.csproj @@ -0,0 +1,62 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {D959F137-A56F-4F4E-BA80-599FBE3700E3} + Library + Properties + WSPTransportAgent + WSPTransportAgent + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\Lib\References\Microsoft\Microsoft.Exchange.Data.Common.dll + + + ..\..\..\Lib\References\Microsoft\Microsoft.Exchange.Data.Transport.dll + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/Tools/WSPTransportAgent/WSPTransportAgent.reg b/WebsitePanel/Sources/Tools/WSPTransportAgent/WSPTransportAgent.reg new file mode 100644 index 00000000..755c888a --- /dev/null +++ b/WebsitePanel/Sources/Tools/WSPTransportAgent/WSPTransportAgent.reg @@ -0,0 +1,15 @@ +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\MEACPTransportAgent] +"MaxSize"=dword:00080000 +"AutoBackupLogFiles"=dword:00000000 +"Retention"=dword:00000000 + +[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\MEACPTransportAgent\MEACPTransportAgent] +"EventMessageFile"=hex(2):43,00,3a,00,5c,00,57,00,69,00,6e,00,64,00,6f,00,77,\ + 00,73,00,5c,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,2e,00,\ + 4e,00,45,00,54,00,5c,00,46,00,72,00,61,00,6d,00,65,00,77,00,6f,00,72,00,6b,\ + 00,36,00,34,00,5c,00,76,00,34,00,2e,00,30,00,2e,00,33,00,30,00,33,00,31,00,\ + 39,00,5c,00,45,00,76,00,65,00,6e,00,74,00,4c,00,6f,00,67,00,4d,00,65,00,73,\ + 00,73,00,61,00,67,00,65,00,73,00,2e,00,64,00,6c,00,6c,00,00,00 + diff --git a/WebsitePanel/Sources/Tools/WebsitePanel.Import.CsvBulk/ExchangeImport.cs b/WebsitePanel/Sources/Tools/WebsitePanel.Import.CsvBulk/ExchangeImport.cs index 315c378e..eee2cdb1 100644 --- a/WebsitePanel/Sources/Tools/WebsitePanel.Import.CsvBulk/ExchangeImport.cs +++ b/WebsitePanel/Sources/Tools/WebsitePanel.Import.CsvBulk/ExchangeImport.cs @@ -527,7 +527,7 @@ namespace WebsitePanel.Import.CsvBulk //create mailbox //ES.Services.ExchangeServer. string accountName = string.Empty; - int accountId = ES.Services.ExchangeServer.CreateMailbox(orgId, 0, ExchangeAccountType.Mailbox, accountName, displayName, name, domain, password, false, string.Empty); + int accountId = ES.Services.ExchangeServer.CreateMailbox(orgId, 0, ExchangeAccountType.Mailbox, accountName, displayName, name, domain, password, false, string.Empty, 0, string.Empty); if (accountId < 0) { string errorMessage = GetErrorMessage(accountId); @@ -558,12 +558,13 @@ namespace WebsitePanel.Import.CsvBulk //update mailbox + /* ES.Services.ExchangeServer.SetMailboxGeneralSettings(orgId, accountId, mailbox.DisplayName, null, mailbox.HideFromAddressBook, mailbox.Disabled, mailbox.FirstName, mailbox.Initials, mailbox.LastName, mailbox.Address, mailbox.City, mailbox.State, mailbox.Zip, mailbox.Country, mailbox.JobTitle, mailbox.Company, mailbox.Department, mailbox.Office, null, mailbox.BusinessPhone, mailbox.Fax, mailbox.HomePhone, mailbox.MobilePhone, mailbox.Pager, mailbox.WebPage, mailbox.Notes); - + */ ret = true; } catch (Exception ex) @@ -672,7 +673,7 @@ namespace WebsitePanel.Import.CsvBulk string name = emailAddress.Substring(0, emailAddress.IndexOf("@")); string domain = emailAddress.Substring(emailAddress.IndexOf("@") + 1); string accountName = string.Empty; - int accountId = ES.Services.Organizations.CreateUser(orgId, displayName, name, domain, password, false, string.Empty); + int accountId = ES.Services.Organizations.CreateUser(orgId, displayName, name, domain, password, string.Empty,false, string.Empty); if (accountId < 0) { @@ -703,12 +704,13 @@ namespace WebsitePanel.Import.CsvBulk user.Notes = notes; //update + /* ES.Services.Organizations.SetUserGeneralSettings(orgId, accountId, user.DisplayName, null, false, user.Disabled, user.Locked, user.FirstName, user.Initials, user.LastName, user.Address, user.City, user.State, user.Zip, user.Country, user.JobTitle, user.Company, user.Department, user.Office, null, user.BusinessPhone, user.Fax, user.HomePhone, user.MobilePhone, user.Pager, user.WebPage, user.Notes, user.ExternalEmail); - + */ ret = true; } catch (Exception ex) diff --git a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/OrganizationImporter.cs b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/OrganizationImporter.cs index eda285be..31a8f4af 100644 --- a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/OrganizationImporter.cs +++ b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/OrganizationImporter.cs @@ -439,12 +439,14 @@ namespace WebsitePanel.Import.Enterprise PackageContext cntx = PackageController.GetPackageContext(packageId); // organization limits + /* org.IssueWarningKB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; if (org.IssueWarningKB > 0) org.IssueWarningKB *= 1024; org.ProhibitSendKB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; if (org.ProhibitSendKB > 0) org.ProhibitSendKB *= 1024; org.ProhibitSendReceiveKB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; if (org.ProhibitSendReceiveKB > 0) org.ProhibitSendReceiveKB *= 1024; + */ PackageSettings settings = PackageController.GetPackageSettings(packageId, PackageSettings.EXCHANGE_SERVER); org.KeepDeletedItemsDays = Utils.ParseInt(settings["KeepDeletedItemsDays"], 14); @@ -933,13 +935,13 @@ namespace WebsitePanel.Import.Enterprise { return DataProvider.AddExchangeAccount(itemId, (int)accountType, accountName, displayName, primaryEmailAddress, mailEnabledPublicFolder, - mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword)); + mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword),0, string.Empty); } private static int AddOrganizationUser(int itemId, string accountName, string displayName, string email, string accountPassword) { return DataProvider.AddExchangeAccount(itemId, (int)ExchangeAccountType.User, accountName, displayName, email, false, string.Empty, - string.Empty, CryptoUtils.Encrypt(accountPassword)); + string.Empty, CryptoUtils.Encrypt(accountPassword),0 , string.Empty); } @@ -960,7 +962,7 @@ namespace WebsitePanel.Import.Enterprise mailEnabledPublicFolder, mailboxManagerActions, samAccountName, - CryptoUtils.Encrypt(accountPassword)); + CryptoUtils.Encrypt(accountPassword), 0, string.Empty); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs index 8cc0a9c6..59af6fe0 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs @@ -62,6 +62,8 @@ namespace WebsitePanel.EnterpriseServer public const int ERROR_USER_WRONG_USERNAME = -109; public const int ERROR_USER_WRONG_PASSWORD = -110; public const int ERROR_INVALID_USER_NAME = -111; + public const int ERROR_USER_ACCOUNT_NOT_ENOUGH_PERMISSIONS = -112; + public const int ERROR_USER_ACCOUNT_ROLE_NOT_ALLOWED = -113; #endregion #region Packages @@ -336,6 +338,10 @@ namespace WebsitePanel.EnterpriseServer public const int ERROR_FILE_MOVE_PATH_ALREADY_EXISTS = -3004; #endregion + #region Lync Server + public const int ERROR_LYNC_DELETE_SOME_PROBLEMS = -2806; + #endregion + public static string ToText(int code) { switch (code) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/PackageAddonInfo.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/PackageAddonInfo.cs index 5d571fbe..fd87dd84 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/PackageAddonInfo.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/PackageAddonInfo.cs @@ -43,6 +43,8 @@ namespace WebsitePanel.EnterpriseServer int statusId; DateTime purchaseDate; string comments; + string planName; + string planDescription; public PackageAddonInfo() @@ -90,5 +92,18 @@ namespace WebsitePanel.EnterpriseServer get { return this.statusId; } set { this.statusId = value; } } + + public string PlanName + { + get { return planName; } + set { planName = value; } + } + + public string PlanDescription + { + get { return planDescription; } + set { planDescription = value; } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/PackageSettings.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/PackageSettings.cs index 254bd1af..6d2ba63c 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/PackageSettings.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/PackageSettings.cs @@ -42,7 +42,6 @@ namespace WebsitePanel.EnterpriseServer public const string NAME_SERVERS = "NameServers"; public const string SHARED_SSL_SITES = "SharedSslSites"; public const string EXCHANGE_SERVER = "ExchangeServer"; - public const string EXCHANGE_HOSTED_EDITION = "ExchangeHostedEdition"; public const string HOSTED_SOLLUTION = "HostedSollution"; public const string VIRTUAL_PRIVATE_SERVERS = "VirtualPrivateServers"; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs index 0f353415..0915862a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs @@ -105,10 +105,11 @@ order by rg.groupOrder public const string EXCHANGE2007_OWAENABLED = "Exchange2007.OWAEnabled"; // OWA Enabled by default public const string EXCHANGE2007_MAPIENABLED = "Exchange2007.MAPIEnabled"; // MAPI Enabled by default public const string EXCHANGE2007_ACTIVESYNCENABLED = "Exchange2007.ActiveSyncEnabled"; // ActiveSync Enabled by default - public const string EXCHANGEHOSTEDEDITION_DOMAINS = "ExchangeHostedEdition.Domains"; - public const string EXCHANGEHOSTEDEDITION_MAILBOXES = "ExchangeHostedEdition.Mailboxes"; - public const string EXCHANGEHOSTEDEDITION_CONTACTS = "ExchangeHostedEdition.Contacts"; - public const string EXCHANGEHOSTEDEDITION_DISTRIBUTIONLISTS = "ExchangeHostedEdition.DistributionLists"; + public const string EXCHANGE2007_KEEPDELETEDITEMSDAYS = "Exchange2007.KeepDeletedItemsDays"; // Keep deleted items + public const string EXCHANGE2007_MAXRECIPIENTS = "Exchange2007.MaxRecipients"; // Max Recipients + public const string EXCHANGE2007_MAXSENDMESSAGESIZEKB = "Exchange2007.MaxSendMessageSizeKB"; // Max Send Message Size + public const string EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB = "Exchange2007.MaxReceiveMessageSizeKB"; // Max Receive Message Size + public const string EXCHANGE2007_ISCONSUMER = "Exchange2007.IsConsumer"; // Is Consumer Organization public const string MSSQL2000_DATABASES = "MsSQL2000.Databases"; // Databases public const string MSSQL2000_USERS = "MsSQL2000.Users"; // Users public const string MSSQL2000_MAXDATABASESIZE = "MsSQL2000.MaxDatabaseSize"; // Max Database Size @@ -206,7 +207,19 @@ order by rg.groupOrder public const string OCS_PresenceAllowed = "OCS.PresenceAllowed"; public const string OCS_PresenceAllowedByDefault = "OCS.PresenceAllowedByDefault"; - + + + public const string LYNC_USERS = "Lync.Users"; + public const string LYNC_FEDERATION = "Lync.Federation"; + public const string LYNC_CONFERENCING = "Lync.Conferencing"; + public const string LYNC_MAXPARTICIPANTS = "Lync.MaxParticipants"; + public const string LYNC_ALLOWVIDEO = "Lync.AllowVideo"; + public const string LYNC_ENTERPRISEVOICE = "Lync.EnterpriseVoice"; + public const string LYNC_EVUSERS = "Lync.EVUsers"; + public const string LYNC_EVNATIONAL = "Lync.EVNational"; + public const string LYNC_EVMOBILE = "Lync.EVMobile"; + public const string LYNC_EVINTERNATIONAL = "Lync.EVInternational"; + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Security/DemandAccount.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Security/DemandAccount.cs index a4807a65..720f6bd4 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Security/DemandAccount.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Security/DemandAccount.cs @@ -38,6 +38,10 @@ namespace WebsitePanel.EnterpriseServer NotDemo = 0x1, IsActive = 0x2, IsAdmin = 0x4, - IsReseller = 0x8 + IsReseller = 0x8, + IsPlatformCSR = 0x10, + IsPlatformHelpdesk = 0x20, + IsResellerCSR = 0x40, + IsResellerHelpdesk = 0x80, } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs index a4813bba..e1a569e1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs @@ -45,12 +45,12 @@ namespace WebsitePanel.EnterpriseServer public const string SharePoint = "SharePoint"; public const string HostedSharePoint = "Hosted SharePoint"; public const string Exchange = "Exchange"; - public const string ExchangeHostedEdition = "ExchangeHostedEdition"; public const string HostedOrganizations = "Hosted Organizations"; public const string HostedCRM = "Hosted CRM"; public const string VPS = "VPS"; public const string BlackBerry = "BlackBerry"; public const string OCS = "OCS"; public const string VPSForPC = "VPSForPC"; + public const string Lync = "Lync"; } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserRole.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserRole.cs index a58e4289..c83a3abb 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserRole.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserRole.cs @@ -37,6 +37,10 @@ namespace WebsitePanel.EnterpriseServer { Administrator = 1, Reseller = 2, - User = 3 + User = 3, + ResellerCSR = 4, + PlatformCSR = 5, + ResellerHelpdesk = 6, + PlatformHelpdesk = 7 } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs index 29f3df22..faacf9de 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs @@ -41,7 +41,6 @@ namespace WebsitePanel.EnterpriseServer public const string PACKAGE_SUMMARY_LETTER = "PackageSummaryLetter"; public const string PASSWORD_REMINDER_LETTER = "PasswordReminderLetter"; public const string EXCHANGE_MAILBOX_SETUP_LETTER = "ExchangeMailboxSetupLetter"; - public const string EXCHANGE_HOSTED_EDITION_ORGANIZATION_SUMMARY = "ExchangeHostedEditionOrganizationSummary"; public const string HOSTED_SOLUTION_REPORT = "HostedSoluitonReportSummaryLetter"; public const string ORGANIZATION_USER_SUMMARY_LETTER = "OrganizationUserSummaryLetter"; public const string VPS_SUMMARY_LETTER = "VpsSummaryLetter"; @@ -53,7 +52,6 @@ namespace WebsitePanel.EnterpriseServer public const string SHAREPOINT_POLICY = "SharePointPolicy"; public const string OS_POLICY = "OsPolicy"; public const string EXCHANGE_POLICY = "ExchangePolicy"; - public const string EXCHANGE_HOSTED_EDITION_POLICY = "ExchangeHostedEditionPolicy"; public const string WEBSITEPANEL_POLICY = "WebsitePanelPolicy"; public const string VPS_POLICY = "VpsPolicy"; public const string DISPLAY_PREFS = "DisplayPreferences"; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeHostedEditionProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeHostedEditionProxy.cs deleted file mode 100644 index e8b723c4..00000000 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeHostedEditionProxy.cs +++ /dev/null @@ -1,950 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4952 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -// -// This source code was auto-generated by wsdl, Version=2.0.50727.42. -// -namespace WebsitePanel.EnterpriseServer { - using System.Xml.Serialization; - using System.Web.Services; - using System.ComponentModel; - using System.Web.Services.Protocols; - using System; - using System.Diagnostics; - - using WebsitePanel.Providers; - using WebsitePanel.Providers.Common; - using WebsitePanel.Providers.ExchangeHostedEdition; - using WebsitePanel.Providers.ResultObjects; - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name="esExchangeHostedEditionSoap", Namespace="http://smbsaas/websitepanel/enterpriseserver")] - [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] - public partial class esExchangeHostedEdition : Microsoft.Web.Services3.WebServicesClientProtocol { - - private System.Threading.SendOrPostCallback GetOrganizationsOperationCompleted; - - private System.Threading.SendOrPostCallback CreateExchangeOrganizationOperationCompleted; - - private System.Threading.SendOrPostCallback GetExchangeOrganizationDetailsOperationCompleted; - - private System.Threading.SendOrPostCallback GetExchangeOrganizationDomainsOperationCompleted; - - private System.Threading.SendOrPostCallback GetExchangeOrganizationSummaryOperationCompleted; - - private System.Threading.SendOrPostCallback SendExchangeOrganizationSummaryOperationCompleted; - - private System.Threading.SendOrPostCallback AddExchangeOrganizationDomainOperationCompleted; - - private System.Threading.SendOrPostCallback DeleteExchangeOrganizationDomainOperationCompleted; - - private System.Threading.SendOrPostCallback UpdateExchangeOrganizationQuotasOperationCompleted; - - private System.Threading.SendOrPostCallback UpdateExchangeOrganizationCatchAllAddressOperationCompleted; - - private System.Threading.SendOrPostCallback UpdateExchangeOrganizationServicePlanOperationCompleted; - - private System.Threading.SendOrPostCallback DeleteExchangeOrganizationOperationCompleted; - - /// - public esExchangeHostedEdition() { - this.Url = "http://localhost:9002/esExchangeHostedEdition.asmx"; - } - - /// - public event GetOrganizationsCompletedEventHandler GetOrganizationsCompleted; - - /// - public event CreateExchangeOrganizationCompletedEventHandler CreateExchangeOrganizationCompleted; - - /// - public event GetExchangeOrganizationDetailsCompletedEventHandler GetExchangeOrganizationDetailsCompleted; - - /// - public event GetExchangeOrganizationDomainsCompletedEventHandler GetExchangeOrganizationDomainsCompleted; - - /// - public event GetExchangeOrganizationSummaryCompletedEventHandler GetExchangeOrganizationSummaryCompleted; - - /// - public event SendExchangeOrganizationSummaryCompletedEventHandler SendExchangeOrganizationSummaryCompleted; - - /// - public event AddExchangeOrganizationDomainCompletedEventHandler AddExchangeOrganizationDomainCompleted; - - /// - public event DeleteExchangeOrganizationDomainCompletedEventHandler DeleteExchangeOrganizationDomainCompleted; - - /// - public event UpdateExchangeOrganizationQuotasCompletedEventHandler UpdateExchangeOrganizationQuotasCompleted; - - /// - public event UpdateExchangeOrganizationCatchAllAddressCompletedEventHandler UpdateExchangeOrganizationCatchAllAddressCompleted; - - /// - public event UpdateExchangeOrganizationServicePlanCompletedEventHandler UpdateExchangeOrganizationServicePlanCompleted; - - /// - public event DeleteExchangeOrganizationCompletedEventHandler DeleteExchangeOrganizationCompleted; - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetOrganizations", 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 ExchangeOrganization[] GetOrganizations(int packageId) { - object[] results = this.Invoke("GetOrganizations", new object[] { - packageId}); - return ((ExchangeOrganization[])(results[0])); - } - - /// - public System.IAsyncResult BeginGetOrganizations(int packageId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetOrganizations", new object[] { - packageId}, callback, asyncState); - } - - /// - public ExchangeOrganization[] EndGetOrganizations(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeOrganization[])(results[0])); - } - - /// - public void GetOrganizationsAsync(int packageId) { - this.GetOrganizationsAsync(packageId, null); - } - - /// - public void GetOrganizationsAsync(int packageId, object userState) { - if ((this.GetOrganizationsOperationCompleted == null)) { - this.GetOrganizationsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationsOperationCompleted); - } - this.InvokeAsync("GetOrganizations", new object[] { - packageId}, this.GetOrganizationsOperationCompleted, userState); - } - - private void OnGetOrganizationsOperationCompleted(object arg) { - if ((this.GetOrganizationsCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetOrganizationsCompleted(this, new GetOrganizationsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CreateExchangeOrganization", 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 IntResult CreateExchangeOrganization(int packageId, string organizationId, string domain, string adminName, string adminEmail, string adminPassword) { - object[] results = this.Invoke("CreateExchangeOrganization", new object[] { - packageId, - organizationId, - domain, - adminName, - adminEmail, - adminPassword}); - return ((IntResult)(results[0])); - } - - /// - public System.IAsyncResult BeginCreateExchangeOrganization(int packageId, string organizationId, string domain, string adminName, string adminEmail, string adminPassword, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("CreateExchangeOrganization", new object[] { - packageId, - organizationId, - domain, - adminName, - adminEmail, - adminPassword}, callback, asyncState); - } - - /// - public IntResult EndCreateExchangeOrganization(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((IntResult)(results[0])); - } - - /// - public void CreateExchangeOrganizationAsync(int packageId, string organizationId, string domain, string adminName, string adminEmail, string adminPassword) { - this.CreateExchangeOrganizationAsync(packageId, organizationId, domain, adminName, adminEmail, adminPassword, null); - } - - /// - public void CreateExchangeOrganizationAsync(int packageId, string organizationId, string domain, string adminName, string adminEmail, string adminPassword, object userState) { - if ((this.CreateExchangeOrganizationOperationCompleted == null)) { - this.CreateExchangeOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateExchangeOrganizationOperationCompleted); - } - this.InvokeAsync("CreateExchangeOrganization", new object[] { - packageId, - organizationId, - domain, - adminName, - adminEmail, - adminPassword}, this.CreateExchangeOrganizationOperationCompleted, userState); - } - - private void OnCreateExchangeOrganizationOperationCompleted(object arg) { - if ((this.CreateExchangeOrganizationCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.CreateExchangeOrganizationCompleted(this, new CreateExchangeOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetExchangeOrganizationDetails", 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 ExchangeOrganization GetExchangeOrganizationDetails(int itemId) { - object[] results = this.Invoke("GetExchangeOrganizationDetails", new object[] { - itemId}); - return ((ExchangeOrganization)(results[0])); - } - - /// - public System.IAsyncResult BeginGetExchangeOrganizationDetails(int itemId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetExchangeOrganizationDetails", new object[] { - itemId}, callback, asyncState); - } - - /// - public ExchangeOrganization EndGetExchangeOrganizationDetails(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeOrganization)(results[0])); - } - - /// - public void GetExchangeOrganizationDetailsAsync(int itemId) { - this.GetExchangeOrganizationDetailsAsync(itemId, null); - } - - /// - public void GetExchangeOrganizationDetailsAsync(int itemId, object userState) { - if ((this.GetExchangeOrganizationDetailsOperationCompleted == null)) { - this.GetExchangeOrganizationDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExchangeOrganizationDetailsOperationCompleted); - } - this.InvokeAsync("GetExchangeOrganizationDetails", new object[] { - itemId}, this.GetExchangeOrganizationDetailsOperationCompleted, userState); - } - - private void OnGetExchangeOrganizationDetailsOperationCompleted(object arg) { - if ((this.GetExchangeOrganizationDetailsCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetExchangeOrganizationDetailsCompleted(this, new GetExchangeOrganizationDetailsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetExchangeOrganizationDomains", 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 ExchangeOrganizationDomain[] GetExchangeOrganizationDomains(int itemId) { - object[] results = this.Invoke("GetExchangeOrganizationDomains", new object[] { - itemId}); - return ((ExchangeOrganizationDomain[])(results[0])); - } - - /// - public System.IAsyncResult BeginGetExchangeOrganizationDomains(int itemId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetExchangeOrganizationDomains", new object[] { - itemId}, callback, asyncState); - } - - /// - public ExchangeOrganizationDomain[] EndGetExchangeOrganizationDomains(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeOrganizationDomain[])(results[0])); - } - - /// - public void GetExchangeOrganizationDomainsAsync(int itemId) { - this.GetExchangeOrganizationDomainsAsync(itemId, null); - } - - /// - public void GetExchangeOrganizationDomainsAsync(int itemId, object userState) { - if ((this.GetExchangeOrganizationDomainsOperationCompleted == null)) { - this.GetExchangeOrganizationDomainsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExchangeOrganizationDomainsOperationCompleted); - } - this.InvokeAsync("GetExchangeOrganizationDomains", new object[] { - itemId}, this.GetExchangeOrganizationDomainsOperationCompleted, userState); - } - - private void OnGetExchangeOrganizationDomainsOperationCompleted(object arg) { - if ((this.GetExchangeOrganizationDomainsCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetExchangeOrganizationDomainsCompleted(this, new GetExchangeOrganizationDomainsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetExchangeOrganizationSummary", 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 string GetExchangeOrganizationSummary(int itemId) { - object[] results = this.Invoke("GetExchangeOrganizationSummary", new object[] { - itemId}); - return ((string)(results[0])); - } - - /// - public System.IAsyncResult BeginGetExchangeOrganizationSummary(int itemId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetExchangeOrganizationSummary", new object[] { - itemId}, callback, asyncState); - } - - /// - public string EndGetExchangeOrganizationSummary(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((string)(results[0])); - } - - /// - public void GetExchangeOrganizationSummaryAsync(int itemId) { - this.GetExchangeOrganizationSummaryAsync(itemId, null); - } - - /// - public void GetExchangeOrganizationSummaryAsync(int itemId, object userState) { - if ((this.GetExchangeOrganizationSummaryOperationCompleted == null)) { - this.GetExchangeOrganizationSummaryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExchangeOrganizationSummaryOperationCompleted); - } - this.InvokeAsync("GetExchangeOrganizationSummary", new object[] { - itemId}, this.GetExchangeOrganizationSummaryOperationCompleted, userState); - } - - private void OnGetExchangeOrganizationSummaryOperationCompleted(object arg) { - if ((this.GetExchangeOrganizationSummaryCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetExchangeOrganizationSummaryCompleted(this, new GetExchangeOrganizationSummaryCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SendExchangeOrganizationSummary", 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 SendExchangeOrganizationSummary(int itemId, string toEmail) { - object[] results = this.Invoke("SendExchangeOrganizationSummary", new object[] { - itemId, - toEmail}); - return ((ResultObject)(results[0])); - } - - /// - public System.IAsyncResult BeginSendExchangeOrganizationSummary(int itemId, string toEmail, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("SendExchangeOrganizationSummary", new object[] { - itemId, - toEmail}, callback, asyncState); - } - - /// - public ResultObject EndSendExchangeOrganizationSummary(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ResultObject)(results[0])); - } - - /// - public void SendExchangeOrganizationSummaryAsync(int itemId, string toEmail) { - this.SendExchangeOrganizationSummaryAsync(itemId, toEmail, null); - } - - /// - public void SendExchangeOrganizationSummaryAsync(int itemId, string toEmail, object userState) { - if ((this.SendExchangeOrganizationSummaryOperationCompleted == null)) { - this.SendExchangeOrganizationSummaryOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendExchangeOrganizationSummaryOperationCompleted); - } - this.InvokeAsync("SendExchangeOrganizationSummary", new object[] { - itemId, - toEmail}, this.SendExchangeOrganizationSummaryOperationCompleted, userState); - } - - private void OnSendExchangeOrganizationSummaryOperationCompleted(object arg) { - if ((this.SendExchangeOrganizationSummaryCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SendExchangeOrganizationSummaryCompleted(this, new SendExchangeOrganizationSummaryCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddExchangeOrganizationDomain", 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 AddExchangeOrganizationDomain(int itemId, string domain) { - object[] results = this.Invoke("AddExchangeOrganizationDomain", new object[] { - itemId, - domain}); - return ((ResultObject)(results[0])); - } - - /// - public System.IAsyncResult BeginAddExchangeOrganizationDomain(int itemId, string domain, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("AddExchangeOrganizationDomain", new object[] { - itemId, - domain}, callback, asyncState); - } - - /// - public ResultObject EndAddExchangeOrganizationDomain(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ResultObject)(results[0])); - } - - /// - public void AddExchangeOrganizationDomainAsync(int itemId, string domain) { - this.AddExchangeOrganizationDomainAsync(itemId, domain, null); - } - - /// - public void AddExchangeOrganizationDomainAsync(int itemId, string domain, object userState) { - if ((this.AddExchangeOrganizationDomainOperationCompleted == null)) { - this.AddExchangeOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddExchangeOrganizationDomainOperationCompleted); - } - this.InvokeAsync("AddExchangeOrganizationDomain", new object[] { - itemId, - domain}, this.AddExchangeOrganizationDomainOperationCompleted, userState); - } - - private void OnAddExchangeOrganizationDomainOperationCompleted(object arg) { - if ((this.AddExchangeOrganizationDomainCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.AddExchangeOrganizationDomainCompleted(this, new AddExchangeOrganizationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeleteExchangeOrganizationDomain", 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 DeleteExchangeOrganizationDomain(int itemId, string domain) { - object[] results = this.Invoke("DeleteExchangeOrganizationDomain", new object[] { - itemId, - domain}); - return ((ResultObject)(results[0])); - } - - /// - public System.IAsyncResult BeginDeleteExchangeOrganizationDomain(int itemId, string domain, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("DeleteExchangeOrganizationDomain", new object[] { - itemId, - domain}, callback, asyncState); - } - - /// - public ResultObject EndDeleteExchangeOrganizationDomain(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ResultObject)(results[0])); - } - - /// - public void DeleteExchangeOrganizationDomainAsync(int itemId, string domain) { - this.DeleteExchangeOrganizationDomainAsync(itemId, domain, null); - } - - /// - public void DeleteExchangeOrganizationDomainAsync(int itemId, string domain, object userState) { - if ((this.DeleteExchangeOrganizationDomainOperationCompleted == null)) { - this.DeleteExchangeOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteExchangeOrganizationDomainOperationCompleted); - } - this.InvokeAsync("DeleteExchangeOrganizationDomain", new object[] { - itemId, - domain}, this.DeleteExchangeOrganizationDomainOperationCompleted, userState); - } - - private void OnDeleteExchangeOrganizationDomainOperationCompleted(object arg) { - if ((this.DeleteExchangeOrganizationDomainCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.DeleteExchangeOrganizationDomainCompleted(this, new DeleteExchangeOrganizationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/UpdateExchangeOrganizationQuotas", 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 UpdateExchangeOrganizationQuotas(int itemId, int mailboxesNumber, int contactsNumber, int distributionListsNumber) { - object[] results = this.Invoke("UpdateExchangeOrganizationQuotas", new object[] { - itemId, - mailboxesNumber, - contactsNumber, - distributionListsNumber}); - return ((ResultObject)(results[0])); - } - - /// - public System.IAsyncResult BeginUpdateExchangeOrganizationQuotas(int itemId, int mailboxesNumber, int contactsNumber, int distributionListsNumber, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("UpdateExchangeOrganizationQuotas", new object[] { - itemId, - mailboxesNumber, - contactsNumber, - distributionListsNumber}, callback, asyncState); - } - - /// - public ResultObject EndUpdateExchangeOrganizationQuotas(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ResultObject)(results[0])); - } - - /// - public void UpdateExchangeOrganizationQuotasAsync(int itemId, int mailboxesNumber, int contactsNumber, int distributionListsNumber) { - this.UpdateExchangeOrganizationQuotasAsync(itemId, mailboxesNumber, contactsNumber, distributionListsNumber, null); - } - - /// - public void UpdateExchangeOrganizationQuotasAsync(int itemId, int mailboxesNumber, int contactsNumber, int distributionListsNumber, object userState) { - if ((this.UpdateExchangeOrganizationQuotasOperationCompleted == null)) { - this.UpdateExchangeOrganizationQuotasOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateExchangeOrganizationQuotasOperationCompleted); - } - this.InvokeAsync("UpdateExchangeOrganizationQuotas", new object[] { - itemId, - mailboxesNumber, - contactsNumber, - distributionListsNumber}, this.UpdateExchangeOrganizationQuotasOperationCompleted, userState); - } - - private void OnUpdateExchangeOrganizationQuotasOperationCompleted(object arg) { - if ((this.UpdateExchangeOrganizationQuotasCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.UpdateExchangeOrganizationQuotasCompleted(this, new UpdateExchangeOrganizationQuotasCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/UpdateExchangeOrganizationCatchAllAd" + - "dress", 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 UpdateExchangeOrganizationCatchAllAddress(int itemId, string catchAllEmail) { - object[] results = this.Invoke("UpdateExchangeOrganizationCatchAllAddress", new object[] { - itemId, - catchAllEmail}); - return ((ResultObject)(results[0])); - } - - /// - public System.IAsyncResult BeginUpdateExchangeOrganizationCatchAllAddress(int itemId, string catchAllEmail, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("UpdateExchangeOrganizationCatchAllAddress", new object[] { - itemId, - catchAllEmail}, callback, asyncState); - } - - /// - public ResultObject EndUpdateExchangeOrganizationCatchAllAddress(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ResultObject)(results[0])); - } - - /// - public void UpdateExchangeOrganizationCatchAllAddressAsync(int itemId, string catchAllEmail) { - this.UpdateExchangeOrganizationCatchAllAddressAsync(itemId, catchAllEmail, null); - } - - /// - public void UpdateExchangeOrganizationCatchAllAddressAsync(int itemId, string catchAllEmail, object userState) { - if ((this.UpdateExchangeOrganizationCatchAllAddressOperationCompleted == null)) { - this.UpdateExchangeOrganizationCatchAllAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateExchangeOrganizationCatchAllAddressOperationCompleted); - } - this.InvokeAsync("UpdateExchangeOrganizationCatchAllAddress", new object[] { - itemId, - catchAllEmail}, this.UpdateExchangeOrganizationCatchAllAddressOperationCompleted, userState); - } - - private void OnUpdateExchangeOrganizationCatchAllAddressOperationCompleted(object arg) { - if ((this.UpdateExchangeOrganizationCatchAllAddressCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.UpdateExchangeOrganizationCatchAllAddressCompleted(this, new UpdateExchangeOrganizationCatchAllAddressCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/UpdateExchangeOrganizationServicePla" + - "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 UpdateExchangeOrganizationServicePlan(int itemId, int newServiceId) { - object[] results = this.Invoke("UpdateExchangeOrganizationServicePlan", new object[] { - itemId, - newServiceId}); - return ((ResultObject)(results[0])); - } - - /// - public System.IAsyncResult BeginUpdateExchangeOrganizationServicePlan(int itemId, int newServiceId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("UpdateExchangeOrganizationServicePlan", new object[] { - itemId, - newServiceId}, callback, asyncState); - } - - /// - public ResultObject EndUpdateExchangeOrganizationServicePlan(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ResultObject)(results[0])); - } - - /// - public void UpdateExchangeOrganizationServicePlanAsync(int itemId, int newServiceId) { - this.UpdateExchangeOrganizationServicePlanAsync(itemId, newServiceId, null); - } - - /// - public void UpdateExchangeOrganizationServicePlanAsync(int itemId, int newServiceId, object userState) { - if ((this.UpdateExchangeOrganizationServicePlanOperationCompleted == null)) { - this.UpdateExchangeOrganizationServicePlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateExchangeOrganizationServicePlanOperationCompleted); - } - this.InvokeAsync("UpdateExchangeOrganizationServicePlan", new object[] { - itemId, - newServiceId}, this.UpdateExchangeOrganizationServicePlanOperationCompleted, userState); - } - - private void OnUpdateExchangeOrganizationServicePlanOperationCompleted(object arg) { - if ((this.UpdateExchangeOrganizationServicePlanCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.UpdateExchangeOrganizationServicePlanCompleted(this, new UpdateExchangeOrganizationServicePlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeleteExchangeOrganization", 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 DeleteExchangeOrganization(int itemId) { - object[] results = this.Invoke("DeleteExchangeOrganization", new object[] { - itemId}); - return ((ResultObject)(results[0])); - } - - /// - public System.IAsyncResult BeginDeleteExchangeOrganization(int itemId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("DeleteExchangeOrganization", new object[] { - itemId}, callback, asyncState); - } - - /// - public ResultObject EndDeleteExchangeOrganization(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ResultObject)(results[0])); - } - - /// - public void DeleteExchangeOrganizationAsync(int itemId) { - this.DeleteExchangeOrganizationAsync(itemId, null); - } - - /// - public void DeleteExchangeOrganizationAsync(int itemId, object userState) { - if ((this.DeleteExchangeOrganizationOperationCompleted == null)) { - this.DeleteExchangeOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteExchangeOrganizationOperationCompleted); - } - this.InvokeAsync("DeleteExchangeOrganization", new object[] { - itemId}, this.DeleteExchangeOrganizationOperationCompleted, userState); - } - - private void OnDeleteExchangeOrganizationOperationCompleted(object arg) { - if ((this.DeleteExchangeOrganizationCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.DeleteExchangeOrganizationCompleted(this, new DeleteExchangeOrganizationCompletedEventArgs(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.42")] - public delegate void GetOrganizationsCompletedEventHandler(object sender, GetOrganizationsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetOrganizationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeOrganization[] Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeOrganization[])(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void CreateExchangeOrganizationCompletedEventHandler(object sender, CreateExchangeOrganizationCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateExchangeOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal CreateExchangeOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public IntResult Result { - get { - this.RaiseExceptionIfNecessary(); - return ((IntResult)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetExchangeOrganizationDetailsCompletedEventHandler(object sender, GetExchangeOrganizationDetailsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetExchangeOrganizationDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetExchangeOrganizationDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeOrganization Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeOrganization)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetExchangeOrganizationDomainsCompletedEventHandler(object sender, GetExchangeOrganizationDomainsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetExchangeOrganizationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetExchangeOrganizationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeOrganizationDomain[] Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeOrganizationDomain[])(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetExchangeOrganizationSummaryCompletedEventHandler(object sender, GetExchangeOrganizationSummaryCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetExchangeOrganizationSummaryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetExchangeOrganizationSummaryCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public string Result { - get { - this.RaiseExceptionIfNecessary(); - return ((string)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void SendExchangeOrganizationSummaryCompletedEventHandler(object sender, SendExchangeOrganizationSummaryCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SendExchangeOrganizationSummaryCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal SendExchangeOrganizationSummaryCompletedEventArgs(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.42")] - public delegate void AddExchangeOrganizationDomainCompletedEventHandler(object sender, AddExchangeOrganizationDomainCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddExchangeOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal AddExchangeOrganizationDomainCompletedEventArgs(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.42")] - public delegate void DeleteExchangeOrganizationDomainCompletedEventHandler(object sender, DeleteExchangeOrganizationDomainCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteExchangeOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal DeleteExchangeOrganizationDomainCompletedEventArgs(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.42")] - public delegate void UpdateExchangeOrganizationQuotasCompletedEventHandler(object sender, UpdateExchangeOrganizationQuotasCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class UpdateExchangeOrganizationQuotasCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal UpdateExchangeOrganizationQuotasCompletedEventArgs(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.42")] - public delegate void UpdateExchangeOrganizationCatchAllAddressCompletedEventHandler(object sender, UpdateExchangeOrganizationCatchAllAddressCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class UpdateExchangeOrganizationCatchAllAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal UpdateExchangeOrganizationCatchAllAddressCompletedEventArgs(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.42")] - public delegate void UpdateExchangeOrganizationServicePlanCompletedEventHandler(object sender, UpdateExchangeOrganizationServicePlanCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class UpdateExchangeOrganizationServicePlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal UpdateExchangeOrganizationServicePlanCompletedEventArgs(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.42")] - public delegate void DeleteExchangeOrganizationCompletedEventHandler(object sender, DeleteExchangeOrganizationCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteExchangeOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal DeleteExchangeOrganizationCompletedEventArgs(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])); - } - } - } -} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs index 05e81557..fa2d5fac 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -39,8 +11,7 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.42. // -namespace WebsitePanel.EnterpriseServer -{ +namespace WebsitePanel.EnterpriseServer { using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; @@ -53,38 +24,17 @@ namespace WebsitePanel.EnterpriseServer using WebsitePanel.Providers.Common; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.ResultObjects; - - + + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="esExchangeServerSoap", Namespace="http://smbsaas/websitepanel/enterpriseserver")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseStatistics))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] public partial class esExchangeServer : Microsoft.Web.Services3.WebServicesClientProtocol { - private System.Threading.SendOrPostCallback GetPublicFolderMailFlowSettingsOperationCompleted; - - private System.Threading.SendOrPostCallback SetPublicFolderMailFlowSettingsOperationCompleted; - - private System.Threading.SendOrPostCallback GetPublicFolderEmailAddressesOperationCompleted; - - private System.Threading.SendOrPostCallback AddPublicFolderEmailAddressOperationCompleted; - - private System.Threading.SendOrPostCallback SetPublicFolderPrimaryEmailAddressOperationCompleted; - - private System.Threading.SendOrPostCallback DeletePublicFolderEmailAddressesOperationCompleted; - - private System.Threading.SendOrPostCallback GetMobileDevicesOperationCompleted; - - private System.Threading.SendOrPostCallback GetMobileDeviceOperationCompleted; - - private System.Threading.SendOrPostCallback WipeDataFromDeviceOperationCompleted; - - private System.Threading.SendOrPostCallback CancelRemoteWipeRequestOperationCompleted; - - private System.Threading.SendOrPostCallback RemoveDeviceOperationCompleted; - private System.Threading.SendOrPostCallback GetRawExchangeOrganizationsPagedOperationCompleted; private System.Threading.SendOrPostCallback GetExchangeOrganizationsPagedOperationCompleted; @@ -103,7 +53,7 @@ namespace WebsitePanel.EnterpriseServer private System.Threading.SendOrPostCallback GetMailboxesStatisticsOperationCompleted; - private System.Threading.SendOrPostCallback GetPublicFoldersStatisticsOperationCompleted; + private System.Threading.SendOrPostCallback GetMailboxStatisticsOperationCompleted; private System.Threading.SendOrPostCallback CalculateOrganizationDiskspaceOperationCompleted; @@ -119,6 +69,8 @@ namespace WebsitePanel.EnterpriseServer private System.Threading.SendOrPostCallback GetAccountsOperationCompleted; + private System.Threading.SendOrPostCallback GetExchangeAccountByMailboxPlanIdOperationCompleted; + private System.Threading.SendOrPostCallback SearchAccountsOperationCompleted; private System.Threading.SendOrPostCallback GetAccountOperationCompleted; @@ -149,9 +101,7 @@ namespace WebsitePanel.EnterpriseServer private System.Threading.SendOrPostCallback SetMailboxMailFlowSettingsOperationCompleted; - private System.Threading.SendOrPostCallback GetMailboxAdvancedSettingsOperationCompleted; - - private System.Threading.SendOrPostCallback SetMailboxAdvancedSettingsOperationCompleted; + private System.Threading.SendOrPostCallback SetExchangeMailboxPlanOperationCompleted; private System.Threading.SendOrPostCallback GetMailboxSetupInstructionsOperationCompleted; @@ -199,6 +149,26 @@ namespace WebsitePanel.EnterpriseServer private System.Threading.SendOrPostCallback GetDistributionListPermissionsOperationCompleted; + private System.Threading.SendOrPostCallback GetMobileDevicesOperationCompleted; + + private System.Threading.SendOrPostCallback GetMobileDeviceOperationCompleted; + + private System.Threading.SendOrPostCallback WipeDataFromDeviceOperationCompleted; + + private System.Threading.SendOrPostCallback CancelRemoteWipeRequestOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveDeviceOperationCompleted; + + private System.Threading.SendOrPostCallback GetExchangeMailboxPlansOperationCompleted; + + private System.Threading.SendOrPostCallback GetExchangeMailboxPlanOperationCompleted; + + private System.Threading.SendOrPostCallback AddExchangeMailboxPlanOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteExchangeMailboxPlanOperationCompleted; + + private System.Threading.SendOrPostCallback SetOrganizationDefaultExchangeMailboxPlanOperationCompleted; + private System.Threading.SendOrPostCallback CreatePublicFolderOperationCompleted; private System.Threading.SendOrPostCallback DeletePublicFoldersOperationCompleted; @@ -213,44 +183,23 @@ namespace WebsitePanel.EnterpriseServer private System.Threading.SendOrPostCallback SetPublicFolderGeneralSettingsOperationCompleted; + private System.Threading.SendOrPostCallback GetPublicFolderMailFlowSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback SetPublicFolderMailFlowSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback GetPublicFolderEmailAddressesOperationCompleted; + + private System.Threading.SendOrPostCallback AddPublicFolderEmailAddressOperationCompleted; + + private System.Threading.SendOrPostCallback SetPublicFolderPrimaryEmailAddressOperationCompleted; + + private System.Threading.SendOrPostCallback DeletePublicFolderEmailAddressesOperationCompleted; + /// public esExchangeServer() { this.Url = "http://localhost:9005/esExchangeServer.asmx"; } - /// - public event GetPublicFolderMailFlowSettingsCompletedEventHandler GetPublicFolderMailFlowSettingsCompleted; - - /// - public event SetPublicFolderMailFlowSettingsCompletedEventHandler SetPublicFolderMailFlowSettingsCompleted; - - /// - public event GetPublicFolderEmailAddressesCompletedEventHandler GetPublicFolderEmailAddressesCompleted; - - /// - public event AddPublicFolderEmailAddressCompletedEventHandler AddPublicFolderEmailAddressCompleted; - - /// - public event SetPublicFolderPrimaryEmailAddressCompletedEventHandler SetPublicFolderPrimaryEmailAddressCompleted; - - /// - public event DeletePublicFolderEmailAddressesCompletedEventHandler DeletePublicFolderEmailAddressesCompleted; - - /// - public event GetMobileDevicesCompletedEventHandler GetMobileDevicesCompleted; - - /// - public event GetMobileDeviceCompletedEventHandler GetMobileDeviceCompleted; - - /// - public event WipeDataFromDeviceCompletedEventHandler WipeDataFromDeviceCompleted; - - /// - public event CancelRemoteWipeRequestCompletedEventHandler CancelRemoteWipeRequestCompleted; - - /// - public event RemoveDeviceCompletedEventHandler RemoveDeviceCompleted; - /// public event GetRawExchangeOrganizationsPagedCompletedEventHandler GetRawExchangeOrganizationsPagedCompleted; @@ -279,7 +228,7 @@ namespace WebsitePanel.EnterpriseServer public event GetMailboxesStatisticsCompletedEventHandler GetMailboxesStatisticsCompleted; /// - public event GetPublicFoldersStatisticsCompletedEventHandler GetPublicFoldersStatisticsCompleted; + public event GetMailboxStatisticsCompletedEventHandler GetMailboxStatisticsCompleted; /// public event CalculateOrganizationDiskspaceCompletedEventHandler CalculateOrganizationDiskspaceCompleted; @@ -302,6 +251,9 @@ namespace WebsitePanel.EnterpriseServer /// public event GetAccountsCompletedEventHandler GetAccountsCompleted; + /// + public event GetExchangeAccountByMailboxPlanIdCompletedEventHandler GetExchangeAccountByMailboxPlanIdCompleted; + /// public event SearchAccountsCompletedEventHandler SearchAccountsCompleted; @@ -348,10 +300,7 @@ namespace WebsitePanel.EnterpriseServer public event SetMailboxMailFlowSettingsCompletedEventHandler SetMailboxMailFlowSettingsCompleted; /// - public event GetMailboxAdvancedSettingsCompletedEventHandler GetMailboxAdvancedSettingsCompleted; - - /// - public event SetMailboxAdvancedSettingsCompletedEventHandler SetMailboxAdvancedSettingsCompleted; + public event SetExchangeMailboxPlanCompletedEventHandler SetExchangeMailboxPlanCompleted; /// public event GetMailboxSetupInstructionsCompletedEventHandler GetMailboxSetupInstructionsCompleted; @@ -422,6 +371,36 @@ namespace WebsitePanel.EnterpriseServer /// public event GetDistributionListPermissionsCompletedEventHandler GetDistributionListPermissionsCompleted; + /// + public event GetMobileDevicesCompletedEventHandler GetMobileDevicesCompleted; + + /// + public event GetMobileDeviceCompletedEventHandler GetMobileDeviceCompleted; + + /// + public event WipeDataFromDeviceCompletedEventHandler WipeDataFromDeviceCompleted; + + /// + public event CancelRemoteWipeRequestCompletedEventHandler CancelRemoteWipeRequestCompleted; + + /// + public event RemoveDeviceCompletedEventHandler RemoveDeviceCompleted; + + /// + public event GetExchangeMailboxPlansCompletedEventHandler GetExchangeMailboxPlansCompleted; + + /// + public event GetExchangeMailboxPlanCompletedEventHandler GetExchangeMailboxPlanCompleted; + + /// + public event AddExchangeMailboxPlanCompletedEventHandler AddExchangeMailboxPlanCompleted; + + /// + public event DeleteExchangeMailboxPlanCompletedEventHandler DeleteExchangeMailboxPlanCompleted; + + /// + public event SetOrganizationDefaultExchangeMailboxPlanCompletedEventHandler SetOrganizationDefaultExchangeMailboxPlanCompleted; + /// public event CreatePublicFolderCompletedEventHandler CreatePublicFolderCompleted; @@ -444,500 +423,22 @@ namespace WebsitePanel.EnterpriseServer public event SetPublicFolderGeneralSettingsCompletedEventHandler SetPublicFolderGeneralSettingsCompleted; /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPublicFolderMailFlowSettings", 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 ExchangePublicFolder GetPublicFolderMailFlowSettings(int itemId, int accountId) { - object[] results = this.Invoke("GetPublicFolderMailFlowSettings", new object[] { - itemId, - accountId}); - return ((ExchangePublicFolder)(results[0])); - } + public event GetPublicFolderMailFlowSettingsCompletedEventHandler GetPublicFolderMailFlowSettingsCompleted; /// - public System.IAsyncResult BeginGetPublicFolderMailFlowSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetPublicFolderMailFlowSettings", new object[] { - itemId, - accountId}, callback, asyncState); - } + public event SetPublicFolderMailFlowSettingsCompletedEventHandler SetPublicFolderMailFlowSettingsCompleted; /// - public ExchangePublicFolder EndGetPublicFolderMailFlowSettings(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangePublicFolder)(results[0])); - } + public event GetPublicFolderEmailAddressesCompletedEventHandler GetPublicFolderEmailAddressesCompleted; /// - public void GetPublicFolderMailFlowSettingsAsync(int itemId, int accountId) { - this.GetPublicFolderMailFlowSettingsAsync(itemId, accountId, null); - } + public event AddPublicFolderEmailAddressCompletedEventHandler AddPublicFolderEmailAddressCompleted; /// - public void GetPublicFolderMailFlowSettingsAsync(int itemId, int accountId, object userState) { - if ((this.GetPublicFolderMailFlowSettingsOperationCompleted == null)) { - this.GetPublicFolderMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPublicFolderMailFlowSettingsOperationCompleted); - } - this.InvokeAsync("GetPublicFolderMailFlowSettings", new object[] { - itemId, - accountId}, this.GetPublicFolderMailFlowSettingsOperationCompleted, userState); - } - - private void OnGetPublicFolderMailFlowSettingsOperationCompleted(object arg) { - if ((this.GetPublicFolderMailFlowSettingsCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetPublicFolderMailFlowSettingsCompleted(this, new GetPublicFolderMailFlowSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } + public event SetPublicFolderPrimaryEmailAddressCompletedEventHandler SetPublicFolderPrimaryEmailAddressCompleted; /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetPublicFolderMailFlowSettings", 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 SetPublicFolderMailFlowSettings(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { - object[] results = this.Invoke("SetPublicFolderMailFlowSettings", new object[] { - itemId, - accountId, - acceptAccounts, - rejectAccounts, - requireSenderAuthentication}); - return ((int)(results[0])); - } - - /// - public System.IAsyncResult BeginSetPublicFolderMailFlowSettings(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("SetPublicFolderMailFlowSettings", new object[] { - itemId, - accountId, - acceptAccounts, - rejectAccounts, - requireSenderAuthentication}, callback, asyncState); - } - - /// - public int EndSetPublicFolderMailFlowSettings(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((int)(results[0])); - } - - /// - public void SetPublicFolderMailFlowSettingsAsync(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { - this.SetPublicFolderMailFlowSettingsAsync(itemId, accountId, acceptAccounts, rejectAccounts, requireSenderAuthentication, null); - } - - /// - public void SetPublicFolderMailFlowSettingsAsync(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, object userState) { - if ((this.SetPublicFolderMailFlowSettingsOperationCompleted == null)) { - this.SetPublicFolderMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetPublicFolderMailFlowSettingsOperationCompleted); - } - this.InvokeAsync("SetPublicFolderMailFlowSettings", new object[] { - itemId, - accountId, - acceptAccounts, - rejectAccounts, - requireSenderAuthentication}, this.SetPublicFolderMailFlowSettingsOperationCompleted, userState); - } - - private void OnSetPublicFolderMailFlowSettingsOperationCompleted(object arg) { - if ((this.SetPublicFolderMailFlowSettingsCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SetPublicFolderMailFlowSettingsCompleted(this, new SetPublicFolderMailFlowSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPublicFolderEmailAddresses", 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 ExchangeEmailAddress[] GetPublicFolderEmailAddresses(int itemId, int accountId) { - object[] results = this.Invoke("GetPublicFolderEmailAddresses", new object[] { - itemId, - accountId}); - return ((ExchangeEmailAddress[])(results[0])); - } - - /// - public System.IAsyncResult BeginGetPublicFolderEmailAddresses(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetPublicFolderEmailAddresses", new object[] { - itemId, - accountId}, callback, asyncState); - } - - /// - public ExchangeEmailAddress[] EndGetPublicFolderEmailAddresses(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeEmailAddress[])(results[0])); - } - - /// - public void GetPublicFolderEmailAddressesAsync(int itemId, int accountId) { - this.GetPublicFolderEmailAddressesAsync(itemId, accountId, null); - } - - /// - public void GetPublicFolderEmailAddressesAsync(int itemId, int accountId, object userState) { - if ((this.GetPublicFolderEmailAddressesOperationCompleted == null)) { - this.GetPublicFolderEmailAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPublicFolderEmailAddressesOperationCompleted); - } - this.InvokeAsync("GetPublicFolderEmailAddresses", new object[] { - itemId, - accountId}, this.GetPublicFolderEmailAddressesOperationCompleted, userState); - } - - private void OnGetPublicFolderEmailAddressesOperationCompleted(object arg) { - if ((this.GetPublicFolderEmailAddressesCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetPublicFolderEmailAddressesCompleted(this, new GetPublicFolderEmailAddressesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddPublicFolderEmailAddress", 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 AddPublicFolderEmailAddress(int itemId, int accountId, string emailAddress) { - object[] results = this.Invoke("AddPublicFolderEmailAddress", new object[] { - itemId, - accountId, - emailAddress}); - return ((int)(results[0])); - } - - /// - public System.IAsyncResult BeginAddPublicFolderEmailAddress(int itemId, int accountId, string emailAddress, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("AddPublicFolderEmailAddress", new object[] { - itemId, - accountId, - emailAddress}, callback, asyncState); - } - - /// - public int EndAddPublicFolderEmailAddress(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((int)(results[0])); - } - - /// - public void AddPublicFolderEmailAddressAsync(int itemId, int accountId, string emailAddress) { - this.AddPublicFolderEmailAddressAsync(itemId, accountId, emailAddress, null); - } - - /// - public void AddPublicFolderEmailAddressAsync(int itemId, int accountId, string emailAddress, object userState) { - if ((this.AddPublicFolderEmailAddressOperationCompleted == null)) { - this.AddPublicFolderEmailAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddPublicFolderEmailAddressOperationCompleted); - } - this.InvokeAsync("AddPublicFolderEmailAddress", new object[] { - itemId, - accountId, - emailAddress}, this.AddPublicFolderEmailAddressOperationCompleted, userState); - } - - private void OnAddPublicFolderEmailAddressOperationCompleted(object arg) { - if ((this.AddPublicFolderEmailAddressCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.AddPublicFolderEmailAddressCompleted(this, new AddPublicFolderEmailAddressCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetPublicFolderPrimaryEmailAddress", 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 SetPublicFolderPrimaryEmailAddress(int itemId, int accountId, string emailAddress) { - object[] results = this.Invoke("SetPublicFolderPrimaryEmailAddress", new object[] { - itemId, - accountId, - emailAddress}); - return ((int)(results[0])); - } - - /// - public System.IAsyncResult BeginSetPublicFolderPrimaryEmailAddress(int itemId, int accountId, string emailAddress, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("SetPublicFolderPrimaryEmailAddress", new object[] { - itemId, - accountId, - emailAddress}, callback, asyncState); - } - - /// - public int EndSetPublicFolderPrimaryEmailAddress(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((int)(results[0])); - } - - /// - public void SetPublicFolderPrimaryEmailAddressAsync(int itemId, int accountId, string emailAddress) { - this.SetPublicFolderPrimaryEmailAddressAsync(itemId, accountId, emailAddress, null); - } - - /// - public void SetPublicFolderPrimaryEmailAddressAsync(int itemId, int accountId, string emailAddress, object userState) { - if ((this.SetPublicFolderPrimaryEmailAddressOperationCompleted == null)) { - this.SetPublicFolderPrimaryEmailAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetPublicFolderPrimaryEmailAddressOperationCompleted); - } - this.InvokeAsync("SetPublicFolderPrimaryEmailAddress", new object[] { - itemId, - accountId, - emailAddress}, this.SetPublicFolderPrimaryEmailAddressOperationCompleted, userState); - } - - private void OnSetPublicFolderPrimaryEmailAddressOperationCompleted(object arg) { - if ((this.SetPublicFolderPrimaryEmailAddressCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SetPublicFolderPrimaryEmailAddressCompleted(this, new SetPublicFolderPrimaryEmailAddressCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeletePublicFolderEmailAddresses", 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 DeletePublicFolderEmailAddresses(int itemId, int accountId, string[] emailAddresses) { - object[] results = this.Invoke("DeletePublicFolderEmailAddresses", new object[] { - itemId, - accountId, - emailAddresses}); - return ((int)(results[0])); - } - - /// - public System.IAsyncResult BeginDeletePublicFolderEmailAddresses(int itemId, int accountId, string[] emailAddresses, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("DeletePublicFolderEmailAddresses", new object[] { - itemId, - accountId, - emailAddresses}, callback, asyncState); - } - - /// - public int EndDeletePublicFolderEmailAddresses(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((int)(results[0])); - } - - /// - public void DeletePublicFolderEmailAddressesAsync(int itemId, int accountId, string[] emailAddresses) { - this.DeletePublicFolderEmailAddressesAsync(itemId, accountId, emailAddresses, null); - } - - /// - public void DeletePublicFolderEmailAddressesAsync(int itemId, int accountId, string[] emailAddresses, object userState) { - if ((this.DeletePublicFolderEmailAddressesOperationCompleted == null)) { - this.DeletePublicFolderEmailAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeletePublicFolderEmailAddressesOperationCompleted); - } - this.InvokeAsync("DeletePublicFolderEmailAddresses", new object[] { - itemId, - accountId, - emailAddresses}, this.DeletePublicFolderEmailAddressesOperationCompleted, userState); - } - - private void OnDeletePublicFolderEmailAddressesOperationCompleted(object arg) { - if ((this.DeletePublicFolderEmailAddressesCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.DeletePublicFolderEmailAddressesCompleted(this, new DeletePublicFolderEmailAddressesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMobileDevices", 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 ExchangeMobileDevice[] GetMobileDevices(int itemId, int accountId) { - object[] results = this.Invoke("GetMobileDevices", new object[] { - itemId, - accountId}); - return ((ExchangeMobileDevice[])(results[0])); - } - - /// - public System.IAsyncResult BeginGetMobileDevices(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetMobileDevices", new object[] { - itemId, - accountId}, callback, asyncState); - } - - /// - public ExchangeMobileDevice[] EndGetMobileDevices(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeMobileDevice[])(results[0])); - } - - /// - public void GetMobileDevicesAsync(int itemId, int accountId) { - this.GetMobileDevicesAsync(itemId, accountId, null); - } - - /// - public void GetMobileDevicesAsync(int itemId, int accountId, object userState) { - if ((this.GetMobileDevicesOperationCompleted == null)) { - this.GetMobileDevicesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMobileDevicesOperationCompleted); - } - this.InvokeAsync("GetMobileDevices", new object[] { - itemId, - accountId}, this.GetMobileDevicesOperationCompleted, userState); - } - - private void OnGetMobileDevicesOperationCompleted(object arg) { - if ((this.GetMobileDevicesCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetMobileDevicesCompleted(this, new GetMobileDevicesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMobileDevice", 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 ExchangeMobileDevice GetMobileDevice(int itemId, string deviceId) { - object[] results = this.Invoke("GetMobileDevice", new object[] { - itemId, - deviceId}); - return ((ExchangeMobileDevice)(results[0])); - } - - /// - public System.IAsyncResult BeginGetMobileDevice(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetMobileDevice", new object[] { - itemId, - deviceId}, callback, asyncState); - } - - /// - public ExchangeMobileDevice EndGetMobileDevice(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeMobileDevice)(results[0])); - } - - /// - public void GetMobileDeviceAsync(int itemId, string deviceId) { - this.GetMobileDeviceAsync(itemId, deviceId, null); - } - - /// - public void GetMobileDeviceAsync(int itemId, string deviceId, object userState) { - if ((this.GetMobileDeviceOperationCompleted == null)) { - this.GetMobileDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMobileDeviceOperationCompleted); - } - this.InvokeAsync("GetMobileDevice", new object[] { - itemId, - deviceId}, this.GetMobileDeviceOperationCompleted, userState); - } - - private void OnGetMobileDeviceOperationCompleted(object arg) { - if ((this.GetMobileDeviceCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetMobileDeviceCompleted(this, new GetMobileDeviceCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/WipeDataFromDevice", 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 void WipeDataFromDevice(int itemId, string deviceId) { - this.Invoke("WipeDataFromDevice", new object[] { - itemId, - deviceId}); - } - - /// - public System.IAsyncResult BeginWipeDataFromDevice(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("WipeDataFromDevice", new object[] { - itemId, - deviceId}, callback, asyncState); - } - - /// - public void EndWipeDataFromDevice(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void WipeDataFromDeviceAsync(int itemId, string deviceId) { - this.WipeDataFromDeviceAsync(itemId, deviceId, null); - } - - /// - public void WipeDataFromDeviceAsync(int itemId, string deviceId, object userState) { - if ((this.WipeDataFromDeviceOperationCompleted == null)) { - this.WipeDataFromDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWipeDataFromDeviceOperationCompleted); - } - this.InvokeAsync("WipeDataFromDevice", new object[] { - itemId, - deviceId}, this.WipeDataFromDeviceOperationCompleted, userState); - } - - private void OnWipeDataFromDeviceOperationCompleted(object arg) { - if ((this.WipeDataFromDeviceCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.WipeDataFromDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CancelRemoteWipeRequest", 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 void CancelRemoteWipeRequest(int itemId, string deviceId) { - this.Invoke("CancelRemoteWipeRequest", new object[] { - itemId, - deviceId}); - } - - /// - public System.IAsyncResult BeginCancelRemoteWipeRequest(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("CancelRemoteWipeRequest", new object[] { - itemId, - deviceId}, callback, asyncState); - } - - /// - public void EndCancelRemoteWipeRequest(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void CancelRemoteWipeRequestAsync(int itemId, string deviceId) { - this.CancelRemoteWipeRequestAsync(itemId, deviceId, null); - } - - /// - public void CancelRemoteWipeRequestAsync(int itemId, string deviceId, object userState) { - if ((this.CancelRemoteWipeRequestOperationCompleted == null)) { - this.CancelRemoteWipeRequestOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCancelRemoteWipeRequestOperationCompleted); - } - this.InvokeAsync("CancelRemoteWipeRequest", new object[] { - itemId, - deviceId}, this.CancelRemoteWipeRequestOperationCompleted, userState); - } - - private void OnCancelRemoteWipeRequestOperationCompleted(object arg) { - if ((this.CancelRemoteWipeRequestCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.CancelRemoteWipeRequestCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RemoveDevice", 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 void RemoveDevice(int itemId, string deviceId) { - this.Invoke("RemoveDevice", new object[] { - itemId, - deviceId}); - } - - /// - public System.IAsyncResult BeginRemoveDevice(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("RemoveDevice", new object[] { - itemId, - deviceId}, callback, asyncState); - } - - /// - public void EndRemoveDevice(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void RemoveDeviceAsync(int itemId, string deviceId) { - this.RemoveDeviceAsync(itemId, deviceId, null); - } - - /// - public void RemoveDeviceAsync(int itemId, string deviceId, object userState) { - if ((this.RemoveDeviceOperationCompleted == null)) { - this.RemoveDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveDeviceOperationCompleted); - } - this.InvokeAsync("RemoveDevice", new object[] { - itemId, - deviceId}, this.RemoveDeviceOperationCompleted, userState); - } - - private void OnRemoveDeviceOperationCompleted(object arg) { - if ((this.RemoveDeviceCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.RemoveDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } + public event DeletePublicFolderEmailAddressesCompletedEventHandler DeletePublicFolderEmailAddressesCompleted; /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRawExchangeOrganizationsPaged", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -1363,43 +864,46 @@ namespace WebsitePanel.EnterpriseServer } /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPublicFoldersStatistics", 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 ExchangeItemStatistics[] GetPublicFoldersStatistics(int itemId) { - object[] results = this.Invoke("GetPublicFoldersStatistics", new object[] { - itemId}); - return ((ExchangeItemStatistics[])(results[0])); + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMailboxStatistics", 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 ExchangeMailboxStatistics GetMailboxStatistics(int itemId, int accountId) { + object[] results = this.Invoke("GetMailboxStatistics", new object[] { + itemId, + accountId}); + return ((ExchangeMailboxStatistics)(results[0])); } /// - public System.IAsyncResult BeginGetPublicFoldersStatistics(int itemId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetPublicFoldersStatistics", new object[] { - itemId}, callback, asyncState); + public System.IAsyncResult BeginGetMailboxStatistics(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetMailboxStatistics", new object[] { + itemId, + accountId}, callback, asyncState); } /// - public ExchangeItemStatistics[] EndGetPublicFoldersStatistics(System.IAsyncResult asyncResult) { + public ExchangeMailboxStatistics EndGetMailboxStatistics(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); - return ((ExchangeItemStatistics[])(results[0])); + return ((ExchangeMailboxStatistics)(results[0])); } /// - public void GetPublicFoldersStatisticsAsync(int itemId) { - this.GetPublicFoldersStatisticsAsync(itemId, null); + public void GetMailboxStatisticsAsync(int itemId, int accountId) { + this.GetMailboxStatisticsAsync(itemId, accountId, null); } /// - public void GetPublicFoldersStatisticsAsync(int itemId, object userState) { - if ((this.GetPublicFoldersStatisticsOperationCompleted == null)) { - this.GetPublicFoldersStatisticsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPublicFoldersStatisticsOperationCompleted); + public void GetMailboxStatisticsAsync(int itemId, int accountId, object userState) { + if ((this.GetMailboxStatisticsOperationCompleted == null)) { + this.GetMailboxStatisticsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMailboxStatisticsOperationCompleted); } - this.InvokeAsync("GetPublicFoldersStatistics", new object[] { - itemId}, this.GetPublicFoldersStatisticsOperationCompleted, userState); + this.InvokeAsync("GetMailboxStatistics", new object[] { + itemId, + accountId}, this.GetMailboxStatisticsOperationCompleted, userState); } - private void OnGetPublicFoldersStatisticsOperationCompleted(object arg) { - if ((this.GetPublicFoldersStatisticsCompleted != null)) { + private void OnGetMailboxStatisticsOperationCompleted(object arg) { + if ((this.GetMailboxStatisticsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetPublicFoldersStatisticsCompleted(this, new GetPublicFoldersStatisticsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + this.GetMailboxStatisticsCompleted(this, new GetMailboxStatisticsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } @@ -1836,6 +1340,50 @@ namespace WebsitePanel.EnterpriseServer } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetExchangeAccountByMailboxPlanId", 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 ExchangeAccount[] GetExchangeAccountByMailboxPlanId(int itemId, int mailboxPlanId) { + object[] results = this.Invoke("GetExchangeAccountByMailboxPlanId", new object[] { + itemId, + mailboxPlanId}); + return ((ExchangeAccount[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetExchangeAccountByMailboxPlanId(int itemId, int mailboxPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetExchangeAccountByMailboxPlanId", new object[] { + itemId, + mailboxPlanId}, callback, asyncState); + } + + /// + public ExchangeAccount[] EndGetExchangeAccountByMailboxPlanId(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeAccount[])(results[0])); + } + + /// + public void GetExchangeAccountByMailboxPlanIdAsync(int itemId, int mailboxPlanId) { + this.GetExchangeAccountByMailboxPlanIdAsync(itemId, mailboxPlanId, null); + } + + /// + public void GetExchangeAccountByMailboxPlanIdAsync(int itemId, int mailboxPlanId, object userState) { + if ((this.GetExchangeAccountByMailboxPlanIdOperationCompleted == null)) { + this.GetExchangeAccountByMailboxPlanIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExchangeAccountByMailboxPlanIdOperationCompleted); + } + this.InvokeAsync("GetExchangeAccountByMailboxPlanId", new object[] { + itemId, + mailboxPlanId}, this.GetExchangeAccountByMailboxPlanIdOperationCompleted, userState); + } + + private void OnGetExchangeAccountByMailboxPlanIdOperationCompleted(object arg) { + if ((this.GetExchangeAccountByMailboxPlanIdCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetExchangeAccountByMailboxPlanIdCompleted(this, new GetExchangeAccountByMailboxPlanIdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SearchAccounts", 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 ExchangeAccount[] SearchAccounts(int itemId, bool includeMailboxes, bool includeContacts, bool includeDistributionLists, bool includeRooms, bool includeEquipment, string filterColumn, string filterValue, string sortColumn) { @@ -2038,7 +1586,7 @@ namespace WebsitePanel.EnterpriseServer /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CreateMailbox", 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 CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress) { + public int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, string subscriberNumber) { object[] results = this.Invoke("CreateMailbox", new object[] { itemId, accountId, @@ -2049,12 +1597,14 @@ namespace WebsitePanel.EnterpriseServer domain, password, sendSetupInstructions, - setupInstructionMailAddress}); + setupInstructionMailAddress, + mailboxPlanId, + subscriberNumber}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginCreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, string subscriberNumber, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateMailbox", new object[] { itemId, accountId, @@ -2065,7 +1615,9 @@ namespace WebsitePanel.EnterpriseServer domain, password, sendSetupInstructions, - setupInstructionMailAddress}, callback, asyncState); + setupInstructionMailAddress, + mailboxPlanId, + subscriberNumber}, callback, asyncState); } /// @@ -2075,12 +1627,12 @@ namespace WebsitePanel.EnterpriseServer } /// - public void CreateMailboxAsync(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress) { - this.CreateMailboxAsync(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress, null); + public void CreateMailboxAsync(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, string subscriberNumber) { + this.CreateMailboxAsync(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress, mailboxPlanId, subscriberNumber, null); } /// - public void CreateMailboxAsync(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, object userState) { + public void CreateMailboxAsync(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, string subscriberNumber, object userState) { if ((this.CreateMailboxOperationCompleted == null)) { this.CreateMailboxOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateMailboxOperationCompleted); } @@ -2094,7 +1646,9 @@ namespace WebsitePanel.EnterpriseServer domain, password, sendSetupInstructions, - setupInstructionMailAddress}, this.CreateMailboxOperationCompleted, userState); + setupInstructionMailAddress, + mailboxPlanId, + subscriberNumber}, this.CreateMailboxOperationCompleted, userState); } private void OnCreateMailboxOperationCompleted(object arg) { @@ -2238,120 +1792,22 @@ namespace WebsitePanel.EnterpriseServer /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetMailboxGeneralSettings", 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 SetMailboxGeneralSettings( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes) { + public int SetMailboxGeneralSettings(int itemId, int accountId, bool hideAddressBook, bool disabled) { object[] results = this.Invoke("SetMailboxGeneralSettings", new object[] { itemId, accountId, - displayName, - password, hideAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes}); + disabled}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginSetMailboxGeneralSettings( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - System.AsyncCallback callback, - object asyncState) { + public System.IAsyncResult BeginSetMailboxGeneralSettings(int itemId, int accountId, bool hideAddressBook, bool disabled, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetMailboxGeneralSettings", new object[] { itemId, accountId, - displayName, - password, hideAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes}, callback, asyncState); + disabled}, callback, asyncState); } /// @@ -2361,95 +1817,20 @@ namespace WebsitePanel.EnterpriseServer } /// - public void SetMailboxGeneralSettingsAsync( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes) { - this.SetMailboxGeneralSettingsAsync(itemId, accountId, displayName, password, hideAddressBook, disabled, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, null); + public void SetMailboxGeneralSettingsAsync(int itemId, int accountId, bool hideAddressBook, bool disabled) { + this.SetMailboxGeneralSettingsAsync(itemId, accountId, hideAddressBook, disabled, null); } /// - public void SetMailboxGeneralSettingsAsync( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - object userState) { + public void SetMailboxGeneralSettingsAsync(int itemId, int accountId, bool hideAddressBook, bool disabled, object userState) { if ((this.SetMailboxGeneralSettingsOperationCompleted == null)) { this.SetMailboxGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMailboxGeneralSettingsOperationCompleted); } this.InvokeAsync("SetMailboxGeneralSettings", new object[] { itemId, accountId, - displayName, - password, hideAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes}, this.SetMailboxGeneralSettingsOperationCompleted, userState); + disabled}, this.SetMailboxGeneralSettingsOperationCompleted, userState); } private void OnSetMailboxGeneralSettingsOperationCompleted(object arg) { @@ -2690,7 +2071,7 @@ namespace WebsitePanel.EnterpriseServer /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetMailboxMailFlowSettings", 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 SetMailboxMailFlowSettings(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication) { + public int SetMailboxMailFlowSettings(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { object[] results = this.Invoke("SetMailboxMailFlowSettings", new object[] { itemId, accountId, @@ -2700,15 +2081,12 @@ namespace WebsitePanel.EnterpriseServer sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, requireSenderAuthentication}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginSetMailboxMailFlowSettings(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetMailboxMailFlowSettings(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetMailboxMailFlowSettings", new object[] { itemId, accountId, @@ -2718,9 +2096,6 @@ namespace WebsitePanel.EnterpriseServer sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, requireSenderAuthentication}, callback, asyncState); } @@ -2731,12 +2106,12 @@ namespace WebsitePanel.EnterpriseServer } /// - public void SetMailboxMailFlowSettingsAsync(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication) { - this.SetMailboxMailFlowSettingsAsync(itemId, accountId, enableForwarding, forwardingAccountName, forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, requireSenderAuthentication, null); + public void SetMailboxMailFlowSettingsAsync(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { + this.SetMailboxMailFlowSettingsAsync(itemId, accountId, enableForwarding, forwardingAccountName, forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, requireSenderAuthentication, null); } /// - public void SetMailboxMailFlowSettingsAsync(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication, object userState) { + public void SetMailboxMailFlowSettingsAsync(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, object userState) { if ((this.SetMailboxMailFlowSettingsOperationCompleted == null)) { this.SetMailboxMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMailboxMailFlowSettingsOperationCompleted); } @@ -2749,9 +2124,6 @@ namespace WebsitePanel.EnterpriseServer sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, requireSenderAuthentication}, this.SetMailboxMailFlowSettingsOperationCompleted, userState); } @@ -2763,117 +2135,49 @@ namespace WebsitePanel.EnterpriseServer } /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMailboxAdvancedSettings", 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 ExchangeMailbox GetMailboxAdvancedSettings(int itemId, int accountId) { - object[] results = this.Invoke("GetMailboxAdvancedSettings", new object[] { - itemId, - accountId}); - return ((ExchangeMailbox)(results[0])); - } - - /// - public System.IAsyncResult BeginGetMailboxAdvancedSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetMailboxAdvancedSettings", new object[] { - itemId, - accountId}, callback, asyncState); - } - - /// - public ExchangeMailbox EndGetMailboxAdvancedSettings(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeMailbox)(results[0])); - } - - /// - public void GetMailboxAdvancedSettingsAsync(int itemId, int accountId) { - this.GetMailboxAdvancedSettingsAsync(itemId, accountId, null); - } - - /// - public void GetMailboxAdvancedSettingsAsync(int itemId, int accountId, object userState) { - if ((this.GetMailboxAdvancedSettingsOperationCompleted == null)) { - this.GetMailboxAdvancedSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMailboxAdvancedSettingsOperationCompleted); - } - this.InvokeAsync("GetMailboxAdvancedSettings", new object[] { - itemId, - accountId}, this.GetMailboxAdvancedSettingsOperationCompleted, userState); - } - - private void OnGetMailboxAdvancedSettingsOperationCompleted(object arg) { - if ((this.GetMailboxAdvancedSettingsCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetMailboxAdvancedSettingsCompleted(this, new GetMailboxAdvancedSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetMailboxAdvancedSettings", 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 SetMailboxAdvancedSettings(int itemId, int accountId, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) { - object[] results = this.Invoke("SetMailboxAdvancedSettings", new object[] { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetExchangeMailboxPlan", 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 SetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId) { + object[] results = this.Invoke("SetExchangeMailboxPlan", new object[] { itemId, accountId, - enablePOP, - enableIMAP, - enableOWA, - enableMAPI, - enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays}); + mailboxPlanId}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginSetMailboxAdvancedSettings(int itemId, int accountId, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("SetMailboxAdvancedSettings", new object[] { + public System.IAsyncResult BeginSetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetExchangeMailboxPlan", new object[] { itemId, accountId, - enablePOP, - enableIMAP, - enableOWA, - enableMAPI, - enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays}, callback, asyncState); + mailboxPlanId}, callback, asyncState); } /// - public int EndSetMailboxAdvancedSettings(System.IAsyncResult asyncResult) { + public int EndSetExchangeMailboxPlan(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } /// - public void SetMailboxAdvancedSettingsAsync(int itemId, int accountId, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) { - this.SetMailboxAdvancedSettingsAsync(itemId, accountId, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, null); + public void SetExchangeMailboxPlanAsync(int itemId, int accountId, int mailboxPlanId) { + this.SetExchangeMailboxPlanAsync(itemId, accountId, mailboxPlanId, null); } /// - public void SetMailboxAdvancedSettingsAsync(int itemId, int accountId, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, object userState) { - if ((this.SetMailboxAdvancedSettingsOperationCompleted == null)) { - this.SetMailboxAdvancedSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMailboxAdvancedSettingsOperationCompleted); + public void SetExchangeMailboxPlanAsync(int itemId, int accountId, int mailboxPlanId, object userState) { + if ((this.SetExchangeMailboxPlanOperationCompleted == null)) { + this.SetExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetExchangeMailboxPlanOperationCompleted); } - this.InvokeAsync("SetMailboxAdvancedSettings", new object[] { + this.InvokeAsync("SetExchangeMailboxPlan", new object[] { itemId, accountId, - enablePOP, - enableIMAP, - enableOWA, - enableMAPI, - enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays}, this.SetMailboxAdvancedSettingsOperationCompleted, userState); + mailboxPlanId}, this.SetExchangeMailboxPlanOperationCompleted, userState); } - private void OnSetMailboxAdvancedSettingsOperationCompleted(object arg) { - if ((this.SetMailboxAdvancedSettingsCompleted != null)) { + private void OnSetExchangeMailboxPlanOperationCompleted(object arg) { + if ((this.SetExchangeMailboxPlanCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SetMailboxAdvancedSettingsCompleted(this, new SetMailboxAdvancedSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + this.SetExchangeMailboxPlanCompleted(this, new SetExchangeMailboxPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } @@ -4160,6 +3464,436 @@ namespace WebsitePanel.EnterpriseServer } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMobileDevices", 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 ExchangeMobileDevice[] GetMobileDevices(int itemId, int accountId) { + object[] results = this.Invoke("GetMobileDevices", new object[] { + itemId, + accountId}); + return ((ExchangeMobileDevice[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetMobileDevices(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetMobileDevices", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public ExchangeMobileDevice[] EndGetMobileDevices(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeMobileDevice[])(results[0])); + } + + /// + public void GetMobileDevicesAsync(int itemId, int accountId) { + this.GetMobileDevicesAsync(itemId, accountId, null); + } + + /// + public void GetMobileDevicesAsync(int itemId, int accountId, object userState) { + if ((this.GetMobileDevicesOperationCompleted == null)) { + this.GetMobileDevicesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMobileDevicesOperationCompleted); + } + this.InvokeAsync("GetMobileDevices", new object[] { + itemId, + accountId}, this.GetMobileDevicesOperationCompleted, userState); + } + + private void OnGetMobileDevicesOperationCompleted(object arg) { + if ((this.GetMobileDevicesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetMobileDevicesCompleted(this, new GetMobileDevicesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMobileDevice", 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 ExchangeMobileDevice GetMobileDevice(int itemId, string deviceId) { + object[] results = this.Invoke("GetMobileDevice", new object[] { + itemId, + deviceId}); + return ((ExchangeMobileDevice)(results[0])); + } + + /// + public System.IAsyncResult BeginGetMobileDevice(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetMobileDevice", new object[] { + itemId, + deviceId}, callback, asyncState); + } + + /// + public ExchangeMobileDevice EndGetMobileDevice(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeMobileDevice)(results[0])); + } + + /// + public void GetMobileDeviceAsync(int itemId, string deviceId) { + this.GetMobileDeviceAsync(itemId, deviceId, null); + } + + /// + public void GetMobileDeviceAsync(int itemId, string deviceId, object userState) { + if ((this.GetMobileDeviceOperationCompleted == null)) { + this.GetMobileDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMobileDeviceOperationCompleted); + } + this.InvokeAsync("GetMobileDevice", new object[] { + itemId, + deviceId}, this.GetMobileDeviceOperationCompleted, userState); + } + + private void OnGetMobileDeviceOperationCompleted(object arg) { + if ((this.GetMobileDeviceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetMobileDeviceCompleted(this, new GetMobileDeviceCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/WipeDataFromDevice", 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 void WipeDataFromDevice(int itemId, string deviceId) { + this.Invoke("WipeDataFromDevice", new object[] { + itemId, + deviceId}); + } + + /// + public System.IAsyncResult BeginWipeDataFromDevice(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("WipeDataFromDevice", new object[] { + itemId, + deviceId}, callback, asyncState); + } + + /// + public void EndWipeDataFromDevice(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void WipeDataFromDeviceAsync(int itemId, string deviceId) { + this.WipeDataFromDeviceAsync(itemId, deviceId, null); + } + + /// + public void WipeDataFromDeviceAsync(int itemId, string deviceId, object userState) { + if ((this.WipeDataFromDeviceOperationCompleted == null)) { + this.WipeDataFromDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWipeDataFromDeviceOperationCompleted); + } + this.InvokeAsync("WipeDataFromDevice", new object[] { + itemId, + deviceId}, this.WipeDataFromDeviceOperationCompleted, userState); + } + + private void OnWipeDataFromDeviceOperationCompleted(object arg) { + if ((this.WipeDataFromDeviceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.WipeDataFromDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CancelRemoteWipeRequest", 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 void CancelRemoteWipeRequest(int itemId, string deviceId) { + this.Invoke("CancelRemoteWipeRequest", new object[] { + itemId, + deviceId}); + } + + /// + public System.IAsyncResult BeginCancelRemoteWipeRequest(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CancelRemoteWipeRequest", new object[] { + itemId, + deviceId}, callback, asyncState); + } + + /// + public void EndCancelRemoteWipeRequest(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void CancelRemoteWipeRequestAsync(int itemId, string deviceId) { + this.CancelRemoteWipeRequestAsync(itemId, deviceId, null); + } + + /// + public void CancelRemoteWipeRequestAsync(int itemId, string deviceId, object userState) { + if ((this.CancelRemoteWipeRequestOperationCompleted == null)) { + this.CancelRemoteWipeRequestOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCancelRemoteWipeRequestOperationCompleted); + } + this.InvokeAsync("CancelRemoteWipeRequest", new object[] { + itemId, + deviceId}, this.CancelRemoteWipeRequestOperationCompleted, userState); + } + + private void OnCancelRemoteWipeRequestOperationCompleted(object arg) { + if ((this.CancelRemoteWipeRequestCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CancelRemoteWipeRequestCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RemoveDevice", 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 void RemoveDevice(int itemId, string deviceId) { + this.Invoke("RemoveDevice", new object[] { + itemId, + deviceId}); + } + + /// + public System.IAsyncResult BeginRemoveDevice(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("RemoveDevice", new object[] { + itemId, + deviceId}, callback, asyncState); + } + + /// + public void EndRemoveDevice(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void RemoveDeviceAsync(int itemId, string deviceId) { + this.RemoveDeviceAsync(itemId, deviceId, null); + } + + /// + public void RemoveDeviceAsync(int itemId, string deviceId, object userState) { + if ((this.RemoveDeviceOperationCompleted == null)) { + this.RemoveDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveDeviceOperationCompleted); + } + this.InvokeAsync("RemoveDevice", new object[] { + itemId, + deviceId}, this.RemoveDeviceOperationCompleted, userState); + } + + private void OnRemoveDeviceOperationCompleted(object arg) { + if ((this.RemoveDeviceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetExchangeMailboxPlans", 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 ExchangeMailboxPlan[] GetExchangeMailboxPlans(int itemId) { + object[] results = this.Invoke("GetExchangeMailboxPlans", new object[] { + itemId}); + return ((ExchangeMailboxPlan[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetExchangeMailboxPlans(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetExchangeMailboxPlans", new object[] { + itemId}, callback, asyncState); + } + + /// + public ExchangeMailboxPlan[] EndGetExchangeMailboxPlans(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeMailboxPlan[])(results[0])); + } + + /// + public void GetExchangeMailboxPlansAsync(int itemId) { + this.GetExchangeMailboxPlansAsync(itemId, null); + } + + /// + public void GetExchangeMailboxPlansAsync(int itemId, object userState) { + if ((this.GetExchangeMailboxPlansOperationCompleted == null)) { + this.GetExchangeMailboxPlansOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExchangeMailboxPlansOperationCompleted); + } + this.InvokeAsync("GetExchangeMailboxPlans", new object[] { + itemId}, this.GetExchangeMailboxPlansOperationCompleted, userState); + } + + private void OnGetExchangeMailboxPlansOperationCompleted(object arg) { + if ((this.GetExchangeMailboxPlansCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetExchangeMailboxPlansCompleted(this, new GetExchangeMailboxPlansCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetExchangeMailboxPlan", 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 ExchangeMailboxPlan GetExchangeMailboxPlan(int itemId, int mailboxPlanId) { + object[] results = this.Invoke("GetExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}); + return ((ExchangeMailboxPlan)(results[0])); + } + + /// + public System.IAsyncResult BeginGetExchangeMailboxPlan(int itemId, int mailboxPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}, callback, asyncState); + } + + /// + public ExchangeMailboxPlan EndGetExchangeMailboxPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeMailboxPlan)(results[0])); + } + + /// + public void GetExchangeMailboxPlanAsync(int itemId, int mailboxPlanId) { + this.GetExchangeMailboxPlanAsync(itemId, mailboxPlanId, null); + } + + /// + public void GetExchangeMailboxPlanAsync(int itemId, int mailboxPlanId, object userState) { + if ((this.GetExchangeMailboxPlanOperationCompleted == null)) { + this.GetExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExchangeMailboxPlanOperationCompleted); + } + this.InvokeAsync("GetExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}, this.GetExchangeMailboxPlanOperationCompleted, userState); + } + + private void OnGetExchangeMailboxPlanOperationCompleted(object arg) { + if ((this.GetExchangeMailboxPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetExchangeMailboxPlanCompleted(this, new GetExchangeMailboxPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddExchangeMailboxPlan", 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 AddExchangeMailboxPlan(int itemId, ExchangeMailboxPlan mailboxPlan) { + object[] results = this.Invoke("AddExchangeMailboxPlan", new object[] { + itemId, + mailboxPlan}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginAddExchangeMailboxPlan(int itemId, ExchangeMailboxPlan mailboxPlan, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("AddExchangeMailboxPlan", new object[] { + itemId, + mailboxPlan}, callback, asyncState); + } + + /// + public int EndAddExchangeMailboxPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void AddExchangeMailboxPlanAsync(int itemId, ExchangeMailboxPlan mailboxPlan) { + this.AddExchangeMailboxPlanAsync(itemId, mailboxPlan, null); + } + + /// + public void AddExchangeMailboxPlanAsync(int itemId, ExchangeMailboxPlan mailboxPlan, object userState) { + if ((this.AddExchangeMailboxPlanOperationCompleted == null)) { + this.AddExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddExchangeMailboxPlanOperationCompleted); + } + this.InvokeAsync("AddExchangeMailboxPlan", new object[] { + itemId, + mailboxPlan}, this.AddExchangeMailboxPlanOperationCompleted, userState); + } + + private void OnAddExchangeMailboxPlanOperationCompleted(object arg) { + if ((this.AddExchangeMailboxPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddExchangeMailboxPlanCompleted(this, new AddExchangeMailboxPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeleteExchangeMailboxPlan", 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 DeleteExchangeMailboxPlan(int itemId, int mailboxPlanId) { + object[] results = this.Invoke("DeleteExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteExchangeMailboxPlan(int itemId, int mailboxPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}, callback, asyncState); + } + + /// + public int EndDeleteExchangeMailboxPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void DeleteExchangeMailboxPlanAsync(int itemId, int mailboxPlanId) { + this.DeleteExchangeMailboxPlanAsync(itemId, mailboxPlanId, null); + } + + /// + public void DeleteExchangeMailboxPlanAsync(int itemId, int mailboxPlanId, object userState) { + if ((this.DeleteExchangeMailboxPlanOperationCompleted == null)) { + this.DeleteExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteExchangeMailboxPlanOperationCompleted); + } + this.InvokeAsync("DeleteExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}, this.DeleteExchangeMailboxPlanOperationCompleted, userState); + } + + private void OnDeleteExchangeMailboxPlanOperationCompleted(object arg) { + if ((this.DeleteExchangeMailboxPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteExchangeMailboxPlanCompleted(this, new DeleteExchangeMailboxPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetOrganizationDefaultExchangeMailbo" + + "xPlan", 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 void SetOrganizationDefaultExchangeMailboxPlan(int itemId, int mailboxPlanId) { + this.Invoke("SetOrganizationDefaultExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}); + } + + /// + public System.IAsyncResult BeginSetOrganizationDefaultExchangeMailboxPlan(int itemId, int mailboxPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetOrganizationDefaultExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}, callback, asyncState); + } + + /// + public void EndSetOrganizationDefaultExchangeMailboxPlan(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void SetOrganizationDefaultExchangeMailboxPlanAsync(int itemId, int mailboxPlanId) { + this.SetOrganizationDefaultExchangeMailboxPlanAsync(itemId, mailboxPlanId, null); + } + + /// + public void SetOrganizationDefaultExchangeMailboxPlanAsync(int itemId, int mailboxPlanId, object userState) { + if ((this.SetOrganizationDefaultExchangeMailboxPlanOperationCompleted == null)) { + this.SetOrganizationDefaultExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetOrganizationDefaultExchangeMailboxPlanOperationCompleted); + } + this.InvokeAsync("SetOrganizationDefaultExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}, this.SetOrganizationDefaultExchangeMailboxPlanOperationCompleted, userState); + } + + private void OnSetOrganizationDefaultExchangeMailboxPlanOperationCompleted(object arg) { + if ((this.SetOrganizationDefaultExchangeMailboxPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetOrganizationDefaultExchangeMailboxPlanCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CreatePublicFolder", 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 CreatePublicFolder(int itemId, string parentFolder, string folderName, bool mailEnabled, string accountName, string domain) { @@ -4495,232 +4229,294 @@ namespace WebsitePanel.EnterpriseServer } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPublicFolderMailFlowSettings", 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 ExchangePublicFolder GetPublicFolderMailFlowSettings(int itemId, int accountId) { + object[] results = this.Invoke("GetPublicFolderMailFlowSettings", new object[] { + itemId, + accountId}); + return ((ExchangePublicFolder)(results[0])); + } + + /// + public System.IAsyncResult BeginGetPublicFolderMailFlowSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetPublicFolderMailFlowSettings", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public ExchangePublicFolder EndGetPublicFolderMailFlowSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangePublicFolder)(results[0])); + } + + /// + public void GetPublicFolderMailFlowSettingsAsync(int itemId, int accountId) { + this.GetPublicFolderMailFlowSettingsAsync(itemId, accountId, null); + } + + /// + public void GetPublicFolderMailFlowSettingsAsync(int itemId, int accountId, object userState) { + if ((this.GetPublicFolderMailFlowSettingsOperationCompleted == null)) { + this.GetPublicFolderMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPublicFolderMailFlowSettingsOperationCompleted); + } + this.InvokeAsync("GetPublicFolderMailFlowSettings", new object[] { + itemId, + accountId}, this.GetPublicFolderMailFlowSettingsOperationCompleted, userState); + } + + private void OnGetPublicFolderMailFlowSettingsOperationCompleted(object arg) { + if ((this.GetPublicFolderMailFlowSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetPublicFolderMailFlowSettingsCompleted(this, new GetPublicFolderMailFlowSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetPublicFolderMailFlowSettings", 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 SetPublicFolderMailFlowSettings(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { + object[] results = this.Invoke("SetPublicFolderMailFlowSettings", new object[] { + itemId, + accountId, + acceptAccounts, + rejectAccounts, + requireSenderAuthentication}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginSetPublicFolderMailFlowSettings(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetPublicFolderMailFlowSettings", new object[] { + itemId, + accountId, + acceptAccounts, + rejectAccounts, + requireSenderAuthentication}, callback, asyncState); + } + + /// + public int EndSetPublicFolderMailFlowSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void SetPublicFolderMailFlowSettingsAsync(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { + this.SetPublicFolderMailFlowSettingsAsync(itemId, accountId, acceptAccounts, rejectAccounts, requireSenderAuthentication, null); + } + + /// + public void SetPublicFolderMailFlowSettingsAsync(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, object userState) { + if ((this.SetPublicFolderMailFlowSettingsOperationCompleted == null)) { + this.SetPublicFolderMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetPublicFolderMailFlowSettingsOperationCompleted); + } + this.InvokeAsync("SetPublicFolderMailFlowSettings", new object[] { + itemId, + accountId, + acceptAccounts, + rejectAccounts, + requireSenderAuthentication}, this.SetPublicFolderMailFlowSettingsOperationCompleted, userState); + } + + private void OnSetPublicFolderMailFlowSettingsOperationCompleted(object arg) { + if ((this.SetPublicFolderMailFlowSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetPublicFolderMailFlowSettingsCompleted(this, new SetPublicFolderMailFlowSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPublicFolderEmailAddresses", 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 ExchangeEmailAddress[] GetPublicFolderEmailAddresses(int itemId, int accountId) { + object[] results = this.Invoke("GetPublicFolderEmailAddresses", new object[] { + itemId, + accountId}); + return ((ExchangeEmailAddress[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetPublicFolderEmailAddresses(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetPublicFolderEmailAddresses", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public ExchangeEmailAddress[] EndGetPublicFolderEmailAddresses(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeEmailAddress[])(results[0])); + } + + /// + public void GetPublicFolderEmailAddressesAsync(int itemId, int accountId) { + this.GetPublicFolderEmailAddressesAsync(itemId, accountId, null); + } + + /// + public void GetPublicFolderEmailAddressesAsync(int itemId, int accountId, object userState) { + if ((this.GetPublicFolderEmailAddressesOperationCompleted == null)) { + this.GetPublicFolderEmailAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPublicFolderEmailAddressesOperationCompleted); + } + this.InvokeAsync("GetPublicFolderEmailAddresses", new object[] { + itemId, + accountId}, this.GetPublicFolderEmailAddressesOperationCompleted, userState); + } + + private void OnGetPublicFolderEmailAddressesOperationCompleted(object arg) { + if ((this.GetPublicFolderEmailAddressesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetPublicFolderEmailAddressesCompleted(this, new GetPublicFolderEmailAddressesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddPublicFolderEmailAddress", 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 AddPublicFolderEmailAddress(int itemId, int accountId, string emailAddress) { + object[] results = this.Invoke("AddPublicFolderEmailAddress", new object[] { + itemId, + accountId, + emailAddress}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginAddPublicFolderEmailAddress(int itemId, int accountId, string emailAddress, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("AddPublicFolderEmailAddress", new object[] { + itemId, + accountId, + emailAddress}, callback, asyncState); + } + + /// + public int EndAddPublicFolderEmailAddress(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void AddPublicFolderEmailAddressAsync(int itemId, int accountId, string emailAddress) { + this.AddPublicFolderEmailAddressAsync(itemId, accountId, emailAddress, null); + } + + /// + public void AddPublicFolderEmailAddressAsync(int itemId, int accountId, string emailAddress, object userState) { + if ((this.AddPublicFolderEmailAddressOperationCompleted == null)) { + this.AddPublicFolderEmailAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddPublicFolderEmailAddressOperationCompleted); + } + this.InvokeAsync("AddPublicFolderEmailAddress", new object[] { + itemId, + accountId, + emailAddress}, this.AddPublicFolderEmailAddressOperationCompleted, userState); + } + + private void OnAddPublicFolderEmailAddressOperationCompleted(object arg) { + if ((this.AddPublicFolderEmailAddressCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddPublicFolderEmailAddressCompleted(this, new AddPublicFolderEmailAddressCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetPublicFolderPrimaryEmailAddress", 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 SetPublicFolderPrimaryEmailAddress(int itemId, int accountId, string emailAddress) { + object[] results = this.Invoke("SetPublicFolderPrimaryEmailAddress", new object[] { + itemId, + accountId, + emailAddress}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginSetPublicFolderPrimaryEmailAddress(int itemId, int accountId, string emailAddress, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetPublicFolderPrimaryEmailAddress", new object[] { + itemId, + accountId, + emailAddress}, callback, asyncState); + } + + /// + public int EndSetPublicFolderPrimaryEmailAddress(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void SetPublicFolderPrimaryEmailAddressAsync(int itemId, int accountId, string emailAddress) { + this.SetPublicFolderPrimaryEmailAddressAsync(itemId, accountId, emailAddress, null); + } + + /// + public void SetPublicFolderPrimaryEmailAddressAsync(int itemId, int accountId, string emailAddress, object userState) { + if ((this.SetPublicFolderPrimaryEmailAddressOperationCompleted == null)) { + this.SetPublicFolderPrimaryEmailAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetPublicFolderPrimaryEmailAddressOperationCompleted); + } + this.InvokeAsync("SetPublicFolderPrimaryEmailAddress", new object[] { + itemId, + accountId, + emailAddress}, this.SetPublicFolderPrimaryEmailAddressOperationCompleted, userState); + } + + private void OnSetPublicFolderPrimaryEmailAddressOperationCompleted(object arg) { + if ((this.SetPublicFolderPrimaryEmailAddressCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetPublicFolderPrimaryEmailAddressCompleted(this, new SetPublicFolderPrimaryEmailAddressCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeletePublicFolderEmailAddresses", 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 DeletePublicFolderEmailAddresses(int itemId, int accountId, string[] emailAddresses) { + object[] results = this.Invoke("DeletePublicFolderEmailAddresses", new object[] { + itemId, + accountId, + emailAddresses}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginDeletePublicFolderEmailAddresses(int itemId, int accountId, string[] emailAddresses, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeletePublicFolderEmailAddresses", new object[] { + itemId, + accountId, + emailAddresses}, callback, asyncState); + } + + /// + public int EndDeletePublicFolderEmailAddresses(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void DeletePublicFolderEmailAddressesAsync(int itemId, int accountId, string[] emailAddresses) { + this.DeletePublicFolderEmailAddressesAsync(itemId, accountId, emailAddresses, null); + } + + /// + public void DeletePublicFolderEmailAddressesAsync(int itemId, int accountId, string[] emailAddresses, object userState) { + if ((this.DeletePublicFolderEmailAddressesOperationCompleted == null)) { + this.DeletePublicFolderEmailAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeletePublicFolderEmailAddressesOperationCompleted); + } + this.InvokeAsync("DeletePublicFolderEmailAddresses", new object[] { + itemId, + accountId, + emailAddresses}, this.DeletePublicFolderEmailAddressesOperationCompleted, userState); + } + + private void OnDeletePublicFolderEmailAddressesOperationCompleted(object arg) { + if ((this.DeletePublicFolderEmailAddressesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeletePublicFolderEmailAddressesCompleted(this, new DeletePublicFolderEmailAddressesCompletedEventArgs(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.42")] - public delegate void GetPublicFolderMailFlowSettingsCompletedEventHandler(object sender, GetPublicFolderMailFlowSettingsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPublicFolderMailFlowSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetPublicFolderMailFlowSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangePublicFolder Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangePublicFolder)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void SetPublicFolderMailFlowSettingsCompletedEventHandler(object sender, SetPublicFolderMailFlowSettingsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetPublicFolderMailFlowSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal SetPublicFolderMailFlowSettingsCompletedEventArgs(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])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetPublicFolderEmailAddressesCompletedEventHandler(object sender, GetPublicFolderEmailAddressesCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPublicFolderEmailAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetPublicFolderEmailAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeEmailAddress[] Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeEmailAddress[])(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void AddPublicFolderEmailAddressCompletedEventHandler(object sender, AddPublicFolderEmailAddressCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddPublicFolderEmailAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal AddPublicFolderEmailAddressCompletedEventArgs(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])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void SetPublicFolderPrimaryEmailAddressCompletedEventHandler(object sender, SetPublicFolderPrimaryEmailAddressCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetPublicFolderPrimaryEmailAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal SetPublicFolderPrimaryEmailAddressCompletedEventArgs(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])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void DeletePublicFolderEmailAddressesCompletedEventHandler(object sender, DeletePublicFolderEmailAddressesCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeletePublicFolderEmailAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal DeletePublicFolderEmailAddressesCompletedEventArgs(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])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetMobileDevicesCompletedEventHandler(object sender, GetMobileDevicesCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetMobileDevicesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetMobileDevicesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeMobileDevice[] Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeMobileDevice[])(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetMobileDeviceCompletedEventHandler(object sender, GetMobileDeviceCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetMobileDeviceCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetMobileDeviceCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeMobileDevice Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeMobileDevice)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void WipeDataFromDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void CancelRemoteWipeRequestCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void RemoveDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetRawExchangeOrganizationsPagedCompletedEventHandler(object sender, GetRawExchangeOrganizationsPagedCompletedEventArgs e); @@ -4957,26 +4753,26 @@ namespace WebsitePanel.EnterpriseServer /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetPublicFoldersStatisticsCompletedEventHandler(object sender, GetPublicFoldersStatisticsCompletedEventArgs e); + public delegate void GetMailboxStatisticsCompletedEventHandler(object sender, GetMailboxStatisticsCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPublicFoldersStatisticsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetMailboxStatisticsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - internal GetPublicFoldersStatisticsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + internal GetMailboxStatisticsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } /// - public ExchangeItemStatistics[] Result { + public ExchangeMailboxStatistics Result { get { this.RaiseExceptionIfNecessary(); - return ((ExchangeItemStatistics[])(this.results[0])); + return ((ExchangeMailboxStatistics)(this.results[0])); } } } @@ -5163,6 +4959,32 @@ namespace WebsitePanel.EnterpriseServer } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetExchangeAccountByMailboxPlanIdCompletedEventHandler(object sender, GetExchangeAccountByMailboxPlanIdCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetExchangeAccountByMailboxPlanIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetExchangeAccountByMailboxPlanIdCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangeAccount[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangeAccount[])(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void SearchAccountsCompletedEventHandler(object sender, SearchAccountsCompletedEventArgs e); @@ -5555,43 +5377,17 @@ namespace WebsitePanel.EnterpriseServer /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetMailboxAdvancedSettingsCompletedEventHandler(object sender, GetMailboxAdvancedSettingsCompletedEventArgs e); + public delegate void SetExchangeMailboxPlanCompletedEventHandler(object sender, SetExchangeMailboxPlanCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetMailboxAdvancedSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class SetExchangeMailboxPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - internal GetMailboxAdvancedSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeMailbox Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeMailbox)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void SetMailboxAdvancedSettingsCompletedEventHandler(object sender, SetMailboxAdvancedSettingsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetMailboxAdvancedSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal SetMailboxAdvancedSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + internal SetExchangeMailboxPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } @@ -6203,6 +5999,178 @@ namespace WebsitePanel.EnterpriseServer } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetMobileDevicesCompletedEventHandler(object sender, GetMobileDevicesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetMobileDevicesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetMobileDevicesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangeMobileDevice[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangeMobileDevice[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetMobileDeviceCompletedEventHandler(object sender, GetMobileDeviceCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetMobileDeviceCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetMobileDeviceCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangeMobileDevice Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangeMobileDevice)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void WipeDataFromDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CancelRemoteWipeRequestCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void RemoveDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetExchangeMailboxPlansCompletedEventHandler(object sender, GetExchangeMailboxPlansCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetExchangeMailboxPlansCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetExchangeMailboxPlansCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangeMailboxPlan[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangeMailboxPlan[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetExchangeMailboxPlanCompletedEventHandler(object sender, GetExchangeMailboxPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetExchangeMailboxPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetExchangeMailboxPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangeMailboxPlan Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangeMailboxPlan)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddExchangeMailboxPlanCompletedEventHandler(object sender, AddExchangeMailboxPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddExchangeMailboxPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddExchangeMailboxPlanCompletedEventArgs(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])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteExchangeMailboxPlanCompletedEventHandler(object sender, DeleteExchangeMailboxPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteExchangeMailboxPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeleteExchangeMailboxPlanCompletedEventArgs(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])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetOrganizationDefaultExchangeMailboxPlanCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void CreatePublicFolderCompletedEventHandler(object sender, CreatePublicFolderCompletedEventArgs e); @@ -6384,4 +6352,160 @@ namespace WebsitePanel.EnterpriseServer } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetPublicFolderMailFlowSettingsCompletedEventHandler(object sender, GetPublicFolderMailFlowSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetPublicFolderMailFlowSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetPublicFolderMailFlowSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangePublicFolder Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangePublicFolder)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetPublicFolderMailFlowSettingsCompletedEventHandler(object sender, SetPublicFolderMailFlowSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetPublicFolderMailFlowSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetPublicFolderMailFlowSettingsCompletedEventArgs(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])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetPublicFolderEmailAddressesCompletedEventHandler(object sender, GetPublicFolderEmailAddressesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetPublicFolderEmailAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetPublicFolderEmailAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangeEmailAddress[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangeEmailAddress[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddPublicFolderEmailAddressCompletedEventHandler(object sender, AddPublicFolderEmailAddressCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddPublicFolderEmailAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddPublicFolderEmailAddressCompletedEventArgs(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])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetPublicFolderPrimaryEmailAddressCompletedEventHandler(object sender, SetPublicFolderPrimaryEmailAddressCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetPublicFolderPrimaryEmailAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetPublicFolderPrimaryEmailAddressCompletedEventArgs(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])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeletePublicFolderEmailAddressesCompletedEventHandler(object sender, DeletePublicFolderEmailAddressesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeletePublicFolderEmailAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeletePublicFolderEmailAddressesCompletedEventArgs(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.Client/LyncProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs new file mode 100644 index 00000000..f564e385 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs @@ -0,0 +1,1103 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.5456 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by wsdl, Version=2.0.50727.42. +// +namespace WebsitePanel.EnterpriseServer { + using System.Xml.Serialization; + using System.Web.Services; + using System.ComponentModel; + using System.Web.Services.Protocols; + using System; + using System.Diagnostics; + + using WebsitePanel.Providers.Common; + using WebsitePanel.Providers.HostedSolution; + using WebsitePanel.Providers.ResultObjects; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="esLyncSoap", Namespace="http://tempuri.org/")] + public partial class esLync : Microsoft.Web.Services3.WebServicesClientProtocol { + + private System.Threading.SendOrPostCallback CreateLyncUserOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteLyncUserOperationCompleted; + + private System.Threading.SendOrPostCallback GetLyncUsersPagedOperationCompleted; + + private System.Threading.SendOrPostCallback GetLyncUserCountOperationCompleted; + + private System.Threading.SendOrPostCallback GetLyncUserPlansOperationCompleted; + + private System.Threading.SendOrPostCallback GetLyncUserPlanOperationCompleted; + + private System.Threading.SendOrPostCallback AddLyncUserPlanOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteLyncUserPlanOperationCompleted; + + private System.Threading.SendOrPostCallback SetOrganizationDefaultLyncUserPlanOperationCompleted; + + private System.Threading.SendOrPostCallback GetLyncUserGeneralSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback SetUserLyncPlanOperationCompleted; + + private System.Threading.SendOrPostCallback GetFederationDomainsOperationCompleted; + + private System.Threading.SendOrPostCallback AddFederationDomainOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveFederationDomainOperationCompleted; + + /// + public esLync() { + this.Url = "http://localhost:9005/esLync.asmx"; + } + + /// + public event CreateLyncUserCompletedEventHandler CreateLyncUserCompleted; + + /// + public event DeleteLyncUserCompletedEventHandler DeleteLyncUserCompleted; + + /// + public event GetLyncUsersPagedCompletedEventHandler GetLyncUsersPagedCompleted; + + /// + public event GetLyncUserCountCompletedEventHandler GetLyncUserCountCompleted; + + /// + public event GetLyncUserPlansCompletedEventHandler GetLyncUserPlansCompleted; + + /// + public event GetLyncUserPlanCompletedEventHandler GetLyncUserPlanCompleted; + + /// + public event AddLyncUserPlanCompletedEventHandler AddLyncUserPlanCompleted; + + /// + public event DeleteLyncUserPlanCompletedEventHandler DeleteLyncUserPlanCompleted; + + /// + public event SetOrganizationDefaultLyncUserPlanCompletedEventHandler SetOrganizationDefaultLyncUserPlanCompleted; + + /// + public event GetLyncUserGeneralSettingsCompletedEventHandler GetLyncUserGeneralSettingsCompleted; + + /// + public event SetUserLyncPlanCompletedEventHandler SetUserLyncPlanCompleted; + + /// + public event GetFederationDomainsCompletedEventHandler GetFederationDomainsCompleted; + + /// + public event AddFederationDomainCompletedEventHandler AddFederationDomainCompleted; + + /// + public event RemoveFederationDomainCompletedEventHandler RemoveFederationDomainCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateLyncUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUserResult CreateLyncUser(int itemId, int accountId, int lyncUserPlanId) { + object[] results = this.Invoke("CreateLyncUser", new object[] { + itemId, + accountId, + lyncUserPlanId}); + return ((LyncUserResult)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateLyncUser(int itemId, int accountId, int lyncUserPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CreateLyncUser", new object[] { + itemId, + accountId, + lyncUserPlanId}, callback, asyncState); + } + + /// + public LyncUserResult EndCreateLyncUser(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserResult)(results[0])); + } + + /// + public void CreateLyncUserAsync(int itemId, int accountId, int lyncUserPlanId) { + this.CreateLyncUserAsync(itemId, accountId, lyncUserPlanId, null); + } + + /// + public void CreateLyncUserAsync(int itemId, int accountId, int lyncUserPlanId, object userState) { + if ((this.CreateLyncUserOperationCompleted == null)) { + this.CreateLyncUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateLyncUserOperationCompleted); + } + this.InvokeAsync("CreateLyncUser", new object[] { + itemId, + accountId, + lyncUserPlanId}, this.CreateLyncUserOperationCompleted, userState); + } + + private void OnCreateLyncUserOperationCompleted(object arg) { + if ((this.CreateLyncUserCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateLyncUserCompleted(this, new CreateLyncUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteLyncUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject DeleteLyncUser(int itemId, int accountId) { + object[] results = this.Invoke("DeleteLyncUser", new object[] { + itemId, + accountId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteLyncUser(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteLyncUser", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public ResultObject EndDeleteLyncUser(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void DeleteLyncUserAsync(int itemId, int accountId) { + this.DeleteLyncUserAsync(itemId, accountId, null); + } + + /// + public void DeleteLyncUserAsync(int itemId, int accountId, object userState) { + if ((this.DeleteLyncUserOperationCompleted == null)) { + this.DeleteLyncUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteLyncUserOperationCompleted); + } + this.InvokeAsync("DeleteLyncUser", new object[] { + itemId, + accountId}, this.DeleteLyncUserOperationCompleted, userState); + } + + private void OnDeleteLyncUserOperationCompleted(object arg) { + if ((this.DeleteLyncUserCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteLyncUserCompleted(this, new DeleteLyncUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetLyncUsersPaged", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUsersPagedResult GetLyncUsersPaged(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows) { + object[] results = this.Invoke("GetLyncUsersPaged", new object[] { + itemId, + sortColumn, + sortDirection, + startRow, + maximumRows}); + return ((LyncUsersPagedResult)(results[0])); + } + + /// + public System.IAsyncResult BeginGetLyncUsersPaged(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetLyncUsersPaged", new object[] { + itemId, + sortColumn, + sortDirection, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public LyncUsersPagedResult EndGetLyncUsersPaged(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUsersPagedResult)(results[0])); + } + + /// + public void GetLyncUsersPagedAsync(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows) { + this.GetLyncUsersPagedAsync(itemId, sortColumn, sortDirection, startRow, maximumRows, null); + } + + /// + public void GetLyncUsersPagedAsync(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows, object userState) { + if ((this.GetLyncUsersPagedOperationCompleted == null)) { + this.GetLyncUsersPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUsersPagedOperationCompleted); + } + this.InvokeAsync("GetLyncUsersPaged", new object[] { + itemId, + sortColumn, + sortDirection, + startRow, + maximumRows}, this.GetLyncUsersPagedOperationCompleted, userState); + } + + private void OnGetLyncUsersPagedOperationCompleted(object arg) { + if ((this.GetLyncUsersPagedCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetLyncUsersPagedCompleted(this, new GetLyncUsersPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetLyncUserCount", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public IntResult GetLyncUserCount(int itemId) { + object[] results = this.Invoke("GetLyncUserCount", new object[] { + itemId}); + return ((IntResult)(results[0])); + } + + /// + public System.IAsyncResult BeginGetLyncUserCount(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetLyncUserCount", new object[] { + itemId}, callback, asyncState); + } + + /// + public IntResult EndGetLyncUserCount(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((IntResult)(results[0])); + } + + /// + public void GetLyncUserCountAsync(int itemId) { + this.GetLyncUserCountAsync(itemId, null); + } + + /// + public void GetLyncUserCountAsync(int itemId, object userState) { + if ((this.GetLyncUserCountOperationCompleted == null)) { + this.GetLyncUserCountOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUserCountOperationCompleted); + } + this.InvokeAsync("GetLyncUserCount", new object[] { + itemId}, this.GetLyncUserCountOperationCompleted, userState); + } + + private void OnGetLyncUserCountOperationCompleted(object arg) { + if ((this.GetLyncUserCountCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetLyncUserCountCompleted(this, new GetLyncUserCountCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetLyncUserPlans", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUserPlan[] GetLyncUserPlans(int itemId) { + object[] results = this.Invoke("GetLyncUserPlans", new object[] { + itemId}); + return ((LyncUserPlan[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetLyncUserPlans(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetLyncUserPlans", new object[] { + itemId}, callback, asyncState); + } + + /// + public LyncUserPlan[] EndGetLyncUserPlans(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserPlan[])(results[0])); + } + + /// + public void GetLyncUserPlansAsync(int itemId) { + this.GetLyncUserPlansAsync(itemId, null); + } + + /// + public void GetLyncUserPlansAsync(int itemId, object userState) { + if ((this.GetLyncUserPlansOperationCompleted == null)) { + this.GetLyncUserPlansOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUserPlansOperationCompleted); + } + this.InvokeAsync("GetLyncUserPlans", new object[] { + itemId}, this.GetLyncUserPlansOperationCompleted, userState); + } + + private void OnGetLyncUserPlansOperationCompleted(object arg) { + if ((this.GetLyncUserPlansCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetLyncUserPlansCompleted(this, new GetLyncUserPlansCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetLyncUserPlan", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUserPlan GetLyncUserPlan(int itemId, int lyncUserPlanId) { + object[] results = this.Invoke("GetLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}); + return ((LyncUserPlan)(results[0])); + } + + /// + public System.IAsyncResult BeginGetLyncUserPlan(int itemId, int lyncUserPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}, callback, asyncState); + } + + /// + public LyncUserPlan EndGetLyncUserPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserPlan)(results[0])); + } + + /// + public void GetLyncUserPlanAsync(int itemId, int lyncUserPlanId) { + this.GetLyncUserPlanAsync(itemId, lyncUserPlanId, null); + } + + /// + public void GetLyncUserPlanAsync(int itemId, int lyncUserPlanId, object userState) { + if ((this.GetLyncUserPlanOperationCompleted == null)) { + this.GetLyncUserPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUserPlanOperationCompleted); + } + this.InvokeAsync("GetLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}, this.GetLyncUserPlanOperationCompleted, userState); + } + + private void OnGetLyncUserPlanOperationCompleted(object arg) { + if ((this.GetLyncUserPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetLyncUserPlanCompleted(this, new GetLyncUserPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddLyncUserPlan", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int AddLyncUserPlan(int itemId, LyncUserPlan lyncUserPlan) { + object[] results = this.Invoke("AddLyncUserPlan", new object[] { + itemId, + lyncUserPlan}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginAddLyncUserPlan(int itemId, LyncUserPlan lyncUserPlan, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("AddLyncUserPlan", new object[] { + itemId, + lyncUserPlan}, callback, asyncState); + } + + /// + public int EndAddLyncUserPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void AddLyncUserPlanAsync(int itemId, LyncUserPlan lyncUserPlan) { + this.AddLyncUserPlanAsync(itemId, lyncUserPlan, null); + } + + /// + public void AddLyncUserPlanAsync(int itemId, LyncUserPlan lyncUserPlan, object userState) { + if ((this.AddLyncUserPlanOperationCompleted == null)) { + this.AddLyncUserPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddLyncUserPlanOperationCompleted); + } + this.InvokeAsync("AddLyncUserPlan", new object[] { + itemId, + lyncUserPlan}, this.AddLyncUserPlanOperationCompleted, userState); + } + + private void OnAddLyncUserPlanOperationCompleted(object arg) { + if ((this.AddLyncUserPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddLyncUserPlanCompleted(this, new AddLyncUserPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteLyncUserPlan", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DeleteLyncUserPlan(int itemId, int lyncUserPlanId) { + object[] results = this.Invoke("DeleteLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteLyncUserPlan(int itemId, int lyncUserPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}, callback, asyncState); + } + + /// + public int EndDeleteLyncUserPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void DeleteLyncUserPlanAsync(int itemId, int lyncUserPlanId) { + this.DeleteLyncUserPlanAsync(itemId, lyncUserPlanId, null); + } + + /// + public void DeleteLyncUserPlanAsync(int itemId, int lyncUserPlanId, object userState) { + if ((this.DeleteLyncUserPlanOperationCompleted == null)) { + this.DeleteLyncUserPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteLyncUserPlanOperationCompleted); + } + this.InvokeAsync("DeleteLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}, this.DeleteLyncUserPlanOperationCompleted, userState); + } + + private void OnDeleteLyncUserPlanOperationCompleted(object arg) { + if ((this.DeleteLyncUserPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteLyncUserPlanCompleted(this, new DeleteLyncUserPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetOrganizationDefaultLyncUserPlan", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int SetOrganizationDefaultLyncUserPlan(int itemId, int lyncUserPlanId) { + object[] results = this.Invoke("SetOrganizationDefaultLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginSetOrganizationDefaultLyncUserPlan(int itemId, int lyncUserPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetOrganizationDefaultLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}, callback, asyncState); + } + + /// + public int EndSetOrganizationDefaultLyncUserPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void SetOrganizationDefaultLyncUserPlanAsync(int itemId, int lyncUserPlanId) { + this.SetOrganizationDefaultLyncUserPlanAsync(itemId, lyncUserPlanId, null); + } + + /// + public void SetOrganizationDefaultLyncUserPlanAsync(int itemId, int lyncUserPlanId, object userState) { + if ((this.SetOrganizationDefaultLyncUserPlanOperationCompleted == null)) { + this.SetOrganizationDefaultLyncUserPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetOrganizationDefaultLyncUserPlanOperationCompleted); + } + this.InvokeAsync("SetOrganizationDefaultLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}, this.SetOrganizationDefaultLyncUserPlanOperationCompleted, userState); + } + + private void OnSetOrganizationDefaultLyncUserPlanOperationCompleted(object arg) { + if ((this.SetOrganizationDefaultLyncUserPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetOrganizationDefaultLyncUserPlanCompleted(this, new SetOrganizationDefaultLyncUserPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetLyncUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUser GetLyncUserGeneralSettings(int itemId, int accountId) { + object[] results = this.Invoke("GetLyncUserGeneralSettings", new object[] { + itemId, + accountId}); + return ((LyncUser)(results[0])); + } + + /// + public System.IAsyncResult BeginGetLyncUserGeneralSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetLyncUserGeneralSettings", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public LyncUser EndGetLyncUserGeneralSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUser)(results[0])); + } + + /// + public void GetLyncUserGeneralSettingsAsync(int itemId, int accountId) { + this.GetLyncUserGeneralSettingsAsync(itemId, accountId, null); + } + + /// + public void GetLyncUserGeneralSettingsAsync(int itemId, int accountId, object userState) { + if ((this.GetLyncUserGeneralSettingsOperationCompleted == null)) { + this.GetLyncUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUserGeneralSettingsOperationCompleted); + } + this.InvokeAsync("GetLyncUserGeneralSettings", new object[] { + itemId, + accountId}, this.GetLyncUserGeneralSettingsOperationCompleted, userState); + } + + private void OnGetLyncUserGeneralSettingsOperationCompleted(object arg) { + if ((this.GetLyncUserGeneralSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetLyncUserGeneralSettingsCompleted(this, new GetLyncUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserLyncPlan", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUserResult SetUserLyncPlan(int itemId, int accountId, int lyncUserPlanId) { + object[] results = this.Invoke("SetUserLyncPlan", new object[] { + itemId, + accountId, + lyncUserPlanId}); + return ((LyncUserResult)(results[0])); + } + + /// + public System.IAsyncResult BeginSetUserLyncPlan(int itemId, int accountId, int lyncUserPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetUserLyncPlan", new object[] { + itemId, + accountId, + lyncUserPlanId}, callback, asyncState); + } + + /// + public LyncUserResult EndSetUserLyncPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserResult)(results[0])); + } + + /// + public void SetUserLyncPlanAsync(int itemId, int accountId, int lyncUserPlanId) { + this.SetUserLyncPlanAsync(itemId, accountId, lyncUserPlanId, null); + } + + /// + public void SetUserLyncPlanAsync(int itemId, int accountId, int lyncUserPlanId, object userState) { + if ((this.SetUserLyncPlanOperationCompleted == null)) { + this.SetUserLyncPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserLyncPlanOperationCompleted); + } + this.InvokeAsync("SetUserLyncPlan", new object[] { + itemId, + accountId, + lyncUserPlanId}, this.SetUserLyncPlanOperationCompleted, userState); + } + + private void OnSetUserLyncPlanOperationCompleted(object arg) { + if ((this.SetUserLyncPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetUserLyncPlanCompleted(this, new SetUserLyncPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetFederationDomains", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncFederationDomain[] GetFederationDomains(int itemId) { + object[] results = this.Invoke("GetFederationDomains", new object[] { + itemId}); + return ((LyncFederationDomain[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetFederationDomains(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetFederationDomains", new object[] { + itemId}, callback, asyncState); + } + + /// + public LyncFederationDomain[] EndGetFederationDomains(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncFederationDomain[])(results[0])); + } + + /// + public void GetFederationDomainsAsync(int itemId) { + this.GetFederationDomainsAsync(itemId, null); + } + + /// + public void GetFederationDomainsAsync(int itemId, object userState) { + if ((this.GetFederationDomainsOperationCompleted == null)) { + this.GetFederationDomainsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFederationDomainsOperationCompleted); + } + this.InvokeAsync("GetFederationDomains", new object[] { + itemId}, this.GetFederationDomainsOperationCompleted, userState); + } + + private void OnGetFederationDomainsOperationCompleted(object arg) { + if ((this.GetFederationDomainsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetFederationDomainsCompleted(this, new GetFederationDomainsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddFederationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUserResult AddFederationDomain(int itemId, string domainName, string proxyFqdn) { + object[] results = this.Invoke("AddFederationDomain", new object[] { + itemId, + domainName, + proxyFqdn}); + return ((LyncUserResult)(results[0])); + } + + /// + public System.IAsyncResult BeginAddFederationDomain(int itemId, string domainName, string proxyFqdn, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("AddFederationDomain", new object[] { + itemId, + domainName, + proxyFqdn}, callback, asyncState); + } + + /// + public LyncUserResult EndAddFederationDomain(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserResult)(results[0])); + } + + /// + public void AddFederationDomainAsync(int itemId, string domainName, string proxyFqdn) { + this.AddFederationDomainAsync(itemId, domainName, proxyFqdn, null); + } + + /// + public void AddFederationDomainAsync(int itemId, string domainName, string proxyFqdn, object userState) { + if ((this.AddFederationDomainOperationCompleted == null)) { + this.AddFederationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddFederationDomainOperationCompleted); + } + this.InvokeAsync("AddFederationDomain", new object[] { + itemId, + domainName, + proxyFqdn}, this.AddFederationDomainOperationCompleted, userState); + } + + private void OnAddFederationDomainOperationCompleted(object arg) { + if ((this.AddFederationDomainCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddFederationDomainCompleted(this, new AddFederationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/RemoveFederationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUserResult RemoveFederationDomain(int itemId, string domainName) { + object[] results = this.Invoke("RemoveFederationDomain", new object[] { + itemId, + domainName}); + return ((LyncUserResult)(results[0])); + } + + /// + public System.IAsyncResult BeginRemoveFederationDomain(int itemId, string domainName, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("RemoveFederationDomain", new object[] { + itemId, + domainName}, callback, asyncState); + } + + /// + public LyncUserResult EndRemoveFederationDomain(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserResult)(results[0])); + } + + /// + public void RemoveFederationDomainAsync(int itemId, string domainName) { + this.RemoveFederationDomainAsync(itemId, domainName, null); + } + + /// + public void RemoveFederationDomainAsync(int itemId, string domainName, object userState) { + if ((this.RemoveFederationDomainOperationCompleted == null)) { + this.RemoveFederationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveFederationDomainOperationCompleted); + } + this.InvokeAsync("RemoveFederationDomain", new object[] { + itemId, + domainName}, this.RemoveFederationDomainOperationCompleted, userState); + } + + private void OnRemoveFederationDomainOperationCompleted(object arg) { + if ((this.RemoveFederationDomainCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveFederationDomainCompleted(this, new RemoveFederationDomainCompletedEventArgs(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.42")] + public delegate void CreateLyncUserCompletedEventHandler(object sender, CreateLyncUserCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateLyncUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateLyncUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncUserResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUserResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteLyncUserCompletedEventHandler(object sender, DeleteLyncUserCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteLyncUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeleteLyncUserCompletedEventArgs(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.42")] + public delegate void GetLyncUsersPagedCompletedEventHandler(object sender, GetLyncUsersPagedCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetLyncUsersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetLyncUsersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncUsersPagedResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUsersPagedResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetLyncUserCountCompletedEventHandler(object sender, GetLyncUserCountCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetLyncUserCountCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetLyncUserCountCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public IntResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((IntResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetLyncUserPlansCompletedEventHandler(object sender, GetLyncUserPlansCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetLyncUserPlansCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetLyncUserPlansCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncUserPlan[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUserPlan[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetLyncUserPlanCompletedEventHandler(object sender, GetLyncUserPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetLyncUserPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncUserPlan Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUserPlan)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddLyncUserPlanCompletedEventHandler(object sender, AddLyncUserPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddLyncUserPlanCompletedEventArgs(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])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteLyncUserPlanCompletedEventHandler(object sender, DeleteLyncUserPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeleteLyncUserPlanCompletedEventArgs(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])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetOrganizationDefaultLyncUserPlanCompletedEventHandler(object sender, SetOrganizationDefaultLyncUserPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetOrganizationDefaultLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetOrganizationDefaultLyncUserPlanCompletedEventArgs(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])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetLyncUserGeneralSettingsCompletedEventHandler(object sender, GetLyncUserGeneralSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetLyncUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetLyncUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncUser Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUser)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetUserLyncPlanCompletedEventHandler(object sender, SetUserLyncPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetUserLyncPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetUserLyncPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncUserResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUserResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetFederationDomainsCompletedEventHandler(object sender, GetFederationDomainsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetFederationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetFederationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncFederationDomain[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncFederationDomain[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddFederationDomainCompletedEventHandler(object sender, AddFederationDomainCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddFederationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddFederationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncUserResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUserResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void RemoveFederationDomainCompletedEventHandler(object sender, RemoveFederationDomainCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RemoveFederationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal RemoveFederationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncUserResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUserResult)(this.results[0])); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs index a178d57c..f7164f03 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs @@ -1,35 +1,7 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 +// Runtime Version:2.0.50727.5456 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -39,162 +11,180 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.42. // -using WebsitePanel.Providers; -using WebsitePanel.Providers.Common; -using WebsitePanel.Providers.HostedSolution; -using WebsitePanel.Providers.ResultObjects; - -namespace WebsitePanel.EnterpriseServer.HostedSolution { - using System.Diagnostics; +namespace WebsitePanel.EnterpriseServer.HostedSolution +{ + using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; - using System.Xml.Serialization; + using System.Diagnostics; using System.Data; - - + + using WebsitePanel.Providers; + using WebsitePanel.Providers.Common; + using WebsitePanel.Providers.HostedSolution; + using WebsitePanel.Providers.ResultObjects; + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name="esOrganizationsSoap", Namespace="http://tempuri.org/")] + [System.Web.Services.WebServiceBindingAttribute(Name = "esOrganizationsSoap", Namespace = "http://tempuri.org/")] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResultObject))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] - public partial class esOrganizations : Microsoft.Web.Services3.WebServicesClientProtocol { - + public partial class esOrganizations : Microsoft.Web.Services3.WebServicesClientProtocol + { + private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback GetRawOrganizationsPagedOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationsOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationUserSummuryLetterOperationCompleted; - + private System.Threading.SendOrPostCallback SendOrganizationUserSummuryLetterOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationStatisticsOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationOperationCompleted; - + + private System.Threading.SendOrPostCallback GetAccountIdByUserPrincipalNameOperationCompleted; + private System.Threading.SendOrPostCallback AddOrganizationDomainOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationDomainsOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteOrganizationDomainOperationCompleted; - + private System.Threading.SendOrPostCallback SetOrganizationDefaultDomainOperationCompleted; - + private System.Threading.SendOrPostCallback CreateUserOperationCompleted; - + + private System.Threading.SendOrPostCallback ImportUserOperationCompleted; + private System.Threading.SendOrPostCallback GetOrganizationUsersPagedOperationCompleted; - + private System.Threading.SendOrPostCallback GetUserGeneralSettingsOperationCompleted; - + private System.Threading.SendOrPostCallback SetUserGeneralSettingsOperationCompleted; - + private System.Threading.SendOrPostCallback SearchAccountsOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteUserOperationCompleted; - + private System.Threading.SendOrPostCallback GetPasswordPolicyOperationCompleted; - + /// - public esOrganizations() { - this.Url = "http://localhost/WebsitePanelEnterpriseServer/esOrganizations.asmx"; + public esOrganizations() + { + this.Url = "http://localhost:9002/esOrganizations.asmx"; } - + /// public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted; - + /// public event GetRawOrganizationsPagedCompletedEventHandler GetRawOrganizationsPagedCompleted; - + /// public event GetOrganizationsCompletedEventHandler GetOrganizationsCompleted; - + /// public event GetOrganizationUserSummuryLetterCompletedEventHandler GetOrganizationUserSummuryLetterCompleted; - + /// public event SendOrganizationUserSummuryLetterCompletedEventHandler SendOrganizationUserSummuryLetterCompleted; - + /// public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted; - + /// public event GetOrganizationStatisticsCompletedEventHandler GetOrganizationStatisticsCompleted; - + /// public event GetOrganizationCompletedEventHandler GetOrganizationCompleted; - + + /// + public event GetAccountIdByUserPrincipalNameCompletedEventHandler GetAccountIdByUserPrincipalNameCompleted; + /// public event AddOrganizationDomainCompletedEventHandler AddOrganizationDomainCompleted; - + /// public event GetOrganizationDomainsCompletedEventHandler GetOrganizationDomainsCompleted; - + /// public event DeleteOrganizationDomainCompletedEventHandler DeleteOrganizationDomainCompleted; - + /// public event SetOrganizationDefaultDomainCompletedEventHandler SetOrganizationDefaultDomainCompleted; - + /// public event CreateUserCompletedEventHandler CreateUserCompleted; - + + /// + public event ImportUserCompletedEventHandler ImportUserCompleted; + /// public event GetOrganizationUsersPagedCompletedEventHandler GetOrganizationUsersPagedCompleted; - + /// public event GetUserGeneralSettingsCompletedEventHandler GetUserGeneralSettingsCompleted; - + /// public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted; - + /// public event SearchAccountsCompletedEventHandler SearchAccountsCompleted; - + /// public event DeleteUserCompletedEventHandler DeleteUserCompleted; - + /// public event GetPasswordPolicyCompletedEventHandler GetPasswordPolicyCompleted; - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int CreateOrganization(int packageId, string organizationID, string organizationName) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganization", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int CreateOrganization(int packageId, string organizationID, string organizationName) + { object[] results = this.Invoke("CreateOrganization", new object[] { packageId, organizationID, organizationName}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginCreateOrganization(int packageId, string organizationID, string organizationName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateOrganization(int packageId, string organizationID, string organizationName, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("CreateOrganization", new object[] { packageId, organizationID, organizationName}, callback, asyncState); } - + /// - public int EndCreateOrganization(System.IAsyncResult asyncResult) { + public int EndCreateOrganization(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName) { + public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName) + { this.CreateOrganizationAsync(packageId, organizationID, organizationName, null); } - + /// - public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName, object userState) { - if ((this.CreateOrganizationOperationCompleted == null)) { + public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName, object userState) + { + if ((this.CreateOrganizationOperationCompleted == null)) + { this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted); } this.InvokeAsync("CreateOrganization", new object[] { @@ -202,17 +192,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { organizationID, organizationName}, this.CreateOrganizationOperationCompleted, userState); } - - private void OnCreateOrganizationOperationCompleted(object arg) { - if ((this.CreateOrganizationCompleted != null)) { + + private void OnCreateOrganizationOperationCompleted(object arg) + { + if ((this.CreateOrganizationCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateOrganizationCompleted(this, new CreateOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetRawOrganizationsPaged", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public System.Data.DataSet GetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetRawOrganizationsPaged", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public System.Data.DataSet GetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { object[] results = this.Invoke("GetRawOrganizationsPaged", new object[] { packageId, recursive, @@ -223,9 +216,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { maximumRows}); return ((System.Data.DataSet)(results[0])); } - + /// - public System.IAsyncResult BeginGetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetRawOrganizationsPaged", new object[] { packageId, recursive, @@ -235,21 +229,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { startRow, maximumRows}, callback, asyncState); } - + /// - public System.Data.DataSet EndGetRawOrganizationsPaged(System.IAsyncResult asyncResult) { + public System.Data.DataSet EndGetRawOrganizationsPaged(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((System.Data.DataSet)(results[0])); } - + /// - public void GetRawOrganizationsPagedAsync(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + public void GetRawOrganizationsPagedAsync(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { this.GetRawOrganizationsPagedAsync(packageId, recursive, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); } - + /// - public void GetRawOrganizationsPagedAsync(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) { - if ((this.GetRawOrganizationsPagedOperationCompleted == null)) { + public void GetRawOrganizationsPagedAsync(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetRawOrganizationsPagedOperationCompleted == null)) + { this.GetRawOrganizationsPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRawOrganizationsPagedOperationCompleted); } this.InvokeAsync("GetRawOrganizationsPaged", new object[] { @@ -261,61 +259,72 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { startRow, maximumRows}, this.GetRawOrganizationsPagedOperationCompleted, userState); } - - private void OnGetRawOrganizationsPagedOperationCompleted(object arg) { - if ((this.GetRawOrganizationsPagedCompleted != null)) { + + private void OnGetRawOrganizationsPagedOperationCompleted(object arg) + { + if ((this.GetRawOrganizationsPagedCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetRawOrganizationsPagedCompleted(this, new GetRawOrganizationsPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizations", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public Organization[] GetOrganizations(int packageId, bool recursive) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizations", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public Organization[] GetOrganizations(int packageId, bool recursive) + { object[] results = this.Invoke("GetOrganizations", new object[] { packageId, recursive}); return ((Organization[])(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizations(int packageId, bool recursive, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizations(int packageId, bool recursive, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizations", new object[] { packageId, recursive}, callback, asyncState); } - + /// - public Organization[] EndGetOrganizations(System.IAsyncResult asyncResult) { + public Organization[] EndGetOrganizations(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((Organization[])(results[0])); } - + /// - public void GetOrganizationsAsync(int packageId, bool recursive) { + public void GetOrganizationsAsync(int packageId, bool recursive) + { this.GetOrganizationsAsync(packageId, recursive, null); } - + /// - public void GetOrganizationsAsync(int packageId, bool recursive, object userState) { - if ((this.GetOrganizationsOperationCompleted == null)) { + public void GetOrganizationsAsync(int packageId, bool recursive, object userState) + { + if ((this.GetOrganizationsOperationCompleted == null)) + { this.GetOrganizationsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationsOperationCompleted); } this.InvokeAsync("GetOrganizations", new object[] { packageId, recursive}, this.GetOrganizationsOperationCompleted, userState); } - - private void OnGetOrganizationsOperationCompleted(object arg) { - if ((this.GetOrganizationsCompleted != null)) { + + private void OnGetOrganizationsOperationCompleted(object arg) + { + if ((this.GetOrganizationsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationsCompleted(this, new GetOrganizationsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUserSummuryLetter", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public string GetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUserSummuryLetter", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup) + { object[] results = this.Invoke("GetOrganizationUserSummuryLetter", new object[] { itemId, accountId, @@ -324,9 +333,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { signup}); return ((string)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationUserSummuryLetter", new object[] { itemId, accountId, @@ -334,21 +344,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { emailMode, signup}, callback, asyncState); } - + /// - public string EndGetOrganizationUserSummuryLetter(System.IAsyncResult asyncResult) { + public string EndGetOrganizationUserSummuryLetter(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } - + /// - public void GetOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup) { + public void GetOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup) + { this.GetOrganizationUserSummuryLetterAsync(itemId, accountId, pmm, emailMode, signup, null); } - + /// - public void GetOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, object userState) { - if ((this.GetOrganizationUserSummuryLetterOperationCompleted == null)) { + public void GetOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, object userState) + { + if ((this.GetOrganizationUserSummuryLetterOperationCompleted == null)) + { this.GetOrganizationUserSummuryLetterOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationUserSummuryLetterOperationCompleted); } this.InvokeAsync("GetOrganizationUserSummuryLetter", new object[] { @@ -358,17 +372,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { emailMode, signup}, this.GetOrganizationUserSummuryLetterOperationCompleted, userState); } - - private void OnGetOrganizationUserSummuryLetterOperationCompleted(object arg) { - if ((this.GetOrganizationUserSummuryLetterCompleted != null)) { + + private void OnGetOrganizationUserSummuryLetterOperationCompleted(object arg) + { + if ((this.GetOrganizationUserSummuryLetterCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationUserSummuryLetterCompleted(this, new GetOrganizationUserSummuryLetterCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendOrganizationUserSummuryLetter", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int SendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendOrganizationUserSummuryLetter", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int SendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc) + { object[] results = this.Invoke("SendOrganizationUserSummuryLetter", new object[] { itemId, accountId, @@ -377,9 +394,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { cc}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginSendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("SendOrganizationUserSummuryLetter", new object[] { itemId, accountId, @@ -387,21 +405,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { to, cc}, callback, asyncState); } - + /// - public int EndSendOrganizationUserSummuryLetter(System.IAsyncResult asyncResult) { + public int EndSendOrganizationUserSummuryLetter(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void SendOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool signup, string to, string cc) { + public void SendOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool signup, string to, string cc) + { this.SendOrganizationUserSummuryLetterAsync(itemId, accountId, signup, to, cc, null); } - + /// - public void SendOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool signup, string to, string cc, object userState) { - if ((this.SendOrganizationUserSummuryLetterOperationCompleted == null)) { + public void SendOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool signup, string to, string cc, object userState) + { + if ((this.SendOrganizationUserSummuryLetterOperationCompleted == null)) + { this.SendOrganizationUserSummuryLetterOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendOrganizationUserSummuryLetterOperationCompleted); } this.InvokeAsync("SendOrganizationUserSummuryLetter", new object[] { @@ -411,350 +433,468 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { to, cc}, this.SendOrganizationUserSummuryLetterOperationCompleted, userState); } - - private void OnSendOrganizationUserSummuryLetterOperationCompleted(object arg) { - if ((this.SendOrganizationUserSummuryLetterCompleted != null)) { + + private void OnSendOrganizationUserSummuryLetterOperationCompleted(object arg) + { + if ((this.SendOrganizationUserSummuryLetterCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SendOrganizationUserSummuryLetterCompleted(this, new SendOrganizationUserSummuryLetterCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int DeleteOrganization(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganization", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DeleteOrganization(int itemId) + { object[] results = this.Invoke("DeleteOrganization", new object[] { itemId}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteOrganization(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteOrganization(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("DeleteOrganization", new object[] { itemId}, callback, asyncState); } - + /// - public int EndDeleteOrganization(System.IAsyncResult asyncResult) { + public int EndDeleteOrganization(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void DeleteOrganizationAsync(int itemId) { + public void DeleteOrganizationAsync(int itemId) + { this.DeleteOrganizationAsync(itemId, null); } - + /// - public void DeleteOrganizationAsync(int itemId, object userState) { - if ((this.DeleteOrganizationOperationCompleted == null)) { + public void DeleteOrganizationAsync(int itemId, object userState) + { + if ((this.DeleteOrganizationOperationCompleted == null)) + { this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted); } this.InvokeAsync("DeleteOrganization", new object[] { itemId}, this.DeleteOrganizationOperationCompleted, userState); } - - private void OnDeleteOrganizationOperationCompleted(object arg) { - if ((this.DeleteOrganizationCompleted != null)) { + + private void OnDeleteOrganizationOperationCompleted(object arg) + { + if ((this.DeleteOrganizationCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteOrganizationCompleted(this, new DeleteOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationStatistics", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationStatistics GetOrganizationStatistics(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationStatistics", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationStatistics GetOrganizationStatistics(int itemId) + { object[] results = this.Invoke("GetOrganizationStatistics", new object[] { itemId}); return ((OrganizationStatistics)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationStatistics(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationStatistics(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationStatistics", new object[] { itemId}, callback, asyncState); } - + /// - public OrganizationStatistics EndGetOrganizationStatistics(System.IAsyncResult asyncResult) { + public OrganizationStatistics EndGetOrganizationStatistics(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationStatistics)(results[0])); } - + /// - public void GetOrganizationStatisticsAsync(int itemId) { + public void GetOrganizationStatisticsAsync(int itemId) + { this.GetOrganizationStatisticsAsync(itemId, null); } - + /// - public void GetOrganizationStatisticsAsync(int itemId, object userState) { - if ((this.GetOrganizationStatisticsOperationCompleted == null)) { + public void GetOrganizationStatisticsAsync(int itemId, object userState) + { + if ((this.GetOrganizationStatisticsOperationCompleted == null)) + { this.GetOrganizationStatisticsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationStatisticsOperationCompleted); } this.InvokeAsync("GetOrganizationStatistics", new object[] { itemId}, this.GetOrganizationStatisticsOperationCompleted, userState); } - - private void OnGetOrganizationStatisticsOperationCompleted(object arg) { - if ((this.GetOrganizationStatisticsCompleted != null)) { + + private void OnGetOrganizationStatisticsOperationCompleted(object arg) + { + if ((this.GetOrganizationStatisticsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationStatisticsCompleted(this, new GetOrganizationStatisticsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public Organization GetOrganization(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganization", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public Organization GetOrganization(int itemId) + { object[] results = this.Invoke("GetOrganization", new object[] { itemId}); return ((Organization)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganization(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganization(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganization", new object[] { itemId}, callback, asyncState); } - + /// - public Organization EndGetOrganization(System.IAsyncResult asyncResult) { + public Organization EndGetOrganization(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((Organization)(results[0])); } - + /// - public void GetOrganizationAsync(int itemId) { + public void GetOrganizationAsync(int itemId) + { this.GetOrganizationAsync(itemId, null); } - + /// - public void GetOrganizationAsync(int itemId, object userState) { - if ((this.GetOrganizationOperationCompleted == null)) { + public void GetOrganizationAsync(int itemId, object userState) + { + if ((this.GetOrganizationOperationCompleted == null)) + { this.GetOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationOperationCompleted); } this.InvokeAsync("GetOrganization", new object[] { itemId}, this.GetOrganizationOperationCompleted, userState); } - - private void OnGetOrganizationOperationCompleted(object arg) { - if ((this.GetOrganizationCompleted != null)) { + + private void OnGetOrganizationOperationCompleted(object arg) + { + if ((this.GetOrganizationCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationCompleted(this, new GetOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddOrganizationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int AddOrganizationDomain(int itemId, string domainName) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetAccountIdByUserPrincipalName", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int GetAccountIdByUserPrincipalName(int itemId, string userPrincipalName) + { + object[] results = this.Invoke("GetAccountIdByUserPrincipalName", new object[] { + itemId, + userPrincipalName}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginGetAccountIdByUserPrincipalName(int itemId, string userPrincipalName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetAccountIdByUserPrincipalName", new object[] { + itemId, + userPrincipalName}, callback, asyncState); + } + + /// + public int EndGetAccountIdByUserPrincipalName(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void GetAccountIdByUserPrincipalNameAsync(int itemId, string userPrincipalName) + { + this.GetAccountIdByUserPrincipalNameAsync(itemId, userPrincipalName, null); + } + + /// + public void GetAccountIdByUserPrincipalNameAsync(int itemId, string userPrincipalName, object userState) + { + if ((this.GetAccountIdByUserPrincipalNameOperationCompleted == null)) + { + this.GetAccountIdByUserPrincipalNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAccountIdByUserPrincipalNameOperationCompleted); + } + this.InvokeAsync("GetAccountIdByUserPrincipalName", new object[] { + itemId, + userPrincipalName}, this.GetAccountIdByUserPrincipalNameOperationCompleted, userState); + } + + private void OnGetAccountIdByUserPrincipalNameOperationCompleted(object arg) + { + if ((this.GetAccountIdByUserPrincipalNameCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetAccountIdByUserPrincipalNameCompleted(this, new GetAccountIdByUserPrincipalNameCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddOrganizationDomain", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int AddOrganizationDomain(int itemId, string domainName) + { object[] results = this.Invoke("AddOrganizationDomain", new object[] { itemId, domainName}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginAddOrganizationDomain(int itemId, string domainName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginAddOrganizationDomain(int itemId, string domainName, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("AddOrganizationDomain", new object[] { itemId, domainName}, callback, asyncState); } - + /// - public int EndAddOrganizationDomain(System.IAsyncResult asyncResult) { + public int EndAddOrganizationDomain(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void AddOrganizationDomainAsync(int itemId, string domainName) { + public void AddOrganizationDomainAsync(int itemId, string domainName) + { this.AddOrganizationDomainAsync(itemId, domainName, null); } - + /// - public void AddOrganizationDomainAsync(int itemId, string domainName, object userState) { - if ((this.AddOrganizationDomainOperationCompleted == null)) { + public void AddOrganizationDomainAsync(int itemId, string domainName, object userState) + { + if ((this.AddOrganizationDomainOperationCompleted == null)) + { this.AddOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddOrganizationDomainOperationCompleted); } this.InvokeAsync("AddOrganizationDomain", new object[] { itemId, domainName}, this.AddOrganizationDomainOperationCompleted, userState); } - - private void OnAddOrganizationDomainOperationCompleted(object arg) { - if ((this.AddOrganizationDomainCompleted != null)) { + + private void OnAddOrganizationDomainOperationCompleted(object arg) + { + if ((this.AddOrganizationDomainCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.AddOrganizationDomainCompleted(this, new AddOrganizationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationDomains", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationDomainName[] GetOrganizationDomains(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationDomains", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationDomainName[] GetOrganizationDomains(int itemId) + { object[] results = this.Invoke("GetOrganizationDomains", new object[] { itemId}); return ((OrganizationDomainName[])(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationDomains(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationDomains(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationDomains", new object[] { itemId}, callback, asyncState); } - + /// - public OrganizationDomainName[] EndGetOrganizationDomains(System.IAsyncResult asyncResult) { + public OrganizationDomainName[] EndGetOrganizationDomains(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationDomainName[])(results[0])); } - + /// - public void GetOrganizationDomainsAsync(int itemId) { + public void GetOrganizationDomainsAsync(int itemId) + { this.GetOrganizationDomainsAsync(itemId, null); } - + /// - public void GetOrganizationDomainsAsync(int itemId, object userState) { - if ((this.GetOrganizationDomainsOperationCompleted == null)) { + public void GetOrganizationDomainsAsync(int itemId, object userState) + { + if ((this.GetOrganizationDomainsOperationCompleted == null)) + { this.GetOrganizationDomainsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationDomainsOperationCompleted); } this.InvokeAsync("GetOrganizationDomains", new object[] { itemId}, this.GetOrganizationDomainsOperationCompleted, userState); } - - private void OnGetOrganizationDomainsOperationCompleted(object arg) { - if ((this.GetOrganizationDomainsCompleted != null)) { + + private void OnGetOrganizationDomainsOperationCompleted(object arg) + { + if ((this.GetOrganizationDomainsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationDomainsCompleted(this, new GetOrganizationDomainsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganizationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int DeleteOrganizationDomain(int itemId, int domainId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganizationDomain", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DeleteOrganizationDomain(int itemId, int domainId) + { object[] results = this.Invoke("DeleteOrganizationDomain", new object[] { itemId, domainId}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteOrganizationDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteOrganizationDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("DeleteOrganizationDomain", new object[] { itemId, domainId}, callback, asyncState); } - + /// - public int EndDeleteOrganizationDomain(System.IAsyncResult asyncResult) { + public int EndDeleteOrganizationDomain(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void DeleteOrganizationDomainAsync(int itemId, int domainId) { + public void DeleteOrganizationDomainAsync(int itemId, int domainId) + { this.DeleteOrganizationDomainAsync(itemId, domainId, null); } - + /// - public void DeleteOrganizationDomainAsync(int itemId, int domainId, object userState) { - if ((this.DeleteOrganizationDomainOperationCompleted == null)) { + public void DeleteOrganizationDomainAsync(int itemId, int domainId, object userState) + { + if ((this.DeleteOrganizationDomainOperationCompleted == null)) + { this.DeleteOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationDomainOperationCompleted); } this.InvokeAsync("DeleteOrganizationDomain", new object[] { itemId, domainId}, this.DeleteOrganizationDomainOperationCompleted, userState); } - - private void OnDeleteOrganizationDomainOperationCompleted(object arg) { - if ((this.DeleteOrganizationDomainCompleted != null)) { + + private void OnDeleteOrganizationDomainOperationCompleted(object arg) + { + if ((this.DeleteOrganizationDomainCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteOrganizationDomainCompleted(this, new DeleteOrganizationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetOrganizationDefaultDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int SetOrganizationDefaultDomain(int itemId, int domainId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetOrganizationDefaultDomain", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int SetOrganizationDefaultDomain(int itemId, int domainId) + { object[] results = this.Invoke("SetOrganizationDefaultDomain", new object[] { itemId, domainId}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginSetOrganizationDefaultDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetOrganizationDefaultDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("SetOrganizationDefaultDomain", new object[] { itemId, domainId}, callback, asyncState); } - + /// - public int EndSetOrganizationDefaultDomain(System.IAsyncResult asyncResult) { + public int EndSetOrganizationDefaultDomain(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void SetOrganizationDefaultDomainAsync(int itemId, int domainId) { + public void SetOrganizationDefaultDomainAsync(int itemId, int domainId) + { this.SetOrganizationDefaultDomainAsync(itemId, domainId, null); } - + /// - public void SetOrganizationDefaultDomainAsync(int itemId, int domainId, object userState) { - if ((this.SetOrganizationDefaultDomainOperationCompleted == null)) { + public void SetOrganizationDefaultDomainAsync(int itemId, int domainId, object userState) + { + if ((this.SetOrganizationDefaultDomainOperationCompleted == null)) + { this.SetOrganizationDefaultDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetOrganizationDefaultDomainOperationCompleted); } this.InvokeAsync("SetOrganizationDefaultDomain", new object[] { itemId, domainId}, this.SetOrganizationDefaultDomainOperationCompleted, userState); } - - private void OnSetOrganizationDefaultDomainOperationCompleted(object arg) { - if ((this.SetOrganizationDefaultDomainCompleted != null)) { + + private void OnSetOrganizationDefaultDomainOperationCompleted(object arg) + { + if ((this.SetOrganizationDefaultDomainCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetOrganizationDefaultDomainCompleted(this, new SetOrganizationDefaultDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int CreateUser(int itemId, string displayName, string name, string domain, string password, bool sendNotification, string to) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateUser", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int CreateUser(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to) + { object[] results = this.Invoke("CreateUser", new object[] { itemId, displayName, name, domain, password, + subscriberNumber, sendNotification, to}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginCreateUser(int itemId, string displayName, string name, string domain, string password, bool sendNotification, string to, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateUser(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("CreateUser", new object[] { itemId, displayName, name, domain, password, + subscriberNumber, sendNotification, to}, callback, asyncState); } - + /// - public int EndCreateUser(System.IAsyncResult asyncResult) { + public int EndCreateUser(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void CreateUserAsync(int itemId, string displayName, string name, string domain, string password, bool sendNotification, string to) { - this.CreateUserAsync(itemId, displayName, name, domain, password, sendNotification, to, null); + public void CreateUserAsync(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to) + { + this.CreateUserAsync(itemId, displayName, name, domain, password, subscriberNumber, sendNotification, to, null); } - + /// - public void CreateUserAsync(int itemId, string displayName, string name, string domain, string password, bool sendNotification, string to, object userState) { - if ((this.CreateUserOperationCompleted == null)) { + public void CreateUserAsync(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to, object userState) + { + if ((this.CreateUserOperationCompleted == null)) + { this.CreateUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateUserOperationCompleted); } this.InvokeAsync("CreateUser", new object[] { @@ -763,20 +903,88 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { name, domain, password, + subscriberNumber, sendNotification, to}, this.CreateUserOperationCompleted, userState); } - - private void OnCreateUserOperationCompleted(object arg) { - if ((this.CreateUserCompleted != null)) { + + private void OnCreateUserOperationCompleted(object arg) + { + if ((this.CreateUserCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateUserCompleted(this, new CreateUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUsersPaged", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationUsersPaged GetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ImportUser", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int ImportUser(int itemId, string accountName, string displayName, string name, string domain, string password) + { + object[] results = this.Invoke("ImportUser", new object[] { + itemId, + accountName, + displayName, + name, + domain, + password}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginImportUser(int itemId, string accountName, string displayName, string name, string domain, string password, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("ImportUser", new object[] { + itemId, + accountName, + displayName, + name, + domain, + password}, callback, asyncState); + } + + /// + public int EndImportUser(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void ImportUserAsync(int itemId, string accountName, string displayName, string name, string domain, string password) + { + this.ImportUserAsync(itemId, accountName, displayName, name, domain, password, null); + } + + /// + public void ImportUserAsync(int itemId, string accountName, string displayName, string name, string domain, string password, object userState) + { + if ((this.ImportUserOperationCompleted == null)) + { + this.ImportUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnImportUserOperationCompleted); + } + this.InvokeAsync("ImportUser", new object[] { + itemId, + accountName, + displayName, + name, + domain, + password}, this.ImportUserOperationCompleted, userState); + } + + private void OnImportUserOperationCompleted(object arg) + { + if ((this.ImportUserCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ImportUserCompleted(this, new ImportUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUsersPaged", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUsersPaged GetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { object[] results = this.Invoke("GetOrganizationUsersPaged", new object[] { itemId, filterColumn, @@ -786,9 +994,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { maximumRows}); return ((OrganizationUsersPaged)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationUsersPaged", new object[] { itemId, filterColumn, @@ -797,21 +1006,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { startRow, maximumRows}, callback, asyncState); } - + /// - public OrganizationUsersPaged EndGetOrganizationUsersPaged(System.IAsyncResult asyncResult) { + public OrganizationUsersPaged EndGetOrganizationUsersPaged(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationUsersPaged)(results[0])); } - + /// - public void GetOrganizationUsersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + public void GetOrganizationUsersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { this.GetOrganizationUsersPagedAsync(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); } - + /// - public void GetOrganizationUsersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) { - if ((this.GetOrganizationUsersPagedOperationCompleted == null)) { + public void GetOrganizationUsersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetOrganizationUsersPagedOperationCompleted == null)) + { this.GetOrganizationUsersPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationUsersPagedOperationCompleted); } this.InvokeAsync("GetOrganizationUsersPaged", new object[] { @@ -822,89 +1035,101 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { startRow, maximumRows}, this.GetOrganizationUsersPagedOperationCompleted, userState); } - - private void OnGetOrganizationUsersPagedOperationCompleted(object arg) { - if ((this.GetOrganizationUsersPagedCompleted != null)) { + + private void OnGetOrganizationUsersPagedOperationCompleted(object arg) + { + if ((this.GetOrganizationUsersPagedCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationUsersPagedCompleted(this, new GetOrganizationUsersPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationUser GetUserGeneralSettings(int itemId, int accountId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetUserGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUser GetUserGeneralSettings(int itemId, int accountId) + { object[] results = this.Invoke("GetUserGeneralSettings", new object[] { itemId, accountId}); return ((OrganizationUser)(results[0])); } - + /// - public System.IAsyncResult BeginGetUserGeneralSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetUserGeneralSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetUserGeneralSettings", new object[] { itemId, accountId}, callback, asyncState); } - + /// - public OrganizationUser EndGetUserGeneralSettings(System.IAsyncResult asyncResult) { + public OrganizationUser EndGetUserGeneralSettings(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationUser)(results[0])); } - + /// - public void GetUserGeneralSettingsAsync(int itemId, int accountId) { + public void GetUserGeneralSettingsAsync(int itemId, int accountId) + { this.GetUserGeneralSettingsAsync(itemId, accountId, null); } - + /// - public void GetUserGeneralSettingsAsync(int itemId, int accountId, object userState) { - if ((this.GetUserGeneralSettingsOperationCompleted == null)) { + public void GetUserGeneralSettingsAsync(int itemId, int accountId, object userState) + { + if ((this.GetUserGeneralSettingsOperationCompleted == null)) + { this.GetUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUserGeneralSettingsOperationCompleted); } this.InvokeAsync("GetUserGeneralSettings", new object[] { itemId, accountId}, this.GetUserGeneralSettingsOperationCompleted, userState); } - - private void OnGetUserGeneralSettingsOperationCompleted(object arg) { - if ((this.GetUserGeneralSettingsCompleted != null)) { + + private void OnGetUserGeneralSettingsOperationCompleted(object arg) + { + if ((this.GetUserGeneralSettingsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetUserGeneralSettingsCompleted(this, new GetUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public int SetUserGeneralSettings( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - bool locked, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - string externalEmail) { + int itemId, + int accountId, + string displayName, + string password, + bool hideAddressBook, + bool disabled, + bool locked, + string firstName, + string initials, + string lastName, + string address, + string city, + string state, + string zip, + string country, + string jobTitle, + string company, + string department, + string office, + string managerAccountName, + string businessPhone, + string fax, + string homePhone, + string mobilePhone, + string pager, + string webPage, + string notes, + string externalEmail, + string subscriberNumber) + { object[] results = this.Invoke("SetUserGeneralSettings", new object[] { itemId, accountId, @@ -933,42 +1158,45 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { pager, webPage, notes, - externalEmail}); + externalEmail, + subscriberNumber}); return ((int)(results[0])); } - + /// public System.IAsyncResult BeginSetUserGeneralSettings( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - bool locked, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - string externalEmail, - System.AsyncCallback callback, - object asyncState) { + int itemId, + int accountId, + string displayName, + string password, + bool hideAddressBook, + bool disabled, + bool locked, + string firstName, + string initials, + string lastName, + string address, + string city, + string state, + string zip, + string country, + string jobTitle, + string company, + string department, + string office, + string managerAccountName, + string businessPhone, + string fax, + string homePhone, + string mobilePhone, + string pager, + string webPage, + string notes, + string externalEmail, + string subscriberNumber, + System.AsyncCallback callback, + object asyncState) + { return this.BeginInvoke("SetUserGeneralSettings", new object[] { itemId, accountId, @@ -997,80 +1225,87 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { pager, webPage, notes, - externalEmail}, callback, asyncState); + externalEmail, + subscriberNumber}, callback, asyncState); } - + /// - public int EndSetUserGeneralSettings(System.IAsyncResult asyncResult) { + public int EndSetUserGeneralSettings(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// public void SetUserGeneralSettingsAsync( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - bool locked, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - string externalEmail) { - this.SetUserGeneralSettingsAsync(itemId, accountId, displayName, password, hideAddressBook, disabled, locked, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, externalEmail, null); + int itemId, + int accountId, + string displayName, + string password, + bool hideAddressBook, + bool disabled, + bool locked, + string firstName, + string initials, + string lastName, + string address, + string city, + string state, + string zip, + string country, + string jobTitle, + string company, + string department, + string office, + string managerAccountName, + string businessPhone, + string fax, + string homePhone, + string mobilePhone, + string pager, + string webPage, + string notes, + string externalEmail, + string subscriberNumber) + { + this.SetUserGeneralSettingsAsync(itemId, accountId, displayName, password, hideAddressBook, disabled, locked, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, externalEmail, subscriberNumber, null); } - + /// public void SetUserGeneralSettingsAsync( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - bool locked, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - string externalEmail, - object userState) { - if ((this.SetUserGeneralSettingsOperationCompleted == null)) { + int itemId, + int accountId, + string displayName, + string password, + bool hideAddressBook, + bool disabled, + bool locked, + string firstName, + string initials, + string lastName, + string address, + string city, + string state, + string zip, + string country, + string jobTitle, + string company, + string department, + string office, + string managerAccountName, + string businessPhone, + string fax, + string homePhone, + string mobilePhone, + string pager, + string webPage, + string notes, + string externalEmail, + string subscriberNumber, + object userState) + { + if ((this.SetUserGeneralSettingsOperationCompleted == null)) + { this.SetUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserGeneralSettingsOperationCompleted); } this.InvokeAsync("SetUserGeneralSettings", new object[] { @@ -1101,19 +1336,23 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { pager, webPage, notes, - externalEmail}, this.SetUserGeneralSettingsOperationCompleted, userState); + externalEmail, + subscriberNumber}, this.SetUserGeneralSettingsOperationCompleted, userState); } - - private void OnSetUserGeneralSettingsOperationCompleted(object arg) { - if ((this.SetUserGeneralSettingsCompleted != null)) { + + private void OnSetUserGeneralSettingsOperationCompleted(object arg) + { + if ((this.SetUserGeneralSettingsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetUserGeneralSettingsCompleted(this, new SetUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SearchAccounts", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationUser[] SearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SearchAccounts", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUser[] SearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) + { object[] results = this.Invoke("SearchAccounts", new object[] { itemId, filterColumn, @@ -1122,9 +1361,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { includeMailboxes}); return ((OrganizationUser[])(results[0])); } - + /// - public System.IAsyncResult BeginSearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("SearchAccounts", new object[] { itemId, filterColumn, @@ -1132,21 +1372,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { sortColumn, includeMailboxes}, callback, asyncState); } - + /// - public OrganizationUser[] EndSearchAccounts(System.IAsyncResult asyncResult) { + public OrganizationUser[] EndSearchAccounts(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationUser[])(results[0])); } - + /// - public void SearchAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) { + public void SearchAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) + { this.SearchAccountsAsync(itemId, filterColumn, filterValue, sortColumn, includeMailboxes, null); } - + /// - public void SearchAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes, object userState) { - if ((this.SearchAccountsOperationCompleted == null)) { + public void SearchAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes, object userState) + { + if ((this.SearchAccountsOperationCompleted == null)) + { this.SearchAccountsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSearchAccountsOperationCompleted); } this.InvokeAsync("SearchAccounts", new object[] { @@ -1156,604 +1400,748 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { sortColumn, includeMailboxes}, this.SearchAccountsOperationCompleted, userState); } - - private void OnSearchAccountsOperationCompleted(object arg) { - if ((this.SearchAccountsCompleted != null)) { + + private void OnSearchAccountsOperationCompleted(object arg) + { + if ((this.SearchAccountsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SearchAccountsCompleted(this, new SearchAccountsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int DeleteUser(int itemId, int accountId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteUser", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DeleteUser(int itemId, int accountId) + { object[] results = this.Invoke("DeleteUser", new object[] { itemId, accountId}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteUser(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteUser(int itemId, int accountId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("DeleteUser", new object[] { itemId, accountId}, callback, asyncState); } - + /// - public int EndDeleteUser(System.IAsyncResult asyncResult) { + public int EndDeleteUser(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void DeleteUserAsync(int itemId, int accountId) { + public void DeleteUserAsync(int itemId, int accountId) + { this.DeleteUserAsync(itemId, accountId, null); } - + /// - public void DeleteUserAsync(int itemId, int accountId, object userState) { - if ((this.DeleteUserOperationCompleted == null)) { + public void DeleteUserAsync(int itemId, int accountId, object userState) + { + if ((this.DeleteUserOperationCompleted == null)) + { this.DeleteUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteUserOperationCompleted); } this.InvokeAsync("DeleteUser", new object[] { itemId, accountId}, this.DeleteUserOperationCompleted, userState); } - - private void OnDeleteUserOperationCompleted(object arg) { - if ((this.DeleteUserCompleted != null)) { + + private void OnDeleteUserOperationCompleted(object arg) + { + if ((this.DeleteUserCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteUserCompleted(this, new DeleteUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetPasswordPolicy", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public PasswordPolicyResult GetPasswordPolicy(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetPasswordPolicy", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public PasswordPolicyResult GetPasswordPolicy(int itemId) + { object[] results = this.Invoke("GetPasswordPolicy", new object[] { itemId}); return ((PasswordPolicyResult)(results[0])); } - + /// - public System.IAsyncResult BeginGetPasswordPolicy(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetPasswordPolicy(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetPasswordPolicy", new object[] { itemId}, callback, asyncState); } - + /// - public PasswordPolicyResult EndGetPasswordPolicy(System.IAsyncResult asyncResult) { + public PasswordPolicyResult EndGetPasswordPolicy(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((PasswordPolicyResult)(results[0])); } - + /// - public void GetPasswordPolicyAsync(int itemId) { + public void GetPasswordPolicyAsync(int itemId) + { this.GetPasswordPolicyAsync(itemId, null); } - + /// - public void GetPasswordPolicyAsync(int itemId, object userState) { - if ((this.GetPasswordPolicyOperationCompleted == null)) { + public void GetPasswordPolicyAsync(int itemId, object userState) + { + if ((this.GetPasswordPolicyOperationCompleted == null)) + { this.GetPasswordPolicyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPasswordPolicyOperationCompleted); } this.InvokeAsync("GetPasswordPolicy", new object[] { itemId}, this.GetPasswordPolicyOperationCompleted, userState); } - - private void OnGetPasswordPolicyOperationCompleted(object arg) { - if ((this.GetPasswordPolicyCompleted != null)) { + + private void OnGetPasswordPolicyOperationCompleted(object arg) + { + if ((this.GetPasswordPolicyCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetPasswordPolicyCompleted(this, new GetPasswordPolicyCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - public new void CancelAsync(object userState) { + public new void CancelAsync(object userState) + { base.CancelAsync(userState); } } - - - - - - - - - - - - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetRawOrganizationsPagedCompletedEventHandler(object sender, GetRawOrganizationsPagedCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetRawOrganizationsPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetRawOrganizationsPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetRawOrganizationsPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetRawOrganizationsPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public System.Data.DataSet Result { - get { + public System.Data.DataSet Result + { + get + { this.RaiseExceptionIfNecessary(); return ((System.Data.DataSet)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetOrganizationsCompletedEventHandler(object sender, GetOrganizationsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public Organization[] Result { - get { + public Organization[] Result + { + get + { this.RaiseExceptionIfNecessary(); return ((Organization[])(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetOrganizationUserSummuryLetterCompletedEventHandler(object sender, GetOrganizationUserSummuryLetterCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationUserSummuryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationUserSummuryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public string Result { - get { + public string Result + { + get + { this.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void SendOrganizationUserSummuryLetterCompletedEventHandler(object sender, SendOrganizationUserSummuryLetterCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SendOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SendOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SendOrganizationUserSummuryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SendOrganizationUserSummuryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void DeleteOrganizationCompletedEventHandler(object sender, DeleteOrganizationCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal DeleteOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal DeleteOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetOrganizationStatisticsCompletedEventHandler(object sender, GetOrganizationStatisticsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationStatisticsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationStatisticsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationStatisticsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationStatisticsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationStatistics Result { - get { + public OrganizationStatistics Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationStatistics)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetOrganizationCompletedEventHandler(object sender, GetOrganizationCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public Organization Result { - get { + public Organization Result + { + get + { this.RaiseExceptionIfNecessary(); return ((Organization)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void AddOrganizationDomainCompletedEventHandler(object sender, AddOrganizationDomainCompletedEventArgs e); - + public delegate void GetAccountIdByUserPrincipalNameCompletedEventHandler(object sender, GetAccountIdByUserPrincipalNameCompletedEventArgs e); + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetAccountIdByUserPrincipalNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal AddOrganizationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetAccountIdByUserPrincipalNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetOrganizationDomainsCompletedEventHandler(object sender, GetOrganizationDomainsCompletedEventArgs e); - + public delegate void AddOrganizationDomainCompletedEventHandler(object sender, AddOrganizationDomainCompletedEventArgs e); + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class AddOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal AddOrganizationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationDomainName[] Result { - get { + public int Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetOrganizationDomainsCompletedEventHandler(object sender, GetOrganizationDomainsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetOrganizationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public OrganizationDomainName[] Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationDomainName[])(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void DeleteOrganizationDomainCompletedEventHandler(object sender, DeleteOrganizationDomainCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class DeleteOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal DeleteOrganizationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal DeleteOrganizationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void SetOrganizationDefaultDomainCompletedEventHandler(object sender, SetOrganizationDefaultDomainCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetOrganizationDefaultDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SetOrganizationDefaultDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SetOrganizationDefaultDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SetOrganizationDefaultDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void CreateUserCompletedEventHandler(object sender, CreateUserCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class CreateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal CreateUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal CreateUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetOrganizationUsersPagedCompletedEventHandler(object sender, GetOrganizationUsersPagedCompletedEventArgs e); - + public delegate void ImportUserCompletedEventHandler(object sender, ImportUserCompletedEventArgs e); + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationUsersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class ImportUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationUsersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal ImportUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationUsersPaged Result { - get { + public int Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetOrganizationUsersPagedCompletedEventHandler(object sender, GetOrganizationUsersPagedCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationUsersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetOrganizationUsersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public OrganizationUsersPaged Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationUsersPaged)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetUserGeneralSettingsCompletedEventHandler(object sender, GetUserGeneralSettingsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationUser Result { - get { + public OrganizationUser Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationUser)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void SetUserGeneralSettingsCompletedEventHandler(object sender, SetUserGeneralSettingsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void SearchAccountsCompletedEventHandler(object sender, SearchAccountsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SearchAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SearchAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SearchAccountsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SearchAccountsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationUser[] Result { - get { + public OrganizationUser[] Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationUser[])(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void DeleteUserCompletedEventHandler(object sender, DeleteUserCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class DeleteUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal DeleteUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal DeleteUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetPasswordPolicyCompletedEventHandler(object sender, GetPasswordPolicyCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPasswordPolicyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetPasswordPolicyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetPasswordPolicyCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetPasswordPolicyCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public PasswordPolicyResult Result { - get { + public PasswordPolicyResult Result + { + get + { this.RaiseExceptionIfNecessary(); return ((PasswordPolicyResult)(this.results[0])); } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj index 57eb796c..1390dff3 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj @@ -87,13 +87,13 @@ code + - diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Common/SecurityContext.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Common/SecurityContext.cs index fd457ab1..bd037cd7 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Common/SecurityContext.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Common/SecurityContext.cs @@ -45,6 +45,10 @@ namespace WebsitePanel.EnterpriseServer public const string ROLE_ADMINISTRATOR = "Administrator"; public const string ROLE_RESELLER = "Reseller"; public const string ROLE_USER = "User"; + public const string ROLE_PLATFORMCSR = "PlatformCSR"; + public const string ROLE_PLATFORMHELPDESK = "PlatformHelpdesk"; + public const string ROLE_RESELLERCSR = "ResellerCSR"; + public const string ROLE_RESELLERHELPDESK = "ResellerHelpdesk"; public const string CONTEXT_USER_INFO = "CONTEXT_USER_INFO"; @@ -62,8 +66,26 @@ namespace WebsitePanel.EnterpriseServer // set roles array List roles = new List(); roles.Add(SecurityContext.ROLE_USER); + + if (user.Role == UserRole.Reseller || user.Role == UserRole.Administrator || + user.Role == UserRole.PlatformHelpdesk || user.Role == UserRole.ResellerHelpdesk) + roles.Add(SecurityContext.ROLE_RESELLERHELPDESK); + + if (user.Role == UserRole.Reseller || user.Role == UserRole.Administrator || + user.Role == UserRole.PlatformCSR || user.Role == UserRole.ResellerCSR) + roles.Add(SecurityContext.ROLE_RESELLERCSR); + + if (user.Role == UserRole.Reseller || user.Role == UserRole.Administrator || + user.Role == UserRole.PlatformHelpdesk) + roles.Add(SecurityContext.ROLE_PLATFORMHELPDESK); + + if (user.Role == UserRole.Reseller || user.Role == UserRole.Administrator || + user.Role == UserRole.PlatformCSR) + roles.Add(SecurityContext.ROLE_PLATFORMCSR); + if (user.Role == UserRole.Reseller || user.Role == UserRole.Administrator) roles.Add(SecurityContext.ROLE_RESELLER); + if (user.Role == UserRole.Administrator) roles.Add(SecurityContext.ROLE_ADMINISTRATOR); @@ -152,9 +174,40 @@ namespace WebsitePanel.EnterpriseServer { // should make a check if the account has Admin role if (!User.IsInRole(ROLE_RESELLER)) - return BusinessErrorCodes.ERROR_USER_ACCOUNT_SHOULD_BE_RESELLER; + return BusinessErrorCodes.ERROR_USER_ACCOUNT_NOT_ENOUGH_PERMISSIONS; } + if ((demand & DemandAccount.IsPlatformCSR) == DemandAccount.IsPlatformCSR) + { + // should make a check if the account has Admin role + if (!User.IsInRole(ROLE_PLATFORMCSR)) + return BusinessErrorCodes.ERROR_USER_ACCOUNT_NOT_ENOUGH_PERMISSIONS; + } + + if ((demand & DemandAccount.IsPlatformHelpdesk) == DemandAccount.IsPlatformHelpdesk) + { + // should make a check if the account has Admin role + if (!User.IsInRole(ROLE_PLATFORMHELPDESK)) + return BusinessErrorCodes.ERROR_USER_ACCOUNT_NOT_ENOUGH_PERMISSIONS; + } + + + if ((demand & DemandAccount.IsResellerHelpdesk) == DemandAccount.IsResellerHelpdesk) + { + // should make a check if the account has Admin role + if (!User.IsInRole(ROLE_RESELLERHELPDESK)) + return BusinessErrorCodes.ERROR_USER_ACCOUNT_NOT_ENOUGH_PERMISSIONS; + } + + + if ((demand & DemandAccount.IsResellerCSR) == DemandAccount.IsResellerCSR) + { + // should make a check if the account has Admin role + if (!User.IsInRole(ROLE_RESELLERCSR)) + return BusinessErrorCodes.ERROR_USER_ACCOUNT_NOT_ENOUGH_PERMISSIONS; + } + + return 0; } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs index 1d4f770d..b5cf0d89 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs @@ -2065,33 +2065,36 @@ namespace WebsitePanel.EnterpriseServer #endregion #region Exchange Server - - public static int AddExchangeAccount(int itemId, int accountType, string accountName, + + public static int AddExchangeAccount(int itemId, int accountType, string accountName, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, - string mailboxManagerActions, string samAccountName, string accountPassword) - { - SqlParameter outParam = new SqlParameter("@AccountID", SqlDbType.Int); - outParam.Direction = ParameterDirection.Output; + string mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, string subscriberNumber) + { + SqlParameter outParam = new SqlParameter("@AccountID", SqlDbType.Int); + outParam.Direction = ParameterDirection.Output; - SqlHelper.ExecuteNonQuery( - ConnectionString, - CommandType.StoredProcedure, - "AddExchangeAccount", - outParam, - new SqlParameter("@ItemID", itemId), - new SqlParameter("@AccountType", accountType), - new SqlParameter("@AccountName", accountName), - new SqlParameter("@DisplayName", displayName), - new SqlParameter("@PrimaryEmailAddress", primaryEmailAddress), - new SqlParameter("@MailEnabledPublicFolder", mailEnabledPublicFolder), + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddExchangeAccount", + outParam, + new SqlParameter("@ItemID", itemId), + new SqlParameter("@AccountType", accountType), + new SqlParameter("@AccountName", accountName), + new SqlParameter("@DisplayName", displayName), + new SqlParameter("@PrimaryEmailAddress", primaryEmailAddress), + new SqlParameter("@MailEnabledPublicFolder", mailEnabledPublicFolder), new SqlParameter("@MailboxManagerActions", mailboxManagerActions), new SqlParameter("@SamAccountName", samAccountName), - new SqlParameter("@AccountPassword", accountPassword) - ); + new SqlParameter("@AccountPassword", accountPassword), + new SqlParameter("@MailboxPlanId", (mailboxPlanId == 0) ? (object)DBNull.Value : (object)mailboxPlanId), + new SqlParameter("@SubscriberNumber", (string.IsNullOrEmpty(subscriberNumber) ? (object)DBNull.Value : (object)subscriberNumber)) + ); + + return Convert.ToInt32(outParam.Value); + } - return Convert.ToInt32(outParam.Value); - } public static void AddExchangeAccountEmailAddress(int accountId, string emailAddress) { @@ -2159,6 +2162,7 @@ namespace WebsitePanel.EnterpriseServer ); } + public static void DeleteExchangeAccountEmailAddress(int accountId, string emailAddress) { SqlHelper.ExecuteNonQuery( @@ -2255,26 +2259,27 @@ namespace WebsitePanel.EnterpriseServer return Convert.ToBoolean(outParam.Value); } - public static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType, + public static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, - string mailboxManagerActions, string samAccountName, string accountPassword) - { - SqlHelper.ExecuteNonQuery( - ConnectionString, - CommandType.StoredProcedure, - "UpdateExchangeAccount", - new SqlParameter("@AccountID", accountId), - new SqlParameter("@AccountName", accountName), - new SqlParameter("@DisplayName", displayName), + string mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, string subscriberNumber) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "UpdateExchangeAccount", + new SqlParameter("@AccountID", accountId), + new SqlParameter("@AccountName", accountName), + new SqlParameter("@DisplayName", displayName), new SqlParameter("@AccountType", (int)accountType), - new SqlParameter("@PrimaryEmailAddress", primaryEmailAddress), - new SqlParameter("@MailEnabledPublicFolder", mailEnabledPublicFolder), + new SqlParameter("@PrimaryEmailAddress", primaryEmailAddress), + new SqlParameter("@MailEnabledPublicFolder", mailEnabledPublicFolder), new SqlParameter("@MailboxManagerActions", mailboxManagerActions), new SqlParameter("@Password", string.IsNullOrEmpty(accountPassword) ? (object)DBNull.Value : (object)accountPassword), - new SqlParameter("@SamAccountName", samAccountName) - - ); - } + new SqlParameter("@SamAccountName", samAccountName), + new SqlParameter("@MailboxPlanId", (mailboxPlanId == 0) ? (object)DBNull.Value : (object)mailboxPlanId), + new SqlParameter("@SubscriberNumber", (string.IsNullOrEmpty(subscriberNumber) ? (object)DBNull.Value : (object)subscriberNumber)) + ); + } public static IDataReader GetExchangeAccount(int itemId, int accountId) { @@ -2287,6 +2292,29 @@ namespace WebsitePanel.EnterpriseServer ); } + public static IDataReader GetExchangeAccountByAccountName(int itemId, string accountName) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetExchangeAccountByAccountName", + new SqlParameter("@ItemID", itemId), + new SqlParameter("@AccountName", accountName) + ); + } + + public static IDataReader GetExchangeAccountByMailboxPlanId(int itemId, int MailboxPlanId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetExchangeAccountByMailboxPlanId", + new SqlParameter("@ItemID", itemId), + new SqlParameter("@MailboxPlanId", MailboxPlanId) + ); + } + + public static IDataReader GetExchangeAccountEmailAddresses(int accountId) { return SqlHelper.ExecuteReader( @@ -2398,6 +2426,97 @@ namespace WebsitePanel.EnterpriseServer #endregion + #region Exchange Mailbox Plans + public static int AddExchangeMailboxPlan(int itemID, string mailboxPlan, bool enableActiveSync, bool enableIMAP, bool enableMAPI, bool enableOWA, bool enablePOP, + bool isDefault, int issueWarningPct, int keepDeletedItemsDays, int mailboxSizeMB, int maxReceiveMessageSizeKB, int maxRecipients, + int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook) + { + SqlParameter outParam = new SqlParameter("@MailboxPlanId", SqlDbType.Int); + outParam.Direction = ParameterDirection.Output; + + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddExchangeMailboxPlan", + outParam, + new SqlParameter("@ItemID", itemID), + new SqlParameter("@MailboxPlan", mailboxPlan), + new SqlParameter("@EnableActiveSync", enableActiveSync), + new SqlParameter("@EnableIMAP", enableIMAP), + new SqlParameter("@EnableMAPI", enableMAPI), + new SqlParameter("@EnableOWA", enableOWA), + new SqlParameter("@EnablePOP", enablePOP), + new SqlParameter("@IsDefault", isDefault), + new SqlParameter("@IssueWarningPct", issueWarningPct), + new SqlParameter("@KeepDeletedItemsDays", keepDeletedItemsDays), + new SqlParameter("@MailboxSizeMB", mailboxSizeMB), + new SqlParameter("@MaxReceiveMessageSizeKB", maxReceiveMessageSizeKB), + new SqlParameter("@MaxRecipients", maxRecipients), + new SqlParameter("@MaxSendMessageSizeKB", maxSendMessageSizeKB), + new SqlParameter("@ProhibitSendPct", prohibitSendPct), + new SqlParameter("@ProhibitSendReceivePct", prohibitSendReceivePct), + new SqlParameter("@HideFromAddressBook", hideFromAddressBook) + ); + + return Convert.ToInt32(outParam.Value); + } + + + public static void DeleteExchangeMailboxPlan(int mailboxPlanId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "DeleteExchangeMailboxPlan", + new SqlParameter("@MailboxPlanId", mailboxPlanId) + ); + } + + + public static IDataReader GetExchangeMailboxPlan(int mailboxPlanId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetExchangeMailboxPlan", + new SqlParameter("@MailboxPlanId", mailboxPlanId) + ); + } + + public static IDataReader GetExchangeMailboxPlans(int itemId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetExchangeMailboxPlans", + new SqlParameter("@ItemID", itemId) + ); + } + + public static void SetOrganizationDefaultExchangeMailboxPlan(int itemId, int mailboxPlanId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "SetOrganizationDefaultExchangeMailboxPlan", + new SqlParameter("@ItemID", itemId), + new SqlParameter("@MailboxPlanId", mailboxPlanId) + ); + } + + public static void SetExchangeAccountMailboxPlan(int accountId, int mailboxPlanId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "SetExchangeAccountMailboxplan", + new SqlParameter("@AccountID", accountId), + new SqlParameter("@MailboxPlanId", (mailboxPlanId == 0) ? (object)DBNull.Value : (object)mailboxPlanId) + ); + } + + #endregion + #region Organizations public static void DeleteOrganizationUser(int itemId) @@ -3033,5 +3152,163 @@ namespace WebsitePanel.EnterpriseServer return Convert.ToBoolean(prmId.Value); } #endregion + + #region Lync + + public static void AddLyncUser(int accountId, int lyncUserPlanId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, + CommandType.StoredProcedure, + "AddLyncUser", + new[] + { + new SqlParameter("@AccountID", accountId), + new SqlParameter("@LyncUserPlanID", lyncUserPlanId) + }); + } + + public static bool CheckLyncUserExists(int accountId) + { + int res = (int)SqlHelper.ExecuteScalar(ConnectionString, CommandType.StoredProcedure, "CheckLyncUserExists", + new SqlParameter("@AccountID", accountId)); + return res > 0; + } + + public static IDataReader GetLyncUsers(int itemId, string sortColumn, string sortDirection, int startRow, int count) + { + SqlParameter[] sqlParams = new SqlParameter[] + { + new SqlParameter("@ItemID", itemId), + new SqlParameter("@SortColumn", sortColumn), + new SqlParameter("@SortDirection", sortDirection), + new SqlParameter("@StartRow", startRow), + new SqlParameter("Count", count) + }; + + + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetLyncUsers", sqlParams); + } + + public static int GetLyncUsersCount(int itemId) + { + SqlParameter[] sqlParams = new SqlParameter[] + { + new SqlParameter("@ItemID", itemId) + }; + + return + (int) + SqlHelper.ExecuteScalar(ConnectionString, CommandType.StoredProcedure, "GetLyncUsersCount", sqlParams); + } + + public static void DeleteLyncUser(int accountId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, + CommandType.StoredProcedure, + "DeleteLyncUser", + new[] + { + new SqlParameter("@AccountId", accountId) + }); + + } + + public static int AddLyncUserPlan(int itemID, LyncUserPlan lyncUserPlan) + { + SqlParameter outParam = new SqlParameter("@LyncUserPlanId", SqlDbType.Int); + outParam.Direction = ParameterDirection.Output; + + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddLyncUserPlan", + outParam, + + new SqlParameter("@ItemID", itemID), + new SqlParameter("@LyncUserPlanName", lyncUserPlan.LyncUserPlanName), + new SqlParameter("@IM", lyncUserPlan.IM), + new SqlParameter("@Mobility", lyncUserPlan.Mobility), + new SqlParameter("@MobilityEnableOutsideVoice", lyncUserPlan.MobilityEnableOutsideVoice), + new SqlParameter("@Federation", lyncUserPlan.Federation), + new SqlParameter("@Conferencing", lyncUserPlan.Conferencing), + new SqlParameter("@EnterpriseVoice", lyncUserPlan.EnterpriseVoice), + new SqlParameter("@VoicePolicy", lyncUserPlan.VoicePolicy), + new SqlParameter("@IsDefault", lyncUserPlan.IsDefault) + ); + + return Convert.ToInt32(outParam.Value); + } + + public static void DeleteLyncUserPlan(int lyncUserPlanId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "DeleteLyncUserPlan", + new SqlParameter("@LyncUserPlanId", lyncUserPlanId) + ); + } + + public static IDataReader GetLyncUserPlan(int lyncUserPlanId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetLyncUserPlan", + new SqlParameter("@LyncUserPlanId", lyncUserPlanId) + ); + } + + + public static IDataReader GetLyncUserPlans(int itemId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetLyncUserPlans", + new SqlParameter("@ItemID", itemId) + ); + } + + + public static void SetOrganizationDefaultLyncUserPlan(int itemId, int lyncUserPlanId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "SetOrganizationDefaultLyncUserPlan", + new SqlParameter("@ItemID", itemId), + new SqlParameter("@LyncUserPlanId", lyncUserPlanId) + ); + } + + public static IDataReader GetLyncUserPlanByAccountId(int AccountId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetLyncUserPlanByAccountId", + new SqlParameter("@AccountID", AccountId) + ); + } + + + public static void SetLyncUserLyncUserplan(int accountId, int lyncUserPlanId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "SetLyncUserLyncUserplan", + new SqlParameter("@AccountID", accountId), + new SqlParameter("@LyncUserPlanId", (lyncUserPlanId == 0) ? (object)DBNull.Value : (object)lyncUserPlanId) + ); + } + + + #endregion + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeHostedEdition/ExchangeHostedEditionController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeHostedEdition/ExchangeHostedEditionController.cs deleted file mode 100644 index 0fb1f80f..00000000 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeHostedEdition/ExchangeHostedEditionController.cs +++ /dev/null @@ -1,896 +0,0 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Web; -using WebsitePanel.Providers.ExchangeHostedEdition; -using WebsitePanel.Providers.ResultObjects; -using WebsitePanel.Providers.Common; -using WebsitePanel.Providers; -using System.Collections.Specialized; -using System.Collections; -using System.Net.Mail; - -namespace WebsitePanel.EnterpriseServer -{ - public class ExchangeHostedEditionController - { - // messages - public const string GeneralError = "GeneralError"; - public const string ExchangeServiceNotEnabledError = "ExchangeServiceNotEnabledError"; - public const string ProgramIdIsNotSetError = "ProgramIdIsNotSetError"; - public const string OfferIdIsNotSetError = "OfferIdIsNotSetError"; - public const string CreateOrganizationError = "CreateOrganizationError"; - public const string OrganizationNotFoundError = "OrganizationNotFoundError"; - public const string SendOrganizationSummaryError = "SendOrganizationSummaryError"; - public const string SendOrganizationTemplateNotSetError = "SendOrganizationTemplateNotSetError"; - public const string AddDomainError = "AddDomainError"; - public const string AddDomainQuotaExceededError = "AddDomainQuotaExceededError"; - public const string AddDomainExistsError = "AddDomainExistsError"; - public const string AddDomainAlreadyUsedError = "AddDomainAlreadyUsedError"; - public const string DeleteDomainError = "DeleteDomainError"; - public const string UpdateQuotasError = "UpdateQuotasError"; - public const string UpdateQuotasWrongQuotaError = "UpdateQuotasWrongQuotaError"; - public const string UpdateCatchAllError = "UpdateCatchAllError"; - public const string UpdateServicePlanError = "UpdateServicePlanError"; - public const string DeleteOrganizationError = "DeleteOrganizationError"; - - public const string TempDomainSetting = "temporaryDomain"; - public const string ExchangeControlPanelUrlSetting = "ecpURL"; - - // other constants - public const string TaskManagerSource = "ExchangeHostedEdition"; - - public static IntResult CreateOrganization(int packageId, string organizationId, - string domain, string adminName, string adminEmail, string adminPassword) - { - IntResult result = new IntResult(); - result.IsSuccess = true; - - try - { - // initialize task manager - TaskManager.StartTask(TaskManagerSource, "CREATE_ORGANIZATION"); - TaskManager.WriteParameter("packageId", packageId); - TaskManager.WriteParameter("organizationId", organizationId); - TaskManager.WriteParameter("domain", domain); - TaskManager.WriteParameter("adminName", adminName); - TaskManager.WriteParameter("adminEmail", adminEmail); - TaskManager.WriteParameter("adminPassword", adminPassword); - - // get Exchange service ID - int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.ExchangeHostedEdition); - if(serviceId < 1) - return Error(ExchangeServiceNotEnabledError); - - #region Check Space and Account - // Check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) - return Warning((-accountCheck).ToString()); - - // Check space - int packageCheck = SecurityContext.CheckPackage(packageId, DemandPackage.IsActive); - if (packageCheck < 0) - return Warning((-packageCheck).ToString()); - #endregion - - // get Exchange service - ExchangeServerHostedEdition exchange = GetExchangeService(serviceId); - - // load service settings to know ProgramID, OfferID - StringDictionary serviceSettings = ServerController.GetServiceSettings(serviceId); - string programId = serviceSettings["programID"]; - string offerId = serviceSettings["offerID"]; - - // check settings - if(String.IsNullOrEmpty(programId)) - result.ErrorCodes.Add(ProgramIdIsNotSetError); - if (String.IsNullOrEmpty(offerId)) - result.ErrorCodes.Add(OfferIdIsNotSetError); - - if (result.ErrorCodes.Count > 0) - { - result.IsSuccess = false; - return result; - } - - #region Create organization - int itemId = -1; - ExchangeOrganization org = null; - try - { - // create organization - exchange.CreateOrganization(organizationId, programId, offerId, domain, adminName, adminEmail, adminPassword); - - // save item into meta-base - org = new ExchangeOrganization(); - org.Name = organizationId; - org.PackageId = packageId; - org.ServiceId = serviceId; - itemId = PackageController.AddPackageItem(org); - } - catch (Exception ex) - { - // log error - TaskManager.WriteError(ex); - return Error(CreateOrganizationError); - } - #endregion - - #region Update organization quotas - // update max org quotas - UpdateOrganizationQuotas(org); - - // override quotas - ResultObject quotasResult = ExchangeHostedEditionController.UpdateOrganizationQuotas(itemId, - org.MaxMailboxCountQuota, - org.MaxContactCountQuota, - org.MaxDistributionListCountQuota); - - if (!quotasResult.IsSuccess) - return Error(quotasResult, CreateOrganizationError); - #endregion - - #region Add temporary domain - // load settings - PackageSettings settings = GetExchangePackageSettings(org); - string tempDomainTemplate = settings[TempDomainSetting]; - if (!String.IsNullOrEmpty(tempDomainTemplate)) - { - // add temp domain - string tempDomain = String.Format("{0}.{1}", domain, tempDomainTemplate); - AddOrganizationDomain(itemId, tempDomain); - } - - #endregion - - result.Value = itemId; - return result; - } - catch (Exception ex) - { - // log error - TaskManager.WriteError(ex); - - // exit with error code - return Error(GeneralError, ex.Message); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static List GetOrganizations(int packageId) - { - List items = PackageController.GetPackageItemsByType( - packageId, typeof(ExchangeOrganization), false); - - return items.ConvertAll(i => { return (ExchangeOrganization)i; }); - } - - public static ExchangeOrganization GetOrganizationDetails(int itemId) - { - // load organization item - ExchangeOrganization item = PackageController.GetPackageItem(itemId) as ExchangeOrganization; - if (item == null) - return null; // organization item not found - - // get Exchange service - ExchangeServerHostedEdition exchange = GetExchangeService(item.ServiceId); - - // get organization details - ExchangeOrganization org = exchange.GetOrganizationDetails(item.Name); - - //ExchangeOrganization org = new ExchangeOrganization - //{ - // Id = item.Id, - // PackageId = item.PackageId, - // ServiceId = item.ServiceId, - // Name = item.Name, - // AdministratorEmail = "admin@email.com", - // AdministratorName = "Administrator Mailbox", - // CatchAllAddress = "", - // ContactCount = 1, - // ContactCountQuota = 2, - // MaxContactCountQuota = 3, - // DistinguishedName = "DN=....", - // DistributionListCount = 2, - // DistributionListCountQuota = 3, - // MaxDistributionListCountQuota = 3, - // MaxDomainsCountQuota = 4, - // ExchangeControlPanelUrl = "http://ecp.domain.com", - // MailboxCount = 3, - // MailboxCountQuota = 4, - // MaxMailboxCountQuota = 4, - // ProgramId = "HostedExchange", - // OfferId = "2", - // ServicePlan = "HostedExchange_Basic", - // Domains = GetOrganizationDomains(item.Id).ToArray() - //}; - - // update item props - org.Id = item.Id; - org.PackageId = item.PackageId; - org.ServiceId = item.ServiceId; - org.Name = item.Name; - org.CatchAllAddress = item.CatchAllAddress; - - // update max quotas - UpdateOrganizationQuotas(org); - - // process summary information - org.SummaryInformation = GetExchangeOrganizationSummary(org); - - // process domains - PackageSettings settings = GetExchangePackageSettings(org); - if(settings != null) - { - // get settings - string tempDomain = settings[TempDomainSetting]; - string ecpUrl = settings[ExchangeControlPanelUrlSetting]; - - // iterate through domains - foreach (ExchangeOrganizationDomain domain in org.Domains) - { - if (tempDomain != null && domain.Name.EndsWith("." + tempDomain, StringComparison.InvariantCultureIgnoreCase)) - domain.IsTemp = true; - if (domain.IsDefault && ecpUrl != null) - org.ExchangeControlPanelUrl = Utils.ReplaceStringVariable(ecpUrl, "domain_name", domain.Name); - } - } - - // return org - return org; - } - - public static void UpdateOrganizationQuotas(ExchangeOrganization org) - { - // load default package quotas - PackageContext cntx = PackageController.GetPackageContext(org.PackageId); - if (!cntx.Groups.ContainsKey(ResourceGroups.ExchangeHostedEdition)) - return; - - org.MaxMailboxCountQuota = cntx.Quotas[Quotas.EXCHANGEHOSTEDEDITION_MAILBOXES].QuotaAllocatedValue; - org.MaxContactCountQuota = cntx.Quotas[Quotas.EXCHANGEHOSTEDEDITION_CONTACTS].QuotaAllocatedValue; - org.MaxDistributionListCountQuota = cntx.Quotas[Quotas.EXCHANGEHOSTEDEDITION_DISTRIBUTIONLISTS].QuotaAllocatedValue; - org.MaxDomainsCountQuota = cntx.Quotas[Quotas.EXCHANGEHOSTEDEDITION_DOMAINS].QuotaAllocatedValue; - } - - public static List GetOrganizationDomains(int itemId) - { - // load organization item - ExchangeOrganization item = PackageController.GetPackageItem(itemId) as ExchangeOrganization; - if (item == null) - return null; // organization item not found - - // get Exchange service - ExchangeServerHostedEdition exchange = GetExchangeService(item.ServiceId); - - // get organization domains - List domains = new List(); - domains.AddRange(exchange.GetOrganizationDomains(item.Name)); - return domains; - - //return new List - //{ - // new ExchangeOrganizationDomain { Identity = "org101\\domain1.com", Name = "domain1.com", IsDefault = true, IsTemp = false }, - // new ExchangeOrganizationDomain { Identity = "org101\\org101.tempdomain.com", Name = "org101.tempdomain.com", IsDefault = false, IsTemp = true }, - // new ExchangeOrganizationDomain { Identity = "org101\\myseconddomain.com", Name = "myseconddomain.com", IsDefault = false, IsTemp = false } - //}; - } - - public static string GetExchangeOrganizationSummary(int itemId) - { - // load organization details - ExchangeOrganization org = GetOrganizationDetails(itemId); - if (org == null) - return null; // organization not found - - return GetExchangeOrganizationSummary(org); - } - - private static string GetExchangeOrganizationSummary(ExchangeOrganization org) - { - // evaluate template - MailTemplate template = EvaluateOrganizationSummaryTemplate(org); - if (template == null || template.Body == null) - return null; - - return template.IsHtml ? template.Body : template.Body.Replace("\n", "
"); - } - - private static MailTemplate EvaluateOrganizationSummaryTemplate(ExchangeOrganization org) - { - #region create template context - Hashtable items = new Hashtable(); - - // add organization - items["org"] = org; - - // add package information - PackageInfo space = PackageController.GetPackage(org.PackageId); - items["space"] = space; - - // add user information - UserInfo user = UserController.GetUser(space.UserId); - items["user"] = user; - #endregion - - #region load template - // load template settings - UserSettings settings = UserController.GetUserSettings(user.UserId, UserSettings.EXCHANGE_HOSTED_EDITION_ORGANIZATION_SUMMARY); - if(settings == null) - return null; - - // create template - MailTemplate template = new MailTemplate(); - - // from - template.From = settings["From"]; - - // BCC - template.Bcc = settings["CC"]; - - // subject - template.Subject = settings["Subject"]; - - // body - template.IsHtml = user.HtmlMail; - string bodySetting = template.IsHtml ? "HtmlBody" : "TextBody"; - template.Body = settings[bodySetting]; - - // priority - string priority = settings["Priority"]; - template.Priority = String.IsNullOrEmpty(priority) - ? MailPriority.Normal - : (MailPriority)Enum.Parse(typeof(MailPriority), priority, true); - #endregion - - #region evaluate template - if(template.Subject != null) - template.Subject = PackageController.EvaluateTemplate(template.Subject, items); - - if(template.Body != null) - template.Body = PackageController.EvaluateTemplate(template.Body, items); - #endregion - - return template; - } - - private static PackageSettings GetExchangePackageSettings(ExchangeOrganization org) - { - // load package settings - return PackageController.GetPackageSettings(org.PackageId, PackageSettings.EXCHANGE_HOSTED_EDITION); - } - - public static ResultObject SendExchangeOrganizationSummary(int itemId, string toEmail) - { - ResultObject result = new ResultObject(); - result.IsSuccess = true; - - try - { - // initialize task manager - TaskManager.StartTask(TaskManagerSource, "SEND_SUMMARY"); - TaskManager.WriteParameter("Item ID", itemId); - TaskManager.WriteParameter("To e-mail", toEmail); - - // load organization item - ExchangeOrganization item = PackageController.GetPackageItem(itemId) as ExchangeOrganization; - if (item == null) - return Error(OrganizationNotFoundError); - - #region Check Space and Account - // Check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) - return Warning((-accountCheck).ToString()); - - // Check space - int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) - return Warning((-packageCheck).ToString()); - #endregion - - // load organization details - ExchangeOrganization org = GetOrganizationDetails(item.Id); - if(org == null) - return Error(OrganizationNotFoundError); - - // get evaluated summary information - MailTemplate msg = EvaluateOrganizationSummaryTemplate(org); - if (msg == null) - return Error(SendOrganizationTemplateNotSetError); - - // send message - int sendResult = MailHelper.SendMessage(msg.From, toEmail, msg.Bcc, msg.Subject, msg.Body, msg.Priority, msg.IsHtml); - if (sendResult < 0) - return Error((-sendResult).ToString()); - - return result; - } - catch (Exception ex) - { - // log error - TaskManager.WriteError(ex); - - // exit with error code - return Error(SendOrganizationSummaryError, ex.Message); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static ResultObject AddOrganizationDomain(int itemId, string domainName) - { - ResultObject result = new ResultObject(); - result.IsSuccess = true; - - try - { - // initialize task manager - TaskManager.StartTask(TaskManagerSource, "ADD_DOMAIN"); - TaskManager.WriteParameter("itemId", itemId); - TaskManager.WriteParameter("domain", domainName); - - // load organization item - ExchangeOrganization item = PackageController.GetPackageItem(itemId) as ExchangeOrganization; - if (item == null) - return Error(OrganizationNotFoundError); - - #region Check Space and Account - // Check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) - return Warning((-accountCheck).ToString()); - - // Check space - int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) - return Warning((-packageCheck).ToString()); - #endregion - - // get organization details - ExchangeOrganization org = GetOrganizationDetails(item.Id); - if (org == null) - return Error(OrganizationNotFoundError); - - // check domains quota - if(org.MaxDomainsCountQuota > -1 && org.Domains.Length >= org.MaxDomainsCountQuota) - return Error(AddDomainQuotaExceededError); - - // check if the domain already exists - DomainInfo domain = null; - int checkResult = ServerController.CheckDomain(domainName); - if (checkResult == BusinessErrorCodes.ERROR_DOMAIN_ALREADY_EXISTS) - { - // domain exists - // check if it belongs to the same space - domain = ServerController.GetDomain(domainName); - if (domain == null) - return Error((-checkResult).ToString()); - - if (domain.PackageId != org.PackageId) - return Error((-checkResult).ToString()); - - // check if domain is already used in this organization - foreach (ExchangeOrganizationDomain orgDomain in org.Domains) - { - if(String.Equals(orgDomain.Name, domainName, StringComparison.InvariantCultureIgnoreCase)) - return Error(AddDomainAlreadyUsedError); - } - } - else if (checkResult == BusinessErrorCodes.ERROR_RESTRICTED_DOMAIN) - { - return Error((-checkResult).ToString()); - } - - // create domain if required - if (domain == null) - { - domain = new DomainInfo(); - domain.PackageId = org.PackageId; - domain.DomainName = domainName; - domain.IsInstantAlias = false; - domain.IsSubDomain = false; - - int domainId = ServerController.AddDomain(domain); - if (domainId < 0) - return Error((-domainId).ToString()); - - // add domain - domain.DomainId = domainId; - } - - // get Exchange service - ExchangeServerHostedEdition exchange = GetExchangeService(item.ServiceId); - - // add domain - exchange.AddOrganizationDomain(item.Name, domainName); - - return result; - } - catch (Exception ex) - { - // log error - TaskManager.WriteError(ex); - - // exit with error code - return Error(AddDomainError, ex.Message); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static ResultObject DeleteOrganizationDomain(int itemId, string domainName) - { - ResultObject result = new ResultObject(); - result.IsSuccess = true; - - try - { - // initialize task manager - TaskManager.StartTask(TaskManagerSource, "DELETE_DOMAIN"); - TaskManager.WriteParameter("itemId", itemId); - TaskManager.WriteParameter("domain", domainName); - - // load organization item - ExchangeOrganization item = PackageController.GetPackageItem(itemId) as ExchangeOrganization; - if (item == null) - return Error(OrganizationNotFoundError); - - #region Check Space and Account - // Check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) - return Warning((-accountCheck).ToString()); - - // Check space - int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) - return Warning((-packageCheck).ToString()); - #endregion - - // get Exchange service - ExchangeServerHostedEdition exchange = GetExchangeService(item.ServiceId); - - // delete domain - exchange.DeleteOrganizationDomain(item.Name, domainName); - - return result; - } - catch (Exception ex) - { - // log error - TaskManager.WriteError(ex); - - // exit with error code - return Error(DeleteDomainError, ex.Message); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static ResultObject UpdateOrganizationQuotas(int itemId, int mailboxesNumber, int contactsNumber, int distributionListsNumber) - { - ResultObject result = new ResultObject(); - result.IsSuccess = true; - - try - { - // initialize task manager - TaskManager.StartTask(TaskManagerSource, "UPDATE_QUOTAS"); - TaskManager.WriteParameter("itemId", itemId); - TaskManager.WriteParameter("mailboxesNumber", mailboxesNumber); - TaskManager.WriteParameter("contactsNumber", contactsNumber); - TaskManager.WriteParameter("distributionListsNumber", distributionListsNumber); - - // load organization item - ExchangeOrganization item = PackageController.GetPackageItem(itemId) as ExchangeOrganization; - if (item == null) - return Error(OrganizationNotFoundError); - - #region Check Space and Account - // Check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) - return Warning((-accountCheck).ToString()); - - // Check space - int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) - return Warning((-packageCheck).ToString()); - #endregion - - // check quotas - UpdateOrganizationQuotas(item); - - if(item.MaxMailboxCountQuota > -1 && mailboxesNumber > item.MaxMailboxCountQuota) - return Error(UpdateQuotasWrongQuotaError); - if (item.MaxContactCountQuota > -1 && contactsNumber > item.MaxContactCountQuota) - return Error(UpdateQuotasWrongQuotaError); - if (item.MaxDistributionListCountQuota > -1 && distributionListsNumber > item.MaxDistributionListCountQuota) - return Error(UpdateQuotasWrongQuotaError); - - // get Exchange service - ExchangeServerHostedEdition exchange = GetExchangeService(item.ServiceId); - - // update quotas - exchange.UpdateOrganizationQuotas(item.Name, mailboxesNumber, contactsNumber, distributionListsNumber); - - return result; - } - catch (Exception ex) - { - // log error - TaskManager.WriteError(ex); - - // exit with error code - return Error(UpdateQuotasError, ex.Message); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static ResultObject UpdateOrganizationCatchAllAddress(int itemId, string catchAllEmail) - { - ResultObject result = new ResultObject(); - result.IsSuccess = true; - - try - { - // initialize task manager - TaskManager.StartTask(TaskManagerSource, "UPDATE_CATCHALL"); - TaskManager.WriteParameter("itemId", itemId); - TaskManager.WriteParameter("catchAllEmail", catchAllEmail); - - // load organization item - ExchangeOrganization item = PackageController.GetPackageItem(itemId) as ExchangeOrganization; - if (item == null) - return Error(OrganizationNotFoundError); - - #region Check Space and Account - // Check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) - return Warning((-accountCheck).ToString()); - - // Check space - int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) - return Warning((-packageCheck).ToString()); - #endregion - - // get Exchange service - ExchangeServerHostedEdition exchange = GetExchangeService(item.ServiceId); - - // update catch-all - exchange.UpdateOrganizationCatchAllAddress(item.Name, catchAllEmail); - - // save new catch-all in the item - item.CatchAllAddress = catchAllEmail; - PackageController.UpdatePackageItem(item); - - return result; - } - catch (Exception ex) - { - // log error - TaskManager.WriteError(ex); - - // exit with error code - return Error(UpdateCatchAllError, ex.Message); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static ResultObject UpdateOrganizationServicePlan(int itemId, int newServiceId) - { - ResultObject result = new ResultObject(); - result.IsSuccess = true; - - try - { - // initialize task manager - TaskManager.StartTask(TaskManagerSource, "UPDATE_SERVICE"); - TaskManager.WriteParameter("itemId", itemId); - TaskManager.WriteParameter("newServiceId", newServiceId); - - // load organization item - ExchangeOrganization item = PackageController.GetPackageItem(itemId) as ExchangeOrganization; - if (item == null) - return Error(OrganizationNotFoundError); - - #region Check Space and Account - // Check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive); - if (accountCheck < 0) - return Warning((-accountCheck).ToString()); - - // Check space - int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) - return Warning((-packageCheck).ToString()); - #endregion - - // get Exchange service - ExchangeServerHostedEdition exchange = GetExchangeService(item.ServiceId); - - // load service settings to know ProgramID, OfferID - StringDictionary serviceSettings = ServerController.GetServiceSettings(newServiceId); - string programId = serviceSettings["programID"]; - string offerId = serviceSettings["offerID"]; - - // check settings - if(String.IsNullOrEmpty(programId)) - result.ErrorCodes.Add(ProgramIdIsNotSetError); - if (String.IsNullOrEmpty(offerId)) - result.ErrorCodes.Add(OfferIdIsNotSetError); - - // update service plan - exchange.UpdateOrganizationServicePlan(item.Name, programId, offerId); - - // move item between services - int moveResult = PackageController.MovePackageItem(itemId, newServiceId); - if (moveResult < 0) - return Error((-moveResult).ToString()); - - return result; - } - catch (Exception ex) - { - // log error - TaskManager.WriteError(ex); - - // exit with error code - return Error(UpdateServicePlanError, ex.Message); - } - finally - { - TaskManager.CompleteTask(); - } - } - - public static ResultObject DeleteOrganization(int itemId) - { - ResultObject result = new ResultObject(); - result.IsSuccess = true; - - try - { - // initialize task manager - TaskManager.StartTask(TaskManagerSource, "DELETE_ORGANIZATION"); - TaskManager.WriteParameter("itemId", itemId); - - // load organization item - ExchangeOrganization item = PackageController.GetPackageItem(itemId) as ExchangeOrganization; - if (item == null) - return Error(OrganizationNotFoundError); - - #region Check Space and Account - // Check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) - return Warning((-accountCheck).ToString()); - - // Check space - int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) - return Warning((-packageCheck).ToString()); - #endregion - - // get Exchange service - ExchangeServerHostedEdition exchange = GetExchangeService(item.ServiceId); - - // delete organization - exchange.DeleteOrganization(item.Name); - - // delete meta-item - PackageController.DeletePackageItem(itemId); - - return result; - } - catch (Exception ex) - { - // log error - TaskManager.WriteError(ex); - - // exit with error code - return Error(DeleteOrganizationError, ex.Message); - } - finally - { - TaskManager.CompleteTask(); - } - } - - #region Private helpers - public static ExchangeServerHostedEdition GetExchangeService(int serviceId) - { - ExchangeServerHostedEdition ws = new ExchangeServerHostedEdition(); - ServiceProviderProxy.Init(ws, serviceId); - return ws; - } - #endregion - - #region Result object routines - private static T Warning(params string[] messageParts) - { - return Warning(null, messageParts); - } - - private static T Warning(ResultObject innerResult, params string[] messageParts) - { - return Result(innerResult, false, messageParts); - } - - private static T Error(params string[] messageParts) - { - return Error(null, messageParts); - } - - private static T Error(ResultObject innerResult, params string[] messageParts) - { - return Result(innerResult, true, messageParts); - } - - private static T Result(ResultObject innerResult, bool isError, params string[] messageParts) - { - object obj = Activator.CreateInstance(); - ResultObject result = (ResultObject)obj; - - // set error - result.IsSuccess = !isError; - - // add message - if (messageParts != null) - result.ErrorCodes.Add(String.Join(":", messageParts)); - - // copy errors from inner result - if (innerResult != null) - result.ErrorCodes.AddRange(innerResult.ErrorCodes); - - return (T)obj; - } - #endregion - } -} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs index 77eb5848..f2a66144 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs @@ -120,9 +120,6 @@ namespace WebsitePanel.EnterpriseServer org.Id = 1; org.OrganizationId = "fabrikam"; org.Name = "Fabrikam Inc"; - org.IssueWarningKB = 150000; - org.ProhibitSendKB = 170000; - org.ProhibitSendReceiveKB = 190000; org.KeepDeletedItemsDays = 14; return org; } @@ -167,7 +164,7 @@ namespace WebsitePanel.EnterpriseServer DataProvider.GetExchangeOrganizationStatistics(itemId)); // disk space - stats.UsedDiskSpace = org.DiskSpace; + //stats.UsedDiskSpace = org.DiskSpace; // allocated quotas PackageContext cntx = PackageController.GetPackageContext(org.PackageId); @@ -295,10 +292,6 @@ namespace WebsitePanel.EnterpriseServer ExchangeServer mailboxRole = GetExchangeServer(serviceId, org.ServiceId); - - - - bool authDomainCreated = false; @@ -307,10 +300,15 @@ namespace WebsitePanel.EnterpriseServer List domains = null; try - { + { + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + // 1) Create Organization (Mailbox) // ================================ - Organization exchangeOrganization = mailboxRole.ExtendToExchangeOrganization(org.OrganizationId, org.SecurityGroup); + Organization exchangeOrganization = mailboxRole.ExtendToExchangeOrganization(org.OrganizationId, + org.SecurityGroup, + Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue)); + organizationExtended = true; exchangeOrganization.OrganizationId = org.OrganizationId; @@ -386,17 +384,17 @@ namespace WebsitePanel.EnterpriseServer break; } - PackageContext cntx = PackageController.GetPackageContext(org.PackageId); - // organization limits - org.IssueWarningKB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; - if (org.IssueWarningKB > 0) - org.IssueWarningKB *= Convert.ToInt32(1024*0.9); //90% - org.ProhibitSendKB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; - if (org.ProhibitSendKB > 0) - org.ProhibitSendKB *= 1024; //100% - org.ProhibitSendReceiveKB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; - if (org.ProhibitSendReceiveKB > 0) - org.ProhibitSendReceiveKB *= 1024; //100% + + // 4) Add the address book policy (Exchange 2010 SP2 + // + // ========================================== + Organization OrgTmp = mailboxRole.CreateOrganizationAddressBookPolicy(org.OrganizationId, + org.GlobalAddressList, + org.AddressList, + org.RoomsAddressList, + org.OfflineAddressBook); + + org.AddressBookPolicy = OrgTmp.AddressBookPolicy; StringDictionary settings = ServerController.GetServiceSettings(serviceId); org.KeepDeletedItemsDays = Utils.ParseInt(settings["KeepDeletedItemsDays"], 14); @@ -406,9 +404,9 @@ namespace WebsitePanel.EnterpriseServer { // rollback organization creation - if (organizationExtended) + if (organizationExtended) mailboxRole.DeleteOrganization(org.OrganizationId, org.DistinguishedName, - org.GlobalAddressList, org.AddressList, org.RoomsAddressList, org.OfflineAddressBook, org.SecurityGroup); + org.GlobalAddressList, org.AddressList, org.RoomsAddressList, org.OfflineAddressBook, org.SecurityGroup, org.AddressBookPolicy); // rollback domain if (authDomainCreated) @@ -498,16 +496,16 @@ namespace WebsitePanel.EnterpriseServer int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - bool successful = exchange.DeleteOrganization( - org.OrganizationId, - org.DistinguishedName, - org.GlobalAddressList, - org.AddressList, - org.RoomsAddressList, - org.OfflineAddressBook, - org.SecurityGroup); + bool successful = exchange.DeleteOrganization( + org.OrganizationId, + org.DistinguishedName, + org.GlobalAddressList, + org.AddressList, + org.RoomsAddressList, + org.OfflineAddressBook, + org.SecurityGroup, + org.AddressBookPolicy); return successful ? 0 : BusinessErrorCodes.ERROR_EXCHANGE_DELETE_SOME_PROBLEMS; @@ -571,9 +569,6 @@ namespace WebsitePanel.EnterpriseServer return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; // set limits - org.IssueWarningKB = issueWarningKB; - org.ProhibitSendKB = prohibitSendKB; - org.ProhibitSendReceiveKB = prohibitSendReceiveKB; org.KeepDeletedItemsDays = keepDeletedItemsDays; // save organization @@ -665,6 +660,39 @@ namespace WebsitePanel.EnterpriseServer } } + public static ExchangeMailboxStatistics GetMailboxStatistics(int itemId, int accountId) + { + // place log record + TaskManager.StartTask("EXCHANGE", "GET_MAILBOX_STATS"); + TaskManager.ItemId = itemId; + + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + return null; + + + // get stats + int exchangeServiceId = GetExchangeServiceID(org.PackageId); + ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); + + // load account + ExchangeAccount account = GetAccount(itemId, accountId); + + return exchange.GetMailboxStatistics(account.AccountName); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static ExchangeItemStatistics[] GetPublicFoldersStatistics(int itemId) { #region Demo Mode @@ -916,6 +944,13 @@ namespace WebsitePanel.EnterpriseServer DataProvider.GetExchangeAccounts(itemId, (int)accountType)); } + + public static List GetExchangeAccountByMailboxPlanId(int itemId, int mailboxPlanId) + { + return ObjectUtils.CreateListFromDataReader(DataProvider.GetExchangeAccountByMailboxPlanId(itemId, mailboxPlanId)); + } + + public static List GetExchangeMailboxes(int itemId) { return ObjectUtils.CreateListFromDataReader(DataProvider.GetExchangeMailboxes(itemId)); @@ -1087,21 +1122,22 @@ namespace WebsitePanel.EnterpriseServer return account; } - private static int AddAccount(int itemId, ExchangeAccountType accountType, - string accountName, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, - MailboxManagerActions mailboxManagerActions, string samAccountName, string accountPassword) - { - return DataProvider.AddExchangeAccount(itemId, (int)accountType, - accountName, displayName, primaryEmailAddress, mailEnabledPublicFolder, - mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword)); - } + private static int AddAccount(int itemId, ExchangeAccountType accountType, + string accountName, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, + MailboxManagerActions mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, string subscriberNumber) + { + return DataProvider.AddExchangeAccount(itemId, (int)accountType, + accountName, displayName, primaryEmailAddress, mailEnabledPublicFolder, + mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword), mailboxPlanId, (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim())); + } - private static void UpdateAccount(ExchangeAccount account) - { - DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName, - account.PrimaryEmailAddress,account.MailEnabledPublicFolder, - account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword); - } + private static void UpdateAccount(ExchangeAccount account) + { + DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName, + account.PrimaryEmailAddress, account.MailEnabledPublicFolder, + account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword, account.MailboxPlanId, + (string.IsNullOrEmpty(account.SubscriberNumber) ? null : account.SubscriberNumber.Trim())); + } private static void DeleteAccount(int itemId, int accountId) { @@ -1112,29 +1148,41 @@ namespace WebsitePanel.EnterpriseServer DataProvider.DeleteExchangeAccount(itemId, accountId); } - private static string BuildAccountName(string orgId, string name) - { - int maxLen = 19 - orgId.Length; + private static string BuildAccountName(string orgId, string name) + { + string accountName = name = name.Replace(" ", ""); + string CounterStr = "00000"; + int counter = 0; + bool bFound = false; + do + { + accountName = genSamLogin(name, CounterStr); - // try to choose name - int i = 0; - while (true) - { - string num = i > 0 ? i.ToString() : ""; - int len = maxLen - num.Length; + if (!AccountExists(accountName)) bFound = true; - if (name.Length > len) - name = name.Substring(0, len); + CounterStr = counter.ToString("d5"); + counter++; + } + while (!bFound); - string accountName = name + num + "_" + orgId; + return accountName; + } - // check if already exists - if (!AccountExists(accountName)) - return accountName; + private static string genSamLogin(string login, string strCounter) + { + int maxLogin = 20; + int fullLen = login.Length + strCounter.Length; + if (fullLen <= maxLogin) + return login + strCounter; + else + { + if (login.Length - (fullLen - maxLogin) > 0) + return login.Substring(0, login.Length - (fullLen - maxLogin)) + strCounter; + else return strCounter; // ???? + } + + } - i++; - } - } #endregion @@ -1375,160 +1423,198 @@ namespace WebsitePanel.EnterpriseServer #endregion #region Mailboxes - - private static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType, + + private static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, - string mailboxManagerActions, string samAccountName, string accountPassword) - { - DataProvider.UpdateExchangeAccount(accountId, - accountName, - accountType, - displayName, - primaryEmailAddress, - mailEnabledPublicFolder, + string mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, string subscriberNumber) + { + DataProvider.UpdateExchangeAccount(accountId, + accountName, + accountType, + displayName, + primaryEmailAddress, + mailEnabledPublicFolder, mailboxManagerActions, samAccountName, - CryptoUtils.Encrypt(accountPassword)); + CryptoUtils.Encrypt(accountPassword), + mailboxPlanId, + (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim())); } - public static int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, - string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, + string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, string subscriberNumber) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // check mailbox quota - OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); - if ((orgStats.AllocatedMailboxes > -1 ) && ( orgStats.CreatedMailboxes >= orgStats.AllocatedMailboxes)) - return BusinessErrorCodes.ERROR_EXCHANGE_MAILBOXES_QUOTA_LIMIT; - - // place log record - TaskManager.StartTask("EXCHANGE", "CREATE_MAILBOX"); - TaskManager.ItemId = itemId; - bool userCreated = false; - Organization org = null; - try - { - // load organization - org = GetOrganization(itemId); - if (org == null) - return -1; - - // e-mail - string email = name + "@" + domain; - bool enabled = (accountType == ExchangeAccountType.Mailbox); - - - // string accountName = string.Empty; - //Create AD user if needed - if (accountId == 0) - { - accountId = OrganizationController.CreateUser(org.Id, displayName, name, domain, password, enabled, false, string.Empty, out accountName); - if (accountId > 0) - userCreated = true; - } - if (accountId < 0) - return accountId; - - int exchangeServiceId = PackageController.GetPackageServiceId(org.PackageId, ResourceGroups.Exchange); - - ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); + // check mailbox quota + OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); + if ((orgStats.AllocatedMailboxes > -1) && (orgStats.CreatedMailboxes >= orgStats.AllocatedMailboxes)) + return BusinessErrorCodes.ERROR_EXCHANGE_MAILBOXES_QUOTA_LIMIT; - //Create Exchange Organization - if (string.IsNullOrEmpty(org.GlobalAddressList)) - { - ExtendToExchangeOrganization(ref org); - - PackageController.UpdatePackageItem(org); - } - - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // place log record + TaskManager.StartTask("EXCHANGE", "CREATE_MAILBOX"); + TaskManager.ItemId = itemId; + bool userCreated = false; + Organization org = null; + try + { + accountName = accountName.Trim(); + displayName = displayName.Trim(); + name = name.Trim(); + domain = domain.Trim(); - // load package context - PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + // load organization + org = GetOrganization(itemId); + if (org == null) + return -1; + + // e-mail + string email = name + "@" + domain; + bool enabled = (accountType == ExchangeAccountType.Mailbox); - string samAccount = exchange.CreateMailEnableUser(email, org.OrganizationId, org.DistinguishedName, accountType, org.Database, - org.OfflineAddressBook, - accountName, - QuotaEnabled(cntx, Quotas.EXCHANGE2007_POP3ENABLED), - QuotaEnabled(cntx, Quotas.EXCHANGE2007_IMAPENABLED), - QuotaEnabled(cntx, Quotas.EXCHANGE2007_OWAENABLED), - QuotaEnabled(cntx, Quotas.EXCHANGE2007_MAPIENABLED), - QuotaEnabled(cntx, Quotas.EXCHANGE2007_ACTIVESYNCENABLED), - org.IssueWarningKB, - org.ProhibitSendKB, - org.ProhibitSendReceiveKB, - org.KeepDeletedItemsDays); + // string accountName = string.Empty; + //Create AD user if needed + if (accountId == 0) + { + accountId = OrganizationController.CreateUser(org.Id, displayName, name, domain, password, subscriberNumber, enabled, false, string.Empty, out accountName); + if (accountId > 0) + userCreated = true; + } + if (accountId < 0) + return accountId; - MailboxManagerActions pmmActions = MailboxManagerActions.GeneralSettings - | MailboxManagerActions.MailFlowSettings - | MailboxManagerActions.AdvancedSettings - | MailboxManagerActions.EmailAddresses; + // get mailbox settings + Organizations orgProxy = OrganizationController.GetOrganizationProxy(org.ServiceId); + OrganizationUser retUser = orgProxy.GetUserGeneralSettings(accountName, org.OrganizationId); - UpdateExchangeAccount(accountId, accountName, accountType, displayName, email, false, pmmActions.ToString(), samAccount, password); + int exchangeServiceId = PackageController.GetPackageServiceId(org.PackageId, ResourceGroups.Exchange); + + ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); + + + //Create Exchange Organization + if (string.IsNullOrEmpty(org.GlobalAddressList)) + { + ExtendToExchangeOrganization(ref org); + + PackageController.UpdatePackageItem(org); + } + + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + //verify if the mailbox fits in the storage quota + // load package context + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + int maxDiskSpace = -1; + int quotaUsed = 0; + if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_DISKSPACE) + && cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue > 0) + { + maxDiskSpace = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; + quotaUsed = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaUsedValue; + } + + ExchangeMailboxPlan plan = GetExchangeMailboxPlan(itemId, mailboxPlanId); + if (maxDiskSpace != -1) + { + if ((quotaUsed + plan.MailboxSizeMB) > (maxDiskSpace)) + return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; + } + + //GetServiceSettings + StringDictionary primSettings = ServerController.GetServiceSettings(exchangeServiceId); + + string samAccount = exchange.CreateMailEnableUser(email, org.OrganizationId, org.DistinguishedName, accountType, primSettings["mailboxdatabase"], + org.OfflineAddressBook, + org.AddressBookPolicy, + retUser.SamAccountName, + plan.EnablePOP, + plan.EnableIMAP, + plan.EnableOWA, + plan.EnableMAPI, + plan.EnableActiveSync, + (int)Math.Round((double)((plan.IssueWarningPct * plan.MailboxSizeMB * 1024) / 100)), + (int)Math.Round((double)((plan.ProhibitSendPct * plan.MailboxSizeMB * 1024) / 100)), + (int)Math.Round((double)((plan.ProhibitSendReceivePct * plan.MailboxSizeMB * 1024) / 100)), + plan.KeepDeletedItemsDays, + plan.MaxRecipients, + plan.MaxSendMessageSizeKB, + plan.MaxReceiveMessageSizeKB, + plan.HideFromAddressBook, + Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue)); + + MailboxManagerActions pmmActions = MailboxManagerActions.GeneralSettings + | MailboxManagerActions.MailFlowSettings + | MailboxManagerActions.AdvancedSettings + | MailboxManagerActions.EmailAddresses; + + + UpdateExchangeAccount(accountId, accountName, accountType, displayName, email, false, pmmActions.ToString(), samAccount, password, mailboxPlanId, subscriberNumber); - // send setup instructions - if (sendSetupInstructions) - { - try - { - // send setup instructions - int sendResult = SendMailboxSetupInstructions(itemId, accountId, true, setupInstructionMailAddress, null); - if (sendResult < 0) - TaskManager.WriteWarning("Setup instructions were not sent. Error code: " + sendResult); - } - catch (Exception ex) - { - TaskManager.WriteError(ex); - } - } + // send setup instructions + if (sendSetupInstructions) + { + try + { + // send setup instructions + int sendResult = SendMailboxSetupInstructions(itemId, accountId, true, setupInstructionMailAddress, null); + if (sendResult < 0) + TaskManager.WriteWarning("Setup instructions were not sent. Error code: " + sendResult); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + } - try - { - // update OAB - // check if this is the first mailbox within the organization - if (GetAccounts(itemId, ExchangeAccountType.Mailbox).Count == 1) - exchange.UpdateOrganizationOfflineAddressBook(org.OfflineAddressBook); - } - catch (Exception ex) - { - TaskManager.WriteError(ex); - } + try + { + // update OAB + // check if this is the first mailbox within the organization + if (GetAccounts(itemId, ExchangeAccountType.Mailbox).Count == 1) + exchange.UpdateOrganizationOfflineAddressBook(org.OfflineAddressBook); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } - return accountId; - } - catch (Exception ex) - { - //rollback AD user - if (userCreated) - { - try - { - OrganizationController.DeleteUser(org.Id, accountId); - } - catch (Exception rollbackException) - { - TaskManager.WriteError(rollbackException); - } - } - throw TaskManager.WriteError(ex); + return accountId; + } + catch (Exception ex) + { + //rollback AD user + if (userCreated) + { + try + { + OrganizationController.DeleteUser(org.Id, accountId); + } + catch (Exception rollbackException) + { + TaskManager.WriteError(rollbackException); + } + } + throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + } + finally + { + TaskManager.CompleteTask(); + } + } public static int DisableMailbox(int itemId, int accountId) { @@ -1694,85 +1780,56 @@ namespace WebsitePanel.EnterpriseServer } } - public static int SetMailboxGeneralSettings(int itemId, int accountId, string displayName, - string password, bool hideAddressBook, bool disabled, string firstName, string initials, - string lastName, string address, string city, string state, string zip, string country, - string jobTitle, string company, string department, string office, string managerAccountName, - string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int SetMailboxGeneralSettings(int itemId, int accountId, bool hideAddressBook, bool disabled) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "UPDATE_MAILBOX_GENERAL"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "UPDATE_MAILBOX_GENERAL"); + TaskManager.ItemId = itemId; - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetMailboxGeneralSettings( - account.AccountName, - displayName, - password, - hideAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes); - // update account - account.DisplayName = displayName; - if (!String.IsNullOrEmpty(password)) - account.AccountPassword = CryptoUtils.Encrypt(password); + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); - UpdateAccount(account); + if (Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue)) + hideAddressBook = true; - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + exchange.SetMailboxGeneralSettings( + account.AccountName, + hideAddressBook, + disabled); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static ExchangeEmailAddress[] GetMailboxEmailAddresses(int itemId, int accountId) { @@ -2002,61 +2059,58 @@ namespace WebsitePanel.EnterpriseServer } } - public static int SetMailboxMailFlowSettings(int itemId, int accountId, - bool enableForwarding, string forwardingAccountName, bool forwardToBoth, - string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, - int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, + public static int SetMailboxMailFlowSettings(int itemId, int accountId, + bool enableForwarding, string forwardingAccountName, bool forwardToBoth, + string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "UPDATE_MAILBOX_MAILFLOW"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "UPDATE_MAILBOX_MAILFLOW"); + TaskManager.ItemId = itemId; - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetMailboxMailFlowSettings(account.AccountName, - enableForwarding, - forwardingAccountName, - forwardToBoth, - sendOnBehalfAccounts, - acceptAccounts, - rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, - requireSenderAuthentication); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + exchange.SetMailboxMailFlowSettings(account.AccountName, + enableForwarding, + forwardingAccountName, + forwardToBoth, + sendOnBehalfAccounts, + acceptAccounts, + rejectAccounts, + requireSenderAuthentication); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + public static ExchangeMailbox GetMailboxAdvancedSettings(int itemId, int accountId) { @@ -2098,75 +2152,6 @@ namespace WebsitePanel.EnterpriseServer } } - public static int SetMailboxAdvancedSettings(int itemId, int accountId, bool enablePOP, - bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - // place log record - TaskManager.StartTask("EXCHANGE", "UPDATE_MAILBOX_ADVANCED"); - TaskManager.ItemId = itemId; - - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; - - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; - - // load account - ExchangeAccount account = GetAccount(itemId, accountId); - - // load package context - PackageContext cntx = PackageController.GetPackageContext(org.PackageId); - - int maxDiskSpace = 0; - if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_DISKSPACE) - && cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue > 0) - maxDiskSpace = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue * 1024; - - if ((maxDiskSpace > 0 && - (issueWarningKB > maxDiskSpace - || prohibitSendKB > maxDiskSpace - || prohibitSendReceiveKB > maxDiskSpace || issueWarningKB == -1 || prohibitSendKB == -1 || prohibitSendReceiveKB == -1))) - return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; - - // get mailbox settings - int exchangeServiceId = GetExchangeServiceID(org.PackageId); - ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetMailboxAdvancedSettings( - org.OrganizationId, - account.AccountName, - QuotaEnabled(cntx, Quotas.EXCHANGE2007_POP3ALLOWED) && enablePOP, - QuotaEnabled(cntx, Quotas.EXCHANGE2007_IMAPALLOWED) && enableIMAP, - QuotaEnabled(cntx, Quotas.EXCHANGE2007_OWAALLOWED) && enableOWA, - QuotaEnabled(cntx, Quotas.EXCHANGE2007_MAPIALLOWED) && enableMAPI, - QuotaEnabled(cntx, Quotas.EXCHANGE2007_ACTIVESYNCALLOWED) && enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays); - - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - public static int SetMailboxManagerSettings(int itemId, int accountId, bool pmmAllowed, MailboxManagerActions action) { // check account @@ -2421,44 +2406,266 @@ namespace WebsitePanel.EnterpriseServer #endregion - #region Contacts - public static int CreateContact(int itemId, string displayName, string email) + + #region Mailbox plan + public static int SetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("EXCHANGE", "SET_MAILBOXPLAN"); + TaskManager.ItemId = itemId; + + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; + + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + // load account + ExchangeAccount account = GetAccount(itemId, accountId); + + // load package context + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + int maxDiskSpace = -1; + int quotaUsed = 0; + if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_DISKSPACE) + && cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue > 0) + { + maxDiskSpace = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; + quotaUsed = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaUsedValue; + } + + ExchangeMailboxPlan plan = GetExchangeMailboxPlan(itemId, mailboxPlanId); + if (maxDiskSpace != -1) + { + if ((quotaUsed + plan.MailboxSizeMB) > (maxDiskSpace)) + return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; + } + + // get mailbox settings + int exchangeServiceId = GetExchangeServiceID(org.PackageId); + ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); + + exchange.SetMailboxAdvancedSettings( + org.OrganizationId, + account.AccountName, + plan.EnablePOP, + plan.EnableIMAP, + plan.EnableOWA, + plan.EnableMAPI, + plan.EnableActiveSync, + (int)Math.Round((double)((plan.IssueWarningPct * plan.MailboxSizeMB * 1024) / 100)), + (int)Math.Round((double)((plan.ProhibitSendPct * plan.MailboxSizeMB * 1024) / 100)), + (int)Math.Round((double)((plan.ProhibitSendReceivePct * plan.MailboxSizeMB * 1024) / 100)), + plan.KeepDeletedItemsDays, + plan.MaxRecipients, + plan.MaxSendMessageSizeKB, + plan.MaxReceiveMessageSizeKB); + + DataProvider.SetExchangeAccountMailboxPlan(accountId, mailboxPlanId); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static List GetExchangeMailboxPlans(int itemId) + { + // place log record + TaskManager.StartTask("EXCHANGE", "GET_EXCHANGE_MAILBOXPLANS"); + TaskManager.ItemId = itemId; + + try + { + return ObjectUtils.CreateListFromDataReader( + DataProvider.GetExchangeMailboxPlans(itemId)); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static ExchangeMailboxPlan GetExchangeMailboxPlan(int itemID, int mailboxPlanId) + { + + // place log record + TaskManager.StartTask("EXCHANGE", "GET_EXCHANGE_MAILBOXPLAN"); + TaskManager.ItemId = mailboxPlanId; + + try + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetExchangeMailboxPlan(mailboxPlanId)); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int AddExchangeMailboxPlan(int itemID, ExchangeMailboxPlan mailboxPlan) + { + // place log record + TaskManager.StartTask("EXCHANGE", "ADD_EXCHANGE_MAILBOXPLAN"); + TaskManager.ItemId = itemID; + + try + { + Organization org = GetOrganization(itemID); + if (org == null) + return -1; + + // load package context + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + mailboxPlan.EnableActiveSync = mailboxPlan.EnableActiveSync & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ACTIVESYNCALLOWED].QuotaAllocatedValue); + mailboxPlan.EnableIMAP = mailboxPlan.EnableIMAP & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_IMAPALLOWED].QuotaAllocatedValue); + mailboxPlan.EnableMAPI = mailboxPlan.EnableMAPI & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_MAPIALLOWED].QuotaAllocatedValue); + mailboxPlan.EnableOWA = mailboxPlan.EnableOWA & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_OWAALLOWED].QuotaAllocatedValue); + mailboxPlan.EnablePOP = mailboxPlan.EnablePOP & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_POP3ALLOWED].QuotaAllocatedValue); + if (mailboxPlan.KeepDeletedItemsDays > cntx.Quotas[Quotas.EXCHANGE2007_KEEPDELETEDITEMSDAYS].QuotaAllocatedValue) + mailboxPlan.KeepDeletedItemsDays = cntx.Quotas[Quotas.EXCHANGE2007_KEEPDELETEDITEMSDAYS].QuotaAllocatedValue; + if (cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue != -1) + if (mailboxPlan.MailboxSizeMB > cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue) + mailboxPlan.MailboxSizeMB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; + if (mailboxPlan.MaxReceiveMessageSizeKB > cntx.Quotas[Quotas.EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB].QuotaAllocatedValue) + mailboxPlan.MaxReceiveMessageSizeKB = cntx.Quotas[Quotas.EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB].QuotaAllocatedValue; + if (mailboxPlan.MaxSendMessageSizeKB > cntx.Quotas[Quotas.EXCHANGE2007_MAXSENDMESSAGESIZEKB].QuotaAllocatedValue) + mailboxPlan.MaxSendMessageSizeKB = cntx.Quotas[Quotas.EXCHANGE2007_MAXSENDMESSAGESIZEKB].QuotaAllocatedValue; + if (cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue != -1) + if (mailboxPlan.MaxRecipients > cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue) + mailboxPlan.MaxRecipients = cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue; + if (Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue)) mailboxPlan.HideFromAddressBook = true; + + return DataProvider.AddExchangeMailboxPlan(itemID, mailboxPlan.MailboxPlan, mailboxPlan.EnableActiveSync, mailboxPlan.EnableIMAP, mailboxPlan.EnableMAPI, mailboxPlan.EnableOWA, mailboxPlan.EnablePOP, + mailboxPlan.IsDefault, mailboxPlan.IssueWarningPct, mailboxPlan.KeepDeletedItemsDays, mailboxPlan.MailboxSizeMB, mailboxPlan.MaxReceiveMessageSizeKB, mailboxPlan.MaxRecipients, + mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + } + + public static int DeleteExchangeMailboxPlan(int itemID, int mailboxPlanId) + { + TaskManager.StartTask("EXCHANGE", "DELETE_EXCHANGE_MAILBOXPLAN"); + TaskManager.ItemId = itemID; + + try + { + DataProvider.DeleteExchangeMailboxPlan(mailboxPlanId); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + } + + public static void SetOrganizationDefaultExchangeMailboxPlan(int itemId, int mailboxPlanId) + { + TaskManager.StartTask("EXCHANGE", "SET_EXCHANGE_MAILBOXPLAN"); + TaskManager.ItemId = itemId; + + try + { + DataProvider.SetOrganizationDefaultExchangeMailboxPlan(itemId, mailboxPlanId); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + } + + + + #endregion + + + #region Contacts + public static int CreateContact(int itemId, string displayName, string email) { //if (EmailAddressExists(email)) - // return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - + // return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; // check mailbox quota - OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); - if (orgStats.AllocatedContacts > -1 - && orgStats.CreatedContacts >= orgStats.AllocatedContacts) - return BusinessErrorCodes.ERROR_EXCHANGE_CONTACTS_QUOTA_LIMIT; + OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); + if (orgStats.AllocatedContacts > -1 + && orgStats.CreatedContacts >= orgStats.AllocatedContacts) + return BusinessErrorCodes.ERROR_EXCHANGE_CONTACTS_QUOTA_LIMIT; - // place log record - TaskManager.StartTask("EXCHANGE", "CREATE_CONTACT"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "CREATE_CONTACT"); + TaskManager.ItemId = itemId; - try - { - // load organization - Organization org = GetOrganization(itemId); + try + { - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + displayName = displayName.Trim(); + email = email.Trim(); - string name = email; - int idx = email.IndexOf("@"); - if (idx > -1) - name = email.Substring(0, idx); + // load organization + Organization org = GetOrganization(itemId); - string accountName = BuildAccountName(org.OrganizationId, name); + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // add contact + string name = email; + int idx = email.IndexOf("@"); + if (idx > -1) + name = email.Substring(0, idx); + + string accountName = BuildAccountName(org.OrganizationId, name); + + // add contact int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); @@ -2469,30 +2676,32 @@ namespace WebsitePanel.EnterpriseServer PackageController.UpdatePackageItem(org); } - + exchange.CreateContact( - org.OrganizationId, - org.DistinguishedName, - displayName, - accountName, + org.OrganizationId, + org.DistinguishedName, + displayName, + accountName, email, org.DefaultDomain); - // add meta-item - int accountId = AddAccount(itemId, ExchangeAccountType.Contact, accountName, - displayName, email, false, - 0, "", null); + ExchangeContact contact = exchange.GetContactGeneralSettings(accountName); - return accountId; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + // add meta-item + int accountId = AddAccount(itemId, ExchangeAccountType.Contact, accountName, + displayName, email, false, + 0, contact.SAMAccountName, null, 0, null); + + return accountId; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static int DeleteContact(int itemId, int accountId) { @@ -2593,75 +2802,80 @@ namespace WebsitePanel.EnterpriseServer string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes, int useMapiRichTextFormat) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "UPDATE_CONTACT_GENERAL"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "UPDATE_CONTACT_GENERAL"); + TaskManager.ItemId = itemId; - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + displayName = displayName.Trim(); + emailAddress = emailAddress.Trim(); + firstName = firstName.Trim(); + lastName = lastName.Trim(); - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // get mailbox settings + // load account + ExchangeAccount account = GetAccount(itemId, accountId); + + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetContactGeneralSettings( - account.AccountName, - displayName, - emailAddress, - hideAddressBook, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes, + + exchange.SetContactGeneralSettings( + account.AccountName, + displayName, + emailAddress, + hideAddressBook, + firstName, + initials, + lastName, + address, + city, + state, + zip, + country, + jobTitle, + company, + department, + office, + managerAccountName, + businessPhone, + fax, + homePhone, + mobilePhone, + pager, + webPage, + notes, useMapiRichTextFormat, org.DefaultDomain); - // update account - account.DisplayName = displayName; - account.PrimaryEmailAddress = emailAddress; - UpdateAccount(account); + // update account + account.DisplayName = displayName; + account.PrimaryEmailAddress = emailAddress; + UpdateAccount(account); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static ExchangeContact GetContactMailFlowSettings(int itemId, int accountId) { @@ -2754,40 +2968,44 @@ namespace WebsitePanel.EnterpriseServer #region Distribution Lists public static int CreateDistributionList(int itemId, string displayName, string name, string domain, int managerId) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // check mailbox quota - OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); - if (orgStats.AllocatedDistributionLists > -1 - && orgStats.CreatedDistributionLists >= orgStats.AllocatedDistributionLists) - return BusinessErrorCodes.ERROR_EXCHANGE_DLISTS_QUOTA_LIMIT; + // check mailbox quota + OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); + if (orgStats.AllocatedDistributionLists > -1 + && orgStats.CreatedDistributionLists >= orgStats.AllocatedDistributionLists) + return BusinessErrorCodes.ERROR_EXCHANGE_DLISTS_QUOTA_LIMIT; - // place log record - TaskManager.StartTask("EXCHANGE", "CREATE_DISTR_LIST"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "CREATE_DISTR_LIST"); + TaskManager.ItemId = itemId; - try - { - // e-mail - string email = name + "@" + domain; + try + { + displayName = displayName.Trim(); + name = name.Trim(); + domain = domain.Trim(); - // check e-mail - if (EmailAddressExists(email)) - return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + // e-mail + string email = name + "@" + domain; - // load organization - Organization org = GetOrganization(itemId); + // check e-mail + if (EmailAddressExists(email)) + return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // load organization + Organization org = GetOrganization(itemId); - string accountName = BuildAccountName(org.OrganizationId, name); + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // add account - // add contact + string accountName = BuildAccountName(org.OrganizationId, name); + + // add account + // add contact int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); @@ -2799,34 +3017,41 @@ namespace WebsitePanel.EnterpriseServer PackageController.UpdatePackageItem(org); } - OrganizationUser manager = OrganizationController.GetAccount(itemId, managerId); - exchange.CreateDistributionList( - org.OrganizationId, - org.DistinguishedName, - displayName, - accountName, - name, - domain, manager.AccountName); + OrganizationUser manager = OrganizationController.GetAccount(itemId, managerId); - // add meta-item - int accountId = AddAccount(itemId, ExchangeAccountType.DistributionList, accountName, - displayName, email, false, - 0, "", null); + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); - // register email address - AddAccountEmailAddress(accountId, email); + exchange.CreateDistributionList( + org.OrganizationId, + org.DistinguishedName, + displayName, + accountName, + name, + domain, manager.AccountName, addressLists.ToArray()); - return accountId; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + ExchangeDistributionList dl = exchange.GetDistributionListGeneralSettings(accountName); + + // add meta-item + int accountId = AddAccount(itemId, ExchangeAccountType.DistributionList, email, + displayName, email, false, + 0, dl.SAMAccountName, null, 0, null); + + // register email address + AddAccountEmailAddress(accountId, email); + + return accountId; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static int DeleteDistributionList(int itemId, int accountId) { @@ -2923,55 +3148,62 @@ namespace WebsitePanel.EnterpriseServer bool hideAddressBook, string managerAccount, string[] memberAccounts, string notes) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "UPDATE_DISTR_LIST_GENERAL"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "UPDATE_DISTR_LIST_GENERAL"); + TaskManager.ItemId = itemId; - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + displayName = displayName.Trim(); - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // get mailbox settings + // load account + ExchangeAccount account = GetAccount(itemId, accountId); + + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetDistributionListGeneralSettings( - account.AccountName, - displayName, - hideAddressBook, - managerAccount, - memberAccounts, - notes); - // update account - account.DisplayName = displayName; - UpdateAccount(account); + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + exchange.SetDistributionListGeneralSettings( + account.AccountName, + displayName, + hideAddressBook, + managerAccount, + memberAccounts, + notes, + addressLists.ToArray()); + + // update account + account.DisplayName = displayName; + UpdateAccount(account); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static ExchangeDistributionList GetDistributionListMailFlowSettings(int itemId, int accountId) { @@ -3017,48 +3249,54 @@ namespace WebsitePanel.EnterpriseServer public static int SetDistributionListMailFlowSettings(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "UPDATE_DISTR_LIST_MAILFLOW"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "UPDATE_DISTR_LIST_MAILFLOW"); + TaskManager.ItemId = itemId; - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetDistributionListMailFlowSettings(account.AccountName, - acceptAccounts, - rejectAccounts, - requireSenderAuthentication); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); + + + exchange.SetDistributionListMailFlowSettings(account.AccountName, + acceptAccounts, + rejectAccounts, + requireSenderAuthentication, + addressLists.ToArray()); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static ExchangeEmailAddress[] GetDistributionListEmailAddresses(int itemId, int accountId) { @@ -3082,152 +3320,165 @@ namespace WebsitePanel.EnterpriseServer public static int AddDistributionListEmailAddress(int itemId, int accountId, string emailAddress) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "ADD_DISTR_LIST_ADDRESS"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "ADD_DISTR_LIST_ADDRESS"); + TaskManager.ItemId = itemId; - try - { - // check - if (EmailAddressExists(emailAddress)) - return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + try + { + // check + if (EmailAddressExists(emailAddress)) + return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // add e-mail - AddAccountEmailAddress(accountId, emailAddress); + // add e-mail + AddAccountEmailAddress(accountId, emailAddress); - // update e-mail addresses + // update e-mail addresses int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetDistributionListEmailAddresses( - account.AccountName, - GetAccountSimpleEmailAddresses(itemId, accountId)); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); + + exchange.SetDistributionListEmailAddresses( + account.AccountName, + GetAccountSimpleEmailAddresses(itemId, accountId), addressLists.ToArray()); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static int SetDistributionListPrimaryEmailAddress(int itemId, int accountId, string emailAddress) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "SET_PRIMARY_DISTR_LIST_ADDRESS"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "SET_PRIMARY_DISTR_LIST_ADDRESS"); + TaskManager.ItemId = itemId; - try - { - // get account - ExchangeAccount account = GetAccount(itemId, accountId); - account.PrimaryEmailAddress = emailAddress; + try + { + // get account + ExchangeAccount account = GetAccount(itemId, accountId); + account.PrimaryEmailAddress = emailAddress; - // update exchange - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // update exchange + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetDistributionListPrimaryEmailAddress( - account.AccountName, - emailAddress); - // save account - UpdateAccount(account); + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + exchange.SetDistributionListPrimaryEmailAddress( + account.AccountName, + emailAddress, + addressLists.ToArray()); + + // save account + UpdateAccount(account); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static int DeleteDistributionListEmailAddresses(int itemId, int accountId, string[] emailAddresses) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "DELETE_DISTR_LIST_ADDRESSES"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "DELETE_DISTR_LIST_ADDRESSES"); + TaskManager.ItemId = itemId; - try - { - // get account - ExchangeAccount account = GetAccount(itemId, accountId); + try + { + // get account + ExchangeAccount account = GetAccount(itemId, accountId); - // delete e-mail addresses - List toDelete = new List(); - foreach (string emailAddress in emailAddresses) - { - if (String.Compare(account.PrimaryEmailAddress, emailAddress, true) != 0) - toDelete.Add(emailAddress); - } + // delete e-mail addresses + List toDelete = new List(); + foreach (string emailAddress in emailAddresses) + { + if (String.Compare(account.PrimaryEmailAddress, emailAddress, true) != 0) + toDelete.Add(emailAddress); + } - // delete from meta-base - DeleteAccountEmailAddresses(accountId, toDelete.ToArray()); + // delete from meta-base + DeleteAccountEmailAddresses(accountId, toDelete.ToArray()); - // delete from Exchange - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // delete from Exchange + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // update e-mail addresses + // update e-mail addresses int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetDistributionListEmailAddresses( - account.AccountName, - GetAccountSimpleEmailAddresses(itemId, accountId)); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); + + exchange.SetDistributionListEmailAddresses( + account.AccountName, + GetAccountSimpleEmailAddresses(itemId, accountId), addressLists.ToArray()); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static ResultObject SetDistributionListPermissions(int itemId, int accountId, string[] sendAsAccounts, string[] sendOnBehalfAccounts) @@ -3273,8 +3524,12 @@ namespace WebsitePanel.EnterpriseServer try { + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); + exchange.SetDistributionListPermissions(org.OrganizationId, account.AccountName, sendAsAccounts, - sendOnBehalfAccounts); + sendOnBehalfAccounts, addressLists.ToArray()); } catch(Exception ex) { @@ -3422,7 +3677,7 @@ namespace WebsitePanel.EnterpriseServer // add meta-item int accountId = AddAccount(itemId, ExchangeAccountType.PublicFolder, accountName, folderPath, email, mailEnabled, - 0, "", null); + 0, "", null, 0 , null); // register email address if(mailEnabled) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs new file mode 100644 index 00000000..a91d80f8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs @@ -0,0 +1,821 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Collections.Specialized; +using System.Data; +using System.Xml; +using WebsitePanel.Providers; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.Lync; + +namespace WebsitePanel.EnterpriseServer.Code.HostedSolution +{ + public class LyncController + { + + + public static LyncServer GetLyncServer(int lyncServiceId, int organizationServiceId) + { + LyncServer ws = new LyncServer(); + + ServiceProviderProxy.Init(ws, lyncServiceId); + + string[] lyncSettings = ws.ServiceProviderSettingsSoapHeaderValue.Settings; + + List resSettings = new List(lyncSettings); + + ExtendLyncSettings(resSettings, "primarydomaincontroller", GetProviderProperty(organizationServiceId, "primarydomaincontroller")); + ExtendLyncSettings(resSettings, "rootou", GetProviderProperty(organizationServiceId, "rootou")); + ws.ServiceProviderSettingsSoapHeaderValue.Settings = resSettings.ToArray(); + return ws; + } + + private static string GetProviderProperty(int organizationServiceId, string property) + { + + Organizations orgProxy = new Organizations(); + + ServiceProviderProxy.Init(orgProxy, organizationServiceId); + + string[] organizationSettings = orgProxy.ServiceProviderSettingsSoapHeaderValue.Settings; + + string value = string.Empty; + foreach (string str in organizationSettings) + { + string[] props = str.Split('='); + if (props[0].ToLower() == property) + { + value = str; + break; + } + } + + return value; + } + + private static void ExtendLyncSettings(List lyncSettings, string property, string value) + { + bool isAdded = false; + for (int i = 0; i < lyncSettings.Count; i++) + { + string[] props = lyncSettings[i].Split('='); + if (props[0].ToLower() == property) + { + lyncSettings[i] = value; + isAdded = true; + break; + } + } + + if (!isAdded) + { + lyncSettings.Add(value); + } + } + + private static int GetLyncServiceID(int packageId) + { + return PackageController.GetPackageServiceId(packageId, ResourceGroups.Lync); + } + + + private static bool CheckQuota(int itemId) + { + Organization org = OrganizationController.GetOrganization(itemId); + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + IntResult userCount = GetLyncUsersCount(itemId); + + int allocatedUsers = cntx.Quotas[Quotas.LYNC_USERS].QuotaAllocatedValue; + + return allocatedUsers == -1 || allocatedUsers > userCount.Value; + } + + + public static LyncUserResult CreateLyncUser(int itemId, int accountId, int lyncUserPlanId) + { + LyncUserResult res = TaskManager.StartResultTask("LYNC", "CREATE_LYNC_USER"); + + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.NOT_AUTHORIZED); + return res; + } + + + LyncUser retLyncUser = new LyncUser(); + bool isLyncUser; + + isLyncUser = DataProvider.CheckLyncUserExists(accountId); + if (isLyncUser) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.USER_IS_ALREADY_LYNC_USER); + return res; + } + + OrganizationUser user; + user = OrganizationController.GetAccount(itemId, accountId); + if (user == null) + { + TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_ACCOUNT); + return res; + } + + user = OrganizationController.GetUserGeneralSettings(itemId, accountId); + if (string.IsNullOrEmpty(user.FirstName)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.USER_FIRST_NAME_IS_NOT_SPECIFIED); + return res; + } + + if (string.IsNullOrEmpty(user.LastName)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.USER_LAST_NAME_IS_NOT_SPECIFIED); + return res; + } + + bool quota = CheckQuota(itemId); + if (!quota) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.USER_QUOTA_HAS_BEEN_REACHED); + return res; + } + + + LyncServer lync; + + try + { + + bool bReloadConfiguration = false; + + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + { + throw new ApplicationException( + string.Format("Organization is null. ItemId={0}", itemId)); + } + + int lyncServiceId = GetLyncServiceID(org.PackageId); + lync = GetLyncServer(lyncServiceId, org.ServiceId); + + if (string.IsNullOrEmpty(org.LyncTenantId)) + { + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + org.LyncTenantId = lync.CreateOrganization(org.OrganizationId, + org.DefaultDomain, + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_ALLOWVIDEO].QuotaAllocatedValue), + Convert.ToInt32(cntx.Quotas[Quotas.LYNC_MAXPARTICIPANTS].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue)); + + if (string.IsNullOrEmpty(org.LyncTenantId)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ENABLE_ORG); + return res; + } + else + { + PackageController.UpdatePackageItem(org); + + bReloadConfiguration = true; + } + } + + LyncUserPlan plan = GetLyncUserPlan(itemId, lyncUserPlanId); + + if (!lync.CreateUser(org.OrganizationId, user.PrimaryEmailAddress, plan)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER); + return res; + } + + if (bReloadConfiguration) + { + LyncControllerAsync userWorker = new LyncControllerAsync(); + userWorker.LyncServiceId = lyncServiceId; + userWorker.OrganizationServiceId = org.ServiceId; + userWorker.Enable_CsComputerAsync(); + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER, ex); + return res; + } + + try + { + DataProvider.AddLyncUser(accountId, lyncUserPlanId); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER_TO_DATABASE, ex); + return res; + } + + res.IsSuccess = true; + TaskManager.CompleteResultTask(); + return res; + + } + + + private static int[] ParseMultiSetting(int lyncServiceId, string settingName) + { + List retIds = new List(); + StringDictionary settings = ServerController.GetServiceSettings(lyncServiceId); + if (!String.IsNullOrEmpty(settings[settingName])) + { + string[] ids = settings[settingName].Split(','); + + int res; + foreach (string id in ids) + { + if (int.TryParse(id, out res)) + retIds.Add(res); + } + } + + if (retIds.Count == 0) + retIds.Add(lyncServiceId); + + return retIds.ToArray(); + + } + + + public static void GetLyncServices(int lyncServiceId, out int[] lyncServiceIds) + { + lyncServiceIds = ParseMultiSetting(lyncServiceId, "LyncServersServiceID"); + } + + + + public static LyncUser GetLyncUserGeneralSettings(int itemId, int accountId) + { + TaskManager.StartTask("LYNC", "GET_LYNC_USER_GENERAL_SETTINGS"); + + LyncUser user = null; + + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + { + throw new ApplicationException( + string.Format("Organization is null. ItemId={0}", itemId)); + } + + int lyncServiceId = GetLyncServiceID(org.PackageId); + LyncServer lync = GetLyncServer(lyncServiceId, org.ServiceId); + + OrganizationUser usr; + usr = OrganizationController.GetAccount(itemId, accountId); + + if (usr != null) + user = lync.GetLyncUserGeneralSettings(org.OrganizationId, usr.PrimaryEmailAddress); + + if (user != null) + { + LyncUserPlan plan = ObjectUtils.FillObjectFromDataReader(DataProvider.GetLyncUserPlanByAccountId(accountId)); + + if (plan != null) + { + user.LyncUserPlanId = plan.LyncUserPlanId; + user.LyncUserPlanName = plan.LyncUserPlanName; + } + } + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + + } + TaskManager.CompleteTask(); + return user; + + } + + public static int DeleteOrganization(int itemId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("LYNC", "DELETE_ORG"); + TaskManager.ItemId = itemId; + + try + { + // delete organization in Exchange + //System.Threading.Thread.Sleep(5000); + Organization org = (Organization)PackageController.GetPackageItem(itemId); + + int lyncServiceId = GetLyncServiceID(org.PackageId); + LyncServer lync = GetLyncServer(lyncServiceId, org.ServiceId); + + bool successful = lync.DeleteOrganization(org.OrganizationId, org.DefaultDomain); + + return successful ? 0 : BusinessErrorCodes.ERROR_LYNC_DELETE_SOME_PROBLEMS; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + + public static LyncUserResult SetUserLyncPlan(int itemId, int accountId, int lyncUserPlanId) + { + LyncUserResult res = TaskManager.StartResultTask("LYNC", "SET_LYNC_USER_LYNCPLAN"); + + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.NOT_AUTHORIZED); + return res; + } + + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + { + throw new ApplicationException( + string.Format("Organization is null. ItemId={0}", itemId)); + } + + int lyncServiceId = GetLyncServiceID(org.PackageId); + LyncServer lync = GetLyncServer(lyncServiceId, org.ServiceId); + + LyncUserPlan plan = GetLyncUserPlan(itemId, lyncUserPlanId); + + OrganizationUser user; + user = OrganizationController.GetAccount(itemId, accountId); + + if (!lync.SetLyncUserPlan(org.OrganizationId, user.PrimaryEmailAddress, plan)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER); + return res; + } + + try + { + DataProvider.SetLyncUserLyncUserplan(accountId, lyncUserPlanId); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER_TO_DATABASE, ex); + return res; + } + + res.IsSuccess = true; + TaskManager.CompleteResultTask(); + return res; + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_UPDATE_LYNC_USER, ex); + return res; + } + + } + + public static LyncUsersPagedResult GetLyncUsers(int itemId, string sortColumn, string sortDirection, int startRow, int count) + { + LyncUsersPagedResult res = TaskManager.StartResultTask("LYNC", "GET_LYNC_USERS"); + + try + { + IDataReader reader = + DataProvider.GetLyncUsers(itemId, sortColumn, sortDirection, startRow, count); + List accounts = new List(); + ObjectUtils.FillCollectionFromDataReader(accounts, reader); + res.Value = new LyncUsersPaged { PageUsers = accounts.ToArray() }; + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.GET_LYNC_USERS, ex); + return res; + } + + IntResult intRes = GetLyncUsersCount(itemId); + res.ErrorCodes.AddRange(intRes.ErrorCodes); + if (!intRes.IsSuccess) + { + TaskManager.CompleteResultTask(res); + return res; + } + res.Value.RecordsCount = intRes.Value; + + TaskManager.CompleteResultTask(); + return res; + } + + public static IntResult GetLyncUsersCount(int itemId) + { + IntResult res = TaskManager.StartResultTask("LYNC", "GET_LYNC_USERS_COUNT"); + try + { + res.Value = DataProvider.GetLyncUsersCount(itemId); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.GET_LYNC_USER_COUNT, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static LyncUserResult DeleteLyncUser(int itemId, int accountId) + { + LyncUserResult res = TaskManager.StartResultTask("LYNC", "DELETE_LYNC_USER"); + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + + if (accountCheck < 0) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.NOT_AUTHORIZED); + return res; + } + + LyncServer lync; + + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + { + throw new ApplicationException( + string.Format("Organization is null. ItemId={0}", itemId)); + } + + int lyncServiceId = GetLyncServiceID(org.PackageId); + lync = GetLyncServer(lyncServiceId, org.ServiceId); + + OrganizationUser user; + user = OrganizationController.GetAccount(itemId, accountId); + + if (user != null) + lync.DeleteUser(user.PrimaryEmailAddress); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_DELETE_LYNC_USER, ex); + return res; + } + + try + { + DataProvider.DeleteLyncUser(accountId); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_DELETE_LYNC_USER_FROM_METADATA, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + + public static Organization GetOrganization(int itemId) + { + return (Organization)PackageController.GetPackageItem(itemId); + } + + + #region Lync Plans + public static List GetLyncUserPlans(int itemId) + { + // place log record + TaskManager.StartTask("LYNC", "GET_LYNC_LYNCUSERPLANS"); + TaskManager.ItemId = itemId; + + try + { + return ObjectUtils.CreateListFromDataReader( + DataProvider.GetLyncUserPlans(itemId)); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static LyncUserPlan GetLyncUserPlan(int itemID, int lyncUserPlanId) + { + + // place log record + TaskManager.StartTask("LYNC", "GET_LYNC_LYNCUSERPLAN"); + TaskManager.ItemId = lyncUserPlanId; + + try + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetLyncUserPlan(lyncUserPlanId)); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int AddLyncUserPlan(int itemID, LyncUserPlan lyncUserPlan) + { + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("LYNC", "ADD_LYNC_LYNCUSERPLAN"); + TaskManager.ItemId = itemID; + + try + { + Organization org = GetOrganization(itemID); + if (org == null) + return -1; + + // load package context + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + lyncUserPlan.Conferencing = lyncUserPlan.Conferencing & Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue); + lyncUserPlan.EnterpriseVoice = lyncUserPlan.EnterpriseVoice & Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_ENTERPRISEVOICE].QuotaAllocatedValue); + if (!lyncUserPlan.EnterpriseVoice) + lyncUserPlan.VoicePolicy = LyncVoicePolicyType.None; + lyncUserPlan.IM = true; + + return DataProvider.AddLyncUserPlan(itemID, lyncUserPlan); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + } + + public static int DeleteLyncUserPlan(int itemID, int lyncUserPlanId) + { + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + TaskManager.StartTask("LYNC", "DELETE_LYNC_LYNCPLAN"); + TaskManager.ItemId = itemID; + + try + { + DataProvider.DeleteLyncUserPlan(lyncUserPlanId); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + } + + public static int SetOrganizationDefaultLyncUserPlan(int itemId, int lyncUserPlanId) + { + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + TaskManager.StartTask("LYNC", "SET_LYNC_LYNCUSERPLAN"); + TaskManager.ItemId = itemId; + + try + { + DataProvider.SetOrganizationDefaultLyncUserPlan(itemId, lyncUserPlanId); + + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + return 1; + + } + + #endregion + + #region Federation Domains + public static LyncFederationDomain[] GetFederationDomains(int itemId) + { + // place log record + TaskManager.StartTask("LYNC", "GET_LYNC_FEDERATIONDOMAINS"); + TaskManager.ItemId = itemId; + + LyncFederationDomain[] lyncFederationDomains = null; + + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + + int lyncServiceId = GetLyncServiceID(org.PackageId); + LyncServer lync = GetLyncServer(lyncServiceId, org.ServiceId); + + lyncFederationDomains = lync.GetFederationDomains(org.OrganizationId); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + return lyncFederationDomains; + } + + public static LyncUserResult AddFederationDomain(int itemId, string domainName, string proxyFqdn) + { + LyncUserResult res = TaskManager.StartResultTask("LYNC", "ADD_LYNC_FEDERATIONDOMAIN"); + TaskManager.ItemId = itemId; + TaskManager.TaskParameters["domainName"] = domainName; + TaskManager.TaskParameters["proxyFqdn"] = proxyFqdn; + + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + + if (accountCheck < 0) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.NOT_AUTHORIZED); + return res; + } + + + try + { + + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + { + throw new ApplicationException( + string.Format("Organization is null. ItemId={0}", itemId)); + } + + int lyncServiceId = GetLyncServiceID(org.PackageId); + LyncServer lync = GetLyncServer(lyncServiceId, org.ServiceId); + + if (string.IsNullOrEmpty(org.LyncTenantId)) + { + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + org.LyncTenantId = lync.CreateOrganization(org.OrganizationId, + org.DefaultDomain, + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_ALLOWVIDEO].QuotaAllocatedValue), + Convert.ToInt32(cntx.Quotas[Quotas.LYNC_MAXPARTICIPANTS].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue)); + + if (string.IsNullOrEmpty(org.LyncTenantId)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ENABLE_ORG); + return res; + } + else + PackageController.UpdatePackageItem(org); + } + + lync = GetLyncServer(lyncServiceId, org.ServiceId); + + lync.AddFederationDomain(org.OrganizationId, domainName, proxyFqdn); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_FEDERATIONDOMAIN, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static LyncUserResult RemoveFederationDomain(int itemId, string domainName) + { + LyncUserResult res = TaskManager.StartResultTask("LYNC", "REMOVE_LYNC_FEDERATIONDOMAIN"); + TaskManager.ItemId = itemId; + TaskManager.TaskParameters["domainName"] = domainName; + + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + + if (accountCheck < 0) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.NOT_AUTHORIZED); + return res; + } + + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + { + throw new ApplicationException( + string.Format("Organization is null. ItemId={0}", itemId)); + } + + int lyncServiceId = GetLyncServiceID(org.PackageId); + LyncServer lync = GetLyncServer(lyncServiceId, org.ServiceId); + + if (org.OrganizationId.ToLower() == domainName.ToLower()) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_REMOVE_LYNC_FEDERATIONDOMAIN); + return res; + } + + lync.RemoveFederationDomain(org.OrganizationId, domainName); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_REMOVE_LYNC_FEDERATIONDOMAIN, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + + #endregion + + + #region Private methods + public static UInt64 ConvertPhoneNumberToLong(string ip) + { + return Convert.ToUInt64(ip); + } + + public static string ConvertLongToPhoneNumber(UInt64 ip) + { + if (ip == 0) + return ""; + + return ip.ToString(); + } + #endregion + + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncControllerAsync.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncControllerAsync.cs new file mode 100644 index 00000000..f30dc4f6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncControllerAsync.cs @@ -0,0 +1,97 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Threading; +using System.Collections.Generic; +using System.Text; +using WebsitePanel.Providers; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.Lync; +using WebsitePanel.EnterpriseServer.Code.HostedSolution; + + +namespace WebsitePanel.EnterpriseServer.Code.HostedSolution +{ + public class LyncControllerAsync + { + private int lyncServiceId; + private int organizationServiceId; + + public int LyncServiceId + { + get { return this.lyncServiceId; } + set { this.lyncServiceId = value; } + } + + public int OrganizationServiceId + { + get { return this.organizationServiceId; } + set { this.organizationServiceId = value; } + } + + + public void Enable_CsComputerAsync() + { + // start asynchronously + Thread t = new Thread(new ThreadStart(Enable_CsComputer)); + t.Start(); + } + + private void Enable_CsComputer() + { + int[] lyncServiceIds; + + LyncController.GetLyncServices(lyncServiceId, out lyncServiceIds); + + foreach (int id in lyncServiceIds) + { + LyncServer lync = null; + try + { + lync = LyncController.GetLyncServer(id, organizationServiceId); + if (lync != null) + { + lync.ReloadConfiguration(); + } + } + catch (Exception exe) + { + TaskManager.WriteError(exe); + continue; + } + } + + + } + + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index d081ec48..b3856eba 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -482,6 +482,66 @@ namespace WebsitePanel.EnterpriseServer } } + + private static bool DeleteLyncUsers(int itemId) + { + bool successful = false; + + try + { + LyncUsersPagedResult res = LyncController.GetLyncUsers(itemId, string.Empty, string.Empty, 0, int.MaxValue); + + if (res.IsSuccess) + { + successful = true; + foreach (LyncUser user in res.Value.PageUsers) + { + try + { + ResultObject delUserResult = LyncController.DeleteLyncUser(itemId, user.AccountID); + if (!delUserResult.IsSuccess) + { + StringBuilder sb = new StringBuilder(); + foreach (string str in delUserResult.ErrorCodes) + { + sb.Append(str); + sb.Append('\n'); + } + + throw new ApplicationException(sb.ToString()); + } + } + catch (Exception ex) + { + successful = false; + TaskManager.WriteError(ex); + } + } + + return successful; + } + else + { + StringBuilder sb = new StringBuilder(); + foreach (string str in res.ErrorCodes) + { + sb.Append(str); + sb.Append('\n'); + } + + throw new ApplicationException(sb.ToString()); + } + } + catch (Exception ex) + { + successful = false; + TaskManager.WriteError(ex); + } + + return successful; + } + + public static int DeleteOrganization(int itemId) { // check account @@ -570,7 +630,22 @@ namespace WebsitePanel.EnterpriseServer successful = false; TaskManager.WriteError(ex); } - + + //Cleanup Lync + try + { + if (!string.IsNullOrEmpty(org.LyncTenantId)) + if (DeleteLyncUsers(itemId)) + LyncController.DeleteOrganization(itemId); + } + catch (Exception ex) + { + successful = false; + TaskManager.WriteError(ex); + } + + + //Cleanup Exchange try { if (!string.IsNullOrEmpty(org.GlobalAddressList)) @@ -633,7 +708,7 @@ namespace WebsitePanel.EnterpriseServer } - private static Organizations GetOrganizationProxy(int serviceId) + public static Organizations GetOrganizationProxy(int serviceId) { Organizations ws = new Organizations(); ServiceProviderProxy.Init(ws, serviceId); @@ -710,9 +785,6 @@ namespace WebsitePanel.EnterpriseServer org.Id = 1; org.OrganizationId = "fabrikam"; org.Name = "Fabrikam Inc"; - org.IssueWarningKB = 150000; - org.ProhibitSendKB = 170000; - org.ProhibitSendReceiveKB = 190000; org.KeepDeletedItemsDays = 14; org.GlobalAddressList = "FabrikamGAL"; return org; @@ -794,6 +866,11 @@ namespace WebsitePanel.EnterpriseServer stats.AllocatedOCSUsers = cntx.Quotas[Quotas.OCS_USERS].QuotaAllocatedValue; } + if (cntx.Groups.ContainsKey(ResourceGroups.Lync)) + { + stats.CreatedLyncUsers = LyncController.GetLyncUsersCount(org.Id).Value; + stats.AllocatedLyncUsers = cntx.Quotas[Quotas.LYNC_USERS].QuotaAllocatedValue; + } return stats; } @@ -980,8 +1057,17 @@ namespace WebsitePanel.EnterpriseServer OrganizationUsersPaged result = new OrganizationUsersPaged(); result.RecordsCount = (int)ds.Tables[0].Rows[0][0]; + List Tmpaccounts = new List(); + ObjectUtils.FillCollectionFromDataView(Tmpaccounts, ds.Tables[1].DefaultView); + result.PageUsers = Tmpaccounts.ToArray(); + List accounts = new List(); - ObjectUtils.FillCollectionFromDataView(accounts, ds.Tables[1].DefaultView); + + foreach (OrganizationUser user in Tmpaccounts.ToArray()) + { + accounts.Add(GetUserGeneralSettings(itemId, user.AccountId)); + } + result.PageUsers = accounts.ToArray(); return result; } @@ -993,22 +1079,23 @@ namespace WebsitePanel.EnterpriseServer return DataProvider.ExchangeAccountEmailAddressExists(emailAddress); } - - private static int AddOrganizationUser(int itemId, string accountName, string displayName, string email, string accountPassword) - { + + private static int AddOrganizationUser(int itemId, string accountName, string displayName, string email, string sAMAccountName, string accountPassword, string subscriberNumber) + { return DataProvider.AddExchangeAccount(itemId, (int)ExchangeAccountType.User, accountName, displayName, email, false, string.Empty, - string.Empty, CryptoUtils.Encrypt(accountPassword)); - - } + sAMAccountName, CryptoUtils.Encrypt(accountPassword), 0, subscriberNumber.Trim()); + + } public static string GetAccountName(string loginName) { - string []parts = loginName.Split('@'); - return parts != null && parts.Length > 1 ? parts[0] : loginName; + //string []parts = loginName.Split('@'); + //return parts != null && parts.Length > 1 ? parts[0] : loginName; + return loginName; } - public static int CreateUser(int itemId, string displayName, string name, string domain, string password, bool enabled, bool sendNotification, string to, out string accountName) + public static int CreateUser(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool enabled, bool sendNotification, string to, out string accountName) { if (string.IsNullOrEmpty(displayName)) throw new ArgumentNullException("displayName"); @@ -1023,55 +1110,171 @@ namespace WebsitePanel.EnterpriseServer throw new ArgumentNullException("password"); accountName = string.Empty; - + // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); if (accountCheck < 0) return accountCheck; - + // place log record TaskManager.StartTask("ORGANIZATION", "CREATE_USER"); TaskManager.ItemId = itemId; + TaskManager.Write("Organization ID :" + itemId); + TaskManager.Write("name :" + name); + TaskManager.Write("domain :" + domain); + TaskManager.Write("subscriberNumber :" + subscriberNumber); - // e-mail - string email = name + "@" + domain; + int userId = -1; - if (EmailAddressExists(email)) - return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; - - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; - - int errorCode; - if (!CheckUserQuota(org.Id, out errorCode)) - return errorCode; - - - Organizations orgProxy = GetOrganizationProxy(org.ServiceId); - - string upn = string.Format("{0}@{1}", name, domain); - accountName = BuildAccountName(org.OrganizationId, name); - orgProxy.CreateUser(org.OrganizationId, accountName, displayName, upn, password, enabled); - - int userId = AddOrganizationUser(itemId, accountName, displayName, email, password); - - // register email address - AddAccountEmailAddress(userId, email); - - if (sendNotification) + try { - SendSummaryLetter(org.Id, userId, true, to, ""); + displayName = displayName.Trim(); + name = name.Trim(); + domain = domain.Trim(); + + // e-mail + string email = name + "@" + domain; + + if (EmailAddressExists(email)) + return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; + + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + int errorCode; + if (!CheckUserQuota(org.Id, out errorCode)) + return errorCode; + + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + string upn = string.Format("{0}@{1}", name, domain); + string sAMAccountName = BuildAccountName(org.OrganizationId, name); + + TaskManager.Write("accountName :" + sAMAccountName); + TaskManager.Write("upn :" + upn); + + if (orgProxy.CreateUser(org.OrganizationId, sAMAccountName, displayName, upn, password, enabled) == 0) + { + OrganizationUser retUser = orgProxy.GetUserGeneralSettings(upn, org.OrganizationId); + TaskManager.Write("sAMAccountName :" + retUser.DomainUserName); + + userId = AddOrganizationUser(itemId, upn, displayName, email, retUser.DomainUserName, password, subscriberNumber); + accountName = upn; + + // register email address + AddAccountEmailAddress(userId, email); + + if (sendNotification) + { + SendSummaryLetter(org.Id, userId, true, to, ""); + } + } + else + { + TaskManager.WriteError("Failed to create user"); + } } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + return userId; + } + + + + public static int ImportUser(int itemId, string accountName, string displayName, string name, string domain, string password, string subscriberNumber) + { + if (string.IsNullOrEmpty(accountName)) + throw new ArgumentNullException("accountName"); + + if (string.IsNullOrEmpty(displayName)) + throw new ArgumentNullException("displayName"); + + if (string.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + + if (string.IsNullOrEmpty(domain)) + throw new ArgumentNullException("domain"); + + if (string.IsNullOrEmpty(password)) + throw new ArgumentNullException("password"); + + + // place log record + TaskManager.StartTask("ORGANIZATION", "IMPORT_USER"); + TaskManager.ItemId = itemId; + TaskManager.Write("Organization ID :" + itemId); + TaskManager.Write("account :" + accountName); + TaskManager.Write("name :" + name); + TaskManager.Write("domain :" + domain); + + int userId = -1; + + try + { + accountName = accountName.Trim(); + displayName = displayName.Trim(); + name = name.Trim(); + domain = domain.Trim(); + + // e-mail + string email = name + "@" + domain; + + if (EmailAddressExists(email)) + return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; + + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + int errorCode; + if (!CheckUserQuota(org.Id, out errorCode)) + return errorCode; + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + string upn = string.Format("{0}@{1}", name, domain); + TaskManager.Write("upn :" + upn); + + OrganizationUser retUser = orgProxy.GetUserGeneralSettings(accountName, org.OrganizationId); + + TaskManager.Write("sAMAccountName :" + retUser.DomainUserName); + + userId = AddOrganizationUser(itemId, accountName, displayName, email, retUser.DomainUserName, password, subscriberNumber); + + AddAccountEmailAddress(userId, email); + + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + return userId; } - private static void AddAccountEmailAddress(int accountId, string emailAddress) { @@ -1080,28 +1283,40 @@ namespace WebsitePanel.EnterpriseServer private static string BuildAccountName(string orgId, string name) { - int maxLen = 19 - orgId.Length; - - // try to choose name - int i = 0; - while (true) + string accountName = name = name.Replace(" ", ""); + string CounterStr = "00000"; + int counter = 0; + bool bFound = false; + do { - string num = i > 0 ? i.ToString() : ""; - int len = maxLen - num.Length; + accountName = genSamLogin(name, CounterStr); - if (name.Length > len) - name = name.Substring(0, len); + if (!AccountExists(accountName)) bFound = true; - string accountName = name + num + "_" + orgId; - - // check if already exists - if (!AccountExists(accountName)) - return accountName; - - i++; + CounterStr = counter.ToString("d5"); + counter++; } + while (!bFound); + + return accountName; } + private static string genSamLogin(string login, string strCounter) + { + int maxLogin = 20; + int fullLen = login.Length + strCounter.Length; + if (fullLen <= maxLogin) + return login + strCounter; + else + { + if (login.Length - (fullLen - maxLogin) > 0) + return login.Substring(0, login.Length - (fullLen - maxLogin)) + strCounter; + else return strCounter; // ???? + } + + } + + private static bool AccountExists(string accountName) { return DataProvider.ExchangeAccountExists(accountName); @@ -1180,6 +1395,18 @@ namespace WebsitePanel.EnterpriseServer return account; } + public static OrganizationUser GetAccountByAccountName(int itemId, string AccountName) + { + OrganizationUser account = ObjectUtils.FillObjectFromDataReader( + DataProvider.GetExchangeAccountByAccountName(itemId, AccountName)); + + if (account == null) + return null; + + return account; + } + + private static void DeleteUserFromMetabase(int itemId, int accountId) { // try to get organization @@ -1217,11 +1444,16 @@ namespace WebsitePanel.EnterpriseServer string accountName = GetAccountName(account.AccountName); - OrganizationUser retUser = orgProxy.GeUserGeneralSettings(accountName, org.OrganizationId); + OrganizationUser retUser = orgProxy.GetUserGeneralSettings(accountName, org.OrganizationId); retUser.AccountId = accountId; retUser.AccountName = account.AccountName; retUser.PrimaryEmailAddress = account.PrimaryEmailAddress; retUser.AccountType = account.AccountType; + retUser.CrmUserId = CRMController.GetCrmUserId(accountId); + retUser.IsOCSUser = DataProvider.CheckOCSUserExists(accountId); + retUser.IsLyncUser = DataProvider.CheckLyncUserExists(accountId); + retUser.IsBlackBerryUser = BlackBerryController.CheckBlackBerryUserExists(accountId); + retUser.SubscriberNumber = account.SubscriberNumber; return retUser; } @@ -1240,7 +1472,7 @@ namespace WebsitePanel.EnterpriseServer string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes, string externalEmail) + string webPage, string notes, string externalEmail, string subscriberNumber) { // check account @@ -1253,6 +1485,10 @@ namespace WebsitePanel.EnterpriseServer try { + displayName = displayName.Trim(); + firstName = firstName.Trim(); + lastName = lastName.Trim(); + // load organization Organization org = GetOrganization(itemId); if (org == null) @@ -1303,6 +1539,7 @@ namespace WebsitePanel.EnterpriseServer // update account account.DisplayName = displayName; + account.SubscriberNumber = subscriberNumber; //account. if (!String.IsNullOrEmpty(password)) @@ -1329,7 +1566,8 @@ namespace WebsitePanel.EnterpriseServer { DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName, account.PrimaryEmailAddress, account.MailEnabledPublicFolder, - account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword); + account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword, account.MailboxPlanId, + (string.IsNullOrEmpty(account.SubscriberNumber) ? null : account.SubscriberNumber.Trim())); } @@ -1377,11 +1615,58 @@ namespace WebsitePanel.EnterpriseServer } #endregion - return ObjectUtils.CreateListFromDataReader( - DataProvider.SearchOrganizationAccounts(SecurityContext.User.UserId, itemId, - filterColumn, filterValue, sortColumn, includeMailboxes)); + List Tmpaccounts = ObjectUtils.CreateListFromDataReader( + DataProvider.SearchOrganizationAccounts(SecurityContext.User.UserId, itemId, + filterColumn, filterValue, sortColumn, includeMailboxes)); + + List Accounts = new List(); + + foreach (OrganizationUser user in Tmpaccounts.ToArray()) + { + Accounts.Add(GetUserGeneralSettings(itemId, user.AccountId)); + } + + return Accounts; } + public static int GetAccountIdByUserPrincipalName(int itemId, string userPrincipalName) + { + // place log record + TaskManager.StartTask("ORGANIZATION", "GET_ACCOUNT_BYUPN"); + TaskManager.ItemId = itemId; + + int accounId = -1; + + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return 0; + + // get samaccountName + //Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + //string accountName = orgProxy.GetSamAccountNameByUserPrincipalName(org.OrganizationId, userPrincipalName); + + // load account + OrganizationUser account = GetAccountByAccountName(itemId, userPrincipalName); + + if (account != null) + accounId = account.AccountId; + + return accounId; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + #endregion public static List GetOrganizationDomains(int itemId) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Packages/PackageController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Packages/PackageController.cs index c4d60460..a80b8388 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Packages/PackageController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Packages/PackageController.cs @@ -399,7 +399,7 @@ namespace WebsitePanel.EnterpriseServer // check account result.Result = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive - | DemandAccount.IsReseller); + | DemandAccount.IsResellerCSR); if (result.Result < 0) return result; // check if domain exists @@ -652,7 +652,7 @@ namespace WebsitePanel.EnterpriseServer { // check account result.Result = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive - | DemandAccount.IsReseller); + | DemandAccount.IsResellerCSR); if (result.Result < 0) return result; int packageId = -1; @@ -820,7 +820,7 @@ namespace WebsitePanel.EnterpriseServer { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive - | DemandAccount.IsReseller); + | DemandAccount.IsResellerCSR); if (accountCheck < 0) return accountCheck; List packages = new List(); @@ -1521,19 +1521,6 @@ namespace WebsitePanel.EnterpriseServer } } - // Exchange Hosted Edition - else if (String.Compare(PackageSettings.EXCHANGE_HOSTED_EDITION, settingsName, true) == 0) - { - // load Exchange service settings - int exchServiceId = GetPackageServiceId(packageId, ResourceGroups.ExchangeHostedEdition); - if (exchServiceId > 0) - { - StringDictionary exchSettings = ServerController.GetServiceSettings(exchServiceId); - settings["temporaryDomain"] = exchSettings["temporaryDomain"]; - settings["ecpURL"] = exchSettings["ecpURL"]; - } - } - // VPS else if (String.Compare(PackageSettings.VIRTUAL_PRIVATE_SERVERS, settingsName, true) == 0) { @@ -1965,6 +1952,21 @@ namespace WebsitePanel.EnterpriseServer } items["Plans"] = plans; + //Add ons + Hashtable addOns = new Hashtable(); + int i = 0; + foreach (PackageInfo package in packages) + { + List lstAddOns = ObjectUtils.CreateListFromDataSet(GetPackageAddons(package.PackageId)); + foreach (PackageAddonInfo addOn in lstAddOns) + { + addOns.Add(i, addOn); + i++; + } + + } + items["Addons"] = addOns; + // package contexts Hashtable cntxs = new Hashtable(); foreach (PackageInfo package in packages) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs index fced17ff..db512686 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs @@ -2715,6 +2715,12 @@ namespace WebsitePanel.EnterpriseServer // WebServer server = GetWebServer(item.ServiceId); + StringDictionary webSettings = ServerController.GetServiceSettings(item.ServiceId); + if (webSettings["WmSvc.NETBIOS"] != null) + { + accountName = webSettings["WmSvc.NETBIOS"].ToString() + "\\" + accountName; + } + // if (server.CheckWebManagementAccountExists(accountName)) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj index cae3c3b8..cb74773e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj @@ -78,6 +78,7 @@
+ @@ -89,7 +90,6 @@ - @@ -131,6 +131,8 @@ + + @@ -164,7 +166,6 @@ - @@ -237,6 +238,10 @@ + + esLync.asmx + Component + esVirtualizationServerForPrivateCloud.asmx Component @@ -292,10 +297,6 @@ esDatabaseServers.asmx Component - - esExchangeHostedEdition.asmx - Component - esExchangeServer.asmx Component diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeHostedEdition.asmx b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeHostedEdition.asmx deleted file mode 100644 index e6c85aa8..00000000 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeHostedEdition.asmx +++ /dev/null @@ -1 +0,0 @@ -<%@ WebService Language="C#" CodeBehind="esExchangeHostedEdition.asmx.cs" Class="WebsitePanel.EnterpriseServer.esExchangeHostedEdition" %> diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeHostedEdition.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeHostedEdition.asmx.cs deleted file mode 100644 index 300f93b9..00000000 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeHostedEdition.asmx.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.Services; -using Microsoft.Web.Services3; -using System.ComponentModel; -using WebsitePanel.Providers.ExchangeHostedEdition; -using WebsitePanel.Providers.Common; -using WebsitePanel.Providers.ResultObjects; - -namespace WebsitePanel.EnterpriseServer -{ - /// - /// Summary description for esExchangeHostedEdition - /// - [WebService(Namespace = "http://smbsaas/websitepanel/enterpriseserver")] - [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] - [Policy("ServerPolicy")] - [ToolboxItem(false)] - public class esExchangeHostedEdition : WebService - { - [WebMethod] - public List GetOrganizations(int packageId) - { - return ExchangeHostedEditionController.GetOrganizations(packageId); - } - - [WebMethod] - public IntResult CreateExchangeOrganization(int packageId, string organizationId, - string domain, string adminName, string adminEmail, string adminPassword) - { - return ExchangeHostedEditionController.CreateOrganization(packageId, organizationId, domain, adminName, adminEmail, adminPassword); - } - - [WebMethod] - public ExchangeOrganization GetExchangeOrganizationDetails(int itemId) - { - return ExchangeHostedEditionController.GetOrganizationDetails(itemId); - } - - [WebMethod] - public List GetExchangeOrganizationDomains(int itemId) - { - return ExchangeHostedEditionController.GetOrganizationDomains(itemId); - } - - [WebMethod] - public string GetExchangeOrganizationSummary(int itemId) - { - return ExchangeHostedEditionController.GetExchangeOrganizationSummary(itemId); - } - - [WebMethod] - public ResultObject SendExchangeOrganizationSummary(int itemId, string toEmail) - { - return ExchangeHostedEditionController.SendExchangeOrganizationSummary(itemId, toEmail); - } - - [WebMethod] - public ResultObject AddExchangeOrganizationDomain(int itemId, string domain) - { - return ExchangeHostedEditionController.AddOrganizationDomain(itemId, domain); - } - - [WebMethod] - public ResultObject DeleteExchangeOrganizationDomain(int itemId, string domain) - { - return ExchangeHostedEditionController.DeleteOrganizationDomain(itemId, domain); - } - - [WebMethod] - public ResultObject UpdateExchangeOrganizationQuotas(int itemId, int mailboxesNumber, int contactsNumber, int distributionListsNumber) - { - return ExchangeHostedEditionController.UpdateOrganizationQuotas(itemId, mailboxesNumber, contactsNumber, distributionListsNumber); - } - - [WebMethod] - public ResultObject UpdateExchangeOrganizationCatchAllAddress(int itemId, string catchAllEmail) - { - return ExchangeHostedEditionController.UpdateOrganizationCatchAllAddress(itemId, catchAllEmail); - } - - [WebMethod] - public ResultObject UpdateExchangeOrganizationServicePlan(int itemId, int newServiceId) - { - return ExchangeHostedEditionController.UpdateOrganizationServicePlan(itemId, newServiceId); - } - - [WebMethod] - public ResultObject DeleteExchangeOrganization(int itemId) - { - return ExchangeHostedEditionController.DeleteOrganization(itemId); - } - } -} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs index 984bbd28..d3da1430 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs @@ -46,80 +46,81 @@ namespace WebsitePanel.EnterpriseServer [ToolboxItem(false)] public class esExchangeServer : WebService { - #region Organizations - [WebMethod] - public DataSet GetRawExchangeOrganizationsPaged(int packageId, bool recursive, - string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) - { - return ExchangeServerController.GetRawExchangeOrganizationsPaged(packageId, recursive, - filterColumn, filterValue, sortColumn, startRow, maximumRows); - } + #region Organizations + [WebMethod] + public DataSet GetRawExchangeOrganizationsPaged(int packageId, bool recursive, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return ExchangeServerController.GetRawExchangeOrganizationsPaged(packageId, recursive, + filterColumn, filterValue, sortColumn, startRow, maximumRows); + } - [WebMethod] - public OrganizationsPaged GetExchangeOrganizationsPaged(int packageId, bool recursive, - string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) - { - return ExchangeServerController.GetExchangeOrganizationsPaged(packageId, recursive, - filterColumn, filterValue, sortColumn, startRow, maximumRows); - } + [WebMethod] + public OrganizationsPaged GetExchangeOrganizationsPaged(int packageId, bool recursive, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return ExchangeServerController.GetExchangeOrganizationsPaged(packageId, recursive, + filterColumn, filterValue, sortColumn, startRow, maximumRows); + } - [WebMethod] - public List GetExchangeOrganizations(int packageId, bool recursive) - { - return ExchangeServerController.GetExchangeOrganizations(packageId, recursive); - } + [WebMethod] + public List GetExchangeOrganizations(int packageId, bool recursive) + { + return ExchangeServerController.GetExchangeOrganizations(packageId, recursive); + } - [WebMethod] - public Organization GetOrganization(int itemId) - { - return ExchangeServerController.GetOrganization(itemId); - } + [WebMethod] + public Organization GetOrganization(int itemId) + { + return ExchangeServerController.GetOrganization(itemId); + } - [WebMethod] - public OrganizationStatistics GetOrganizationStatistics(int itemId) - { - return ExchangeServerController.GetOrganizationStatistics(itemId); - } + [WebMethod] + public OrganizationStatistics GetOrganizationStatistics(int itemId) + { + return ExchangeServerController.GetOrganizationStatistics(itemId); + } - - [WebMethod] - public int DeleteOrganization(int itemId) - { - return ExchangeServerController.DeleteOrganization(itemId); - } - [WebMethod] - public Organization GetOrganizationStorageLimits(int itemId) - { - return ExchangeServerController.GetOrganizationStorageLimits(itemId); - } + [WebMethod] + public int DeleteOrganization(int itemId) + { + return ExchangeServerController.DeleteOrganization(itemId); + } - [WebMethod] - public int SetOrganizationStorageLimits(int itemId, int issueWarningKB, int prohibitSendKB, - int prohibitSendReceiveKB, int keepDeletedItemsDays, bool applyToMailboxes) - { - return ExchangeServerController.SetOrganizationStorageLimits(itemId, issueWarningKB, prohibitSendKB, - prohibitSendReceiveKB, keepDeletedItemsDays, applyToMailboxes); - } + [WebMethod] + public Organization GetOrganizationStorageLimits(int itemId) + { + return ExchangeServerController.GetOrganizationStorageLimits(itemId); + } - [WebMethod] - public ExchangeItemStatistics[] GetMailboxesStatistics(int itemId) - { - return ExchangeServerController.GetMailboxesStatistics(itemId); - } + [WebMethod] + public int SetOrganizationStorageLimits(int itemId, int issueWarningKB, int prohibitSendKB, + int prohibitSendReceiveKB, int keepDeletedItemsDays, bool applyToMailboxes) + { + return ExchangeServerController.SetOrganizationStorageLimits(itemId, issueWarningKB, prohibitSendKB, + prohibitSendReceiveKB, keepDeletedItemsDays, applyToMailboxes); + } - [WebMethod] - public ExchangeItemStatistics[] GetPublicFoldersStatistics(int itemId) - { - return ExchangeServerController.GetPublicFoldersStatistics(itemId); - } + [WebMethod] + public ExchangeItemStatistics[] GetMailboxesStatistics(int itemId) + { + return ExchangeServerController.GetMailboxesStatistics(itemId); + } - [WebMethod] - public int CalculateOrganizationDiskspace(int itemId) - { - return ExchangeServerController.CalculateOrganizationDiskspace(itemId); - } + [WebMethod] + public ExchangeMailboxStatistics GetMailboxStatistics(int itemId, int accountId) + { + return ExchangeServerController.GetMailboxStatistics(itemId, accountId); + } + + + [WebMethod] + public int CalculateOrganizationDiskspace(int itemId) + { + return ExchangeServerController.CalculateOrganizationDiskspace(itemId); + } [WebMethod] public ExchangeActiveSyncPolicy GetActiveSyncPolicy(int itemId) @@ -139,14 +140,14 @@ namespace WebsitePanel.EnterpriseServer passwordRecoveryEnabled, deviceEncryptionEnabled, allowSimplePassword, maxPasswordFailedAttempts, minPasswordLength, inactivityLockMin, passwordExpirationDays, passwordHistory, refreshInteval); } - #endregion + #endregion - #region Domains - [WebMethod] + #region Domains + [WebMethod] public int AddAuthoritativeDomain(int itemId, int domainId) - { + { return ExchangeServerController.AddAuthoritativeDomain(itemId, domainId); - } + } [WebMethod] public int DeleteAuthoritativeDomain(int itemId, int domainId) @@ -155,42 +156,50 @@ namespace WebsitePanel.EnterpriseServer } - #endregion + #endregion - #region Accounts - [WebMethod] - public ExchangeAccountsPaged GetAccountsPaged(int itemId, string accountTypes, - string filterColumn, string filterValue, string sortColumn, - int startRow, int maximumRows) - { + #region Accounts + [WebMethod] + public ExchangeAccountsPaged GetAccountsPaged(int itemId, string accountTypes, + string filterColumn, string filterValue, string sortColumn, + int startRow, int maximumRows) + { return ExchangeServerController.GetAccountsPaged(itemId, accountTypes, - filterColumn, filterValue, sortColumn, - startRow, maximumRows); - } + filterColumn, filterValue, sortColumn, + startRow, maximumRows); + } - [WebMethod] - public List GetAccounts(int itemId, ExchangeAccountType accountType) - { - return ExchangeServerController.GetAccounts(itemId, accountType); - } + [WebMethod] + public List GetAccounts(int itemId, ExchangeAccountType accountType) + { + return ExchangeServerController.GetAccounts(itemId, accountType); + } - [WebMethod] - public List SearchAccounts(int itemId, - bool includeMailboxes, bool includeContacts, bool includeDistributionLists, + + [WebMethod] + public List GetExchangeAccountByMailboxPlanId(int itemId, int mailboxPlanId) + { + return ExchangeServerController.GetExchangeAccountByMailboxPlanId(itemId, mailboxPlanId); + } + + + [WebMethod] + public List SearchAccounts(int itemId, + bool includeMailboxes, bool includeContacts, bool includeDistributionLists, bool includeRooms, bool includeEquipment, - string filterColumn, string filterValue, string sortColumn) - { - return ExchangeServerController.SearchAccounts(itemId, - includeMailboxes, includeContacts, includeDistributionLists, + string filterColumn, string filterValue, string sortColumn) + { + return ExchangeServerController.SearchAccounts(itemId, + includeMailboxes, includeContacts, includeDistributionLists, includeRooms, includeEquipment, - filterColumn, filterValue, sortColumn); - } + filterColumn, filterValue, sortColumn); + } - [WebMethod] - public ExchangeAccount GetAccount(int itemId, int accountId) - { - return ExchangeServerController.GetAccount(itemId, accountId); - } + [WebMethod] + public ExchangeAccount GetAccount(int itemId, int accountId) + { + return ExchangeServerController.GetAccount(itemId, accountId); + } [WebMethod] public ExchangeAccount SearchAccount(ExchangeAccountType accountType, string primaryEmailAddress) @@ -204,21 +213,21 @@ namespace WebsitePanel.EnterpriseServer return ExchangeServerController.CheckAccountCredentials(itemId, email, password); } - #endregion + #endregion - #region Mailboxes - [WebMethod] - public int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, - string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress) - { - return ExchangeServerController.CreateMailbox(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress); - } + #region Mailboxes + [WebMethod] + public int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, + string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, string subscriberNumber) + { + return ExchangeServerController.CreateMailbox(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress, mailboxPlanId, subscriberNumber); + } - [WebMethod] - public int DeleteMailbox(int itemId, int accountId) - { - return ExchangeServerController.DeleteMailbox(itemId, accountId); - } + [WebMethod] + public int DeleteMailbox(int itemId, int accountId) + { + return ExchangeServerController.DeleteMailbox(itemId, accountId); + } [WebMethod] public int DisableMailbox(int itemId, int accountId) @@ -227,87 +236,66 @@ namespace WebsitePanel.EnterpriseServer } - [WebMethod] - public ExchangeMailbox GetMailboxGeneralSettings(int itemId, int accountId) - { - return ExchangeServerController.GetMailboxGeneralSettings(itemId, accountId); - } + [WebMethod] + public ExchangeMailbox GetMailboxGeneralSettings(int itemId, int accountId) + { + return ExchangeServerController.GetMailboxGeneralSettings(itemId, accountId); + } - [WebMethod] - public int SetMailboxGeneralSettings(int itemId, int accountId, string displayName, - string password, bool hideAddressBook, bool disabled, string firstName, string initials, - string lastName, string address, string city, string state, string zip, string country, - string jobTitle, string company, string department, string office, string managerAccountName, - string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes) - { - return ExchangeServerController.SetMailboxGeneralSettings(itemId, accountId, displayName, - password, hideAddressBook, disabled, firstName, initials, - lastName, address, city, state, zip, country, - jobTitle, company, department, office, managerAccountName, - businessPhone, fax, homePhone, mobilePhone, pager, - webPage, notes); - } + [WebMethod] + public int SetMailboxGeneralSettings(int itemId, int accountId, bool hideAddressBook, bool disabled) + { + return ExchangeServerController.SetMailboxGeneralSettings(itemId, accountId, hideAddressBook, disabled); + } - [WebMethod] - public ExchangeEmailAddress[] GetMailboxEmailAddresses(int itemId, int accountId) - { - return ExchangeServerController.GetMailboxEmailAddresses(itemId, accountId); - } + [WebMethod] + public ExchangeEmailAddress[] GetMailboxEmailAddresses(int itemId, int accountId) + { + return ExchangeServerController.GetMailboxEmailAddresses(itemId, accountId); + } - [WebMethod] - public int AddMailboxEmailAddress(int itemId, int accountId, string emailAddress) - { - return ExchangeServerController.AddMailboxEmailAddress(itemId, accountId, emailAddress); - } + [WebMethod] + public int AddMailboxEmailAddress(int itemId, int accountId, string emailAddress) + { + return ExchangeServerController.AddMailboxEmailAddress(itemId, accountId, emailAddress); + } - [WebMethod] - public int SetMailboxPrimaryEmailAddress(int itemId, int accountId, string emailAddress) - { - return ExchangeServerController.SetMailboxPrimaryEmailAddress(itemId, accountId, emailAddress); - } + [WebMethod] + public int SetMailboxPrimaryEmailAddress(int itemId, int accountId, string emailAddress) + { + return ExchangeServerController.SetMailboxPrimaryEmailAddress(itemId, accountId, emailAddress); + } - [WebMethod] - public int DeleteMailboxEmailAddresses(int itemId, int accountId, string[] emailAddresses) - { - return ExchangeServerController.DeleteMailboxEmailAddresses(itemId, accountId, emailAddresses); - } + [WebMethod] + public int DeleteMailboxEmailAddresses(int itemId, int accountId, string[] emailAddresses) + { + return ExchangeServerController.DeleteMailboxEmailAddresses(itemId, accountId, emailAddresses); + } - [WebMethod] - public ExchangeMailbox GetMailboxMailFlowSettings(int itemId, int accountId) - { - return ExchangeServerController.GetMailboxMailFlowSettings(itemId, accountId); - } + [WebMethod] + public ExchangeMailbox GetMailboxMailFlowSettings(int itemId, int accountId) + { + return ExchangeServerController.GetMailboxMailFlowSettings(itemId, accountId); + } - [WebMethod] - public int SetMailboxMailFlowSettings(int itemId, int accountId, - bool enableForwarding, string forwardingAccountName, bool forwardToBoth, - string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, - int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, + [WebMethod] + public int SetMailboxMailFlowSettings(int itemId, int accountId, + bool enableForwarding, string forwardingAccountName, bool forwardToBoth, + string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - return ExchangeServerController.SetMailboxMailFlowSettings(itemId, accountId, - enableForwarding, forwardingAccountName, forwardToBoth, - sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, - requireSenderAuthentication); - } + { + return ExchangeServerController.SetMailboxMailFlowSettings(itemId, accountId, + enableForwarding, forwardingAccountName, forwardToBoth, + sendOnBehalfAccounts, acceptAccounts, rejectAccounts, + requireSenderAuthentication); + } - [WebMethod] - public ExchangeMailbox GetMailboxAdvancedSettings(int itemId, int accountId) - { - return ExchangeServerController.GetMailboxAdvancedSettings(itemId, accountId); - } - [WebMethod] - public int SetMailboxAdvancedSettings(int itemId, int accountId, bool enablePOP, - bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) - { - return ExchangeServerController.SetMailboxAdvancedSettings(itemId, accountId, enablePOP, - enableIMAP, enableOWA, enableMAPI, enableActiveSync, - issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); - } + [WebMethod] + public int SetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId) + { + return ExchangeServerController.SetExchangeMailboxPlan(itemId, accountId, mailboxPlanId); + } [WebMethod] public string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup) @@ -327,137 +315,137 @@ namespace WebsitePanel.EnterpriseServer return ExchangeServerController.SetMailboxManagerSettings(itemId, accountId, pmmAllowed, action); } - [WebMethod] + [WebMethod] public ExchangeMailbox GetMailboxPermissions(int itemId, int accountId) { - return ExchangeServerController.GetMailboxPermissions(itemId, accountId); + return ExchangeServerController.GetMailboxPermissions(itemId, accountId); } [WebMethod] public int SetMailboxPermissions(int itemId, int accountId, string[] sendAsaccounts, string[] fullAccessAcounts) { - return ExchangeServerController.SetMailboxPermissions(itemId, accountId, sendAsaccounts, fullAccessAcounts); + return ExchangeServerController.SetMailboxPermissions(itemId, accountId, sendAsaccounts, fullAccessAcounts); } - - - #endregion - #region Contacts - [WebMethod] - public int CreateContact(int itemId, string displayName, string email) - { - return ExchangeServerController.CreateContact(itemId, displayName, email); - } - [WebMethod] - public int DeleteContact(int itemId, int accountId) - { - return ExchangeServerController.DeleteContact(itemId, accountId); - } + #endregion - [WebMethod] - public ExchangeContact GetContactGeneralSettings(int itemId, int accountId) - { - return ExchangeServerController.GetContactGeneralSettings(itemId, accountId); - } + #region Contacts + [WebMethod] + public int CreateContact(int itemId, string displayName, string email) + { + return ExchangeServerController.CreateContact(itemId, displayName, email); + } - [WebMethod] - public int SetContactGeneralSettings(int itemId, int accountId, string displayName, string emailAddress, - bool hideAddressBook, string firstName, string initials, - string lastName, string address, string city, string state, string zip, string country, - string jobTitle, string company, string department, string office, string managerAccountName, - string businessPhone, string fax, string homePhone, string mobilePhone, string pager, + [WebMethod] + public int DeleteContact(int itemId, int accountId) + { + return ExchangeServerController.DeleteContact(itemId, accountId); + } + + [WebMethod] + public ExchangeContact GetContactGeneralSettings(int itemId, int accountId) + { + return ExchangeServerController.GetContactGeneralSettings(itemId, accountId); + } + + [WebMethod] + public int SetContactGeneralSettings(int itemId, int accountId, string displayName, string emailAddress, + bool hideAddressBook, string firstName, string initials, + string lastName, string address, string city, string state, string zip, string country, + string jobTitle, string company, string department, string office, string managerAccountName, + string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes, int useMapiRichTextFormat) - { - return ExchangeServerController.SetContactGeneralSettings(itemId, accountId, displayName, emailAddress, - hideAddressBook, firstName, initials, - lastName, address, city, state, zip, country, - jobTitle, company, department, office, managerAccountName, - businessPhone, fax, homePhone, mobilePhone, pager, - webPage, notes, useMapiRichTextFormat); - } + { + return ExchangeServerController.SetContactGeneralSettings(itemId, accountId, displayName, emailAddress, + hideAddressBook, firstName, initials, + lastName, address, city, state, zip, country, + jobTitle, company, department, office, managerAccountName, + businessPhone, fax, homePhone, mobilePhone, pager, + webPage, notes, useMapiRichTextFormat); + } - [WebMethod] - public ExchangeContact GetContactMailFlowSettings(int itemId, int accountId) - { - return ExchangeServerController.GetContactMailFlowSettings(itemId, accountId); - } + [WebMethod] + public ExchangeContact GetContactMailFlowSettings(int itemId, int accountId) + { + return ExchangeServerController.GetContactMailFlowSettings(itemId, accountId); + } - [WebMethod] - public int SetContactMailFlowSettings(int itemId, int accountId, - string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - return ExchangeServerController.SetContactMailFlowSettings(itemId, accountId, - acceptAccounts, rejectAccounts, requireSenderAuthentication); - } - #endregion + [WebMethod] + public int SetContactMailFlowSettings(int itemId, int accountId, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + return ExchangeServerController.SetContactMailFlowSettings(itemId, accountId, + acceptAccounts, rejectAccounts, requireSenderAuthentication); + } + #endregion - #region Distribution Lists - [WebMethod] - public int CreateDistributionList(int itemId, string displayName, string name, string domain, int managerId) - { - return ExchangeServerController.CreateDistributionList(itemId, displayName, name, domain, managerId); - } + #region Distribution Lists + [WebMethod] + public int CreateDistributionList(int itemId, string displayName, string name, string domain, int managerId) + { + return ExchangeServerController.CreateDistributionList(itemId, displayName, name, domain, managerId); + } - [WebMethod] - public int DeleteDistributionList(int itemId, int accountId) - { - return ExchangeServerController.DeleteDistributionList(itemId, accountId); - } + [WebMethod] + public int DeleteDistributionList(int itemId, int accountId) + { + return ExchangeServerController.DeleteDistributionList(itemId, accountId); + } - [WebMethod] - public ExchangeDistributionList GetDistributionListGeneralSettings(int itemId, int accountId) - { - return ExchangeServerController.GetDistributionListGeneralSettings(itemId, accountId); - } + [WebMethod] + public ExchangeDistributionList GetDistributionListGeneralSettings(int itemId, int accountId) + { + return ExchangeServerController.GetDistributionListGeneralSettings(itemId, accountId); + } - [WebMethod] - public int SetDistributionListGeneralSettings(int itemId, int accountId, string displayName, - bool hideAddressBook, string managerAccount, string[] memberAccounts, - string notes) - { - return ExchangeServerController.SetDistributionListGeneralSettings(itemId, accountId, displayName, - hideAddressBook, managerAccount, memberAccounts, - notes); - } + [WebMethod] + public int SetDistributionListGeneralSettings(int itemId, int accountId, string displayName, + bool hideAddressBook, string managerAccount, string[] memberAccounts, + string notes) + { + return ExchangeServerController.SetDistributionListGeneralSettings(itemId, accountId, displayName, + hideAddressBook, managerAccount, memberAccounts, + notes); + } - [WebMethod] - public ExchangeDistributionList GetDistributionListMailFlowSettings(int itemId, int accountId) - { - return ExchangeServerController.GetDistributionListMailFlowSettings(itemId, accountId); - } + [WebMethod] + public ExchangeDistributionList GetDistributionListMailFlowSettings(int itemId, int accountId) + { + return ExchangeServerController.GetDistributionListMailFlowSettings(itemId, accountId); + } - [WebMethod] - public int SetDistributionListMailFlowSettings(int itemId, int accountId, - string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - return ExchangeServerController.SetDistributionListMailFlowSettings(itemId, accountId, - acceptAccounts, rejectAccounts, requireSenderAuthentication); - } + [WebMethod] + public int SetDistributionListMailFlowSettings(int itemId, int accountId, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + return ExchangeServerController.SetDistributionListMailFlowSettings(itemId, accountId, + acceptAccounts, rejectAccounts, requireSenderAuthentication); + } - [WebMethod] - public ExchangeEmailAddress[] GetDistributionListEmailAddresses(int itemId, int accountId) - { - return ExchangeServerController.GetDistributionListEmailAddresses(itemId, accountId); - } + [WebMethod] + public ExchangeEmailAddress[] GetDistributionListEmailAddresses(int itemId, int accountId) + { + return ExchangeServerController.GetDistributionListEmailAddresses(itemId, accountId); + } - [WebMethod] - public int AddDistributionListEmailAddress(int itemId, int accountId, string emailAddress) - { - return ExchangeServerController.AddDistributionListEmailAddress(itemId, accountId, emailAddress); - } + [WebMethod] + public int AddDistributionListEmailAddress(int itemId, int accountId, string emailAddress) + { + return ExchangeServerController.AddDistributionListEmailAddress(itemId, accountId, emailAddress); + } - [WebMethod] - public int SetDistributionListPrimaryEmailAddress(int itemId, int accountId, string emailAddress) - { - return ExchangeServerController.SetDistributionListPrimaryEmailAddress(itemId, accountId, emailAddress); - } + [WebMethod] + public int SetDistributionListPrimaryEmailAddress(int itemId, int accountId, string emailAddress) + { + return ExchangeServerController.SetDistributionListPrimaryEmailAddress(itemId, accountId, emailAddress); + } - [WebMethod] - public int DeleteDistributionListEmailAddresses(int itemId, int accountId, string[] emailAddresses) - { - return ExchangeServerController.DeleteDistributionListEmailAddresses(itemId, accountId, emailAddresses); - } + [WebMethod] + public int DeleteDistributionListEmailAddresses(int itemId, int accountId, string[] emailAddresses) + { + return ExchangeServerController.DeleteDistributionListEmailAddresses(itemId, accountId, emailAddresses); + } [WebMethod] public ResultObject SetDistributionListPermissions(int itemId, int accountId, string[] sendAsAccounts, string[] sendOnBehalfAccounts) @@ -470,9 +458,77 @@ namespace WebsitePanel.EnterpriseServer { return ExchangeServerController.GetDistributionListPermissions(itemId, accountId); } - + #endregion + #region MobileDevice + + [WebMethod] + public ExchangeMobileDevice[] GetMobileDevices(int itemId, int accountId) + { + return ExchangeServerController.GetMobileDevices(itemId, accountId); + } + + [WebMethod] + public ExchangeMobileDevice GetMobileDevice(int itemId, string deviceId) + { + return ExchangeServerController.GetMobileDevice(itemId, deviceId); + } + + [WebMethod] + public void WipeDataFromDevice(int itemId, string deviceId) + { + ExchangeServerController.WipeDataFromDevice(itemId, deviceId); + } + + [WebMethod] + public void CancelRemoteWipeRequest(int itemId, string deviceId) + { + ExchangeServerController.CancelRemoteWipeRequest(itemId, deviceId); + } + + [WebMethod] + public void RemoveDevice(int itemId, string deviceId) + { + ExchangeServerController.RemoveDevice(itemId, deviceId); + } + + #endregion + + #region MailboxPlans + [WebMethod] + public List GetExchangeMailboxPlans(int itemId) + { + return ExchangeServerController.GetExchangeMailboxPlans(itemId); + } + + [WebMethod] + public ExchangeMailboxPlan GetExchangeMailboxPlan(int itemId, int mailboxPlanId) + { + return ExchangeServerController.GetExchangeMailboxPlan(itemId, mailboxPlanId); + } + + [WebMethod] + public int AddExchangeMailboxPlan(int itemId, ExchangeMailboxPlan mailboxPlan) + { + return ExchangeServerController.AddExchangeMailboxPlan(itemId, mailboxPlan); + } + + [WebMethod] + public int DeleteExchangeMailboxPlan(int itemId, int mailboxPlanId) + { + return ExchangeServerController.DeleteExchangeMailboxPlan(itemId, mailboxPlanId); + } + + [WebMethod] + public void SetOrganizationDefaultExchangeMailboxPlan(int itemId, int mailboxPlanId) + { + ExchangeServerController.SetOrganizationDefaultExchangeMailboxPlan(itemId, mailboxPlanId); + } + + #endregion + + #region Public Folders [WebMethod] public int CreatePublicFolder(int itemId, string parentFolder, string folderName, @@ -560,39 +616,7 @@ namespace WebsitePanel.EnterpriseServer } #endregion - #region MobileDevice - [WebMethod] - public ExchangeMobileDevice[] GetMobileDevices(int itemId, int accountId) - { - return ExchangeServerController.GetMobileDevices(itemId, accountId); - } - - [WebMethod] - public ExchangeMobileDevice GetMobileDevice(int itemId, string deviceId) - { - return ExchangeServerController.GetMobileDevice(itemId, deviceId); - } - - [WebMethod] - public void WipeDataFromDevice(int itemId, string deviceId) - { - ExchangeServerController.WipeDataFromDevice(itemId, deviceId); - } - - [WebMethod] - public void CancelRemoteWipeRequest(int itemId, string deviceId) - { - ExchangeServerController.CancelRemoteWipeRequest(itemId, deviceId); - } - - [WebMethod] - public void RemoveDevice(int itemId, string deviceId) - { - ExchangeServerController.RemoveDevice(itemId, deviceId); - } - - #endregion } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx new file mode 100644 index 00000000..a481f74b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="esLync.asmx.cs" Class="WebsitePanel.EnterpriseServer.esLync" %> diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs new file mode 100644 index 00000000..56ba913b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs @@ -0,0 +1,135 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System.Web.Services; +using WebsitePanel.EnterpriseServer.Code.HostedSolution; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.ResultObjects; +using System.Collections.Generic; + +namespace WebsitePanel.EnterpriseServer +{ + /// + /// Summary description for esLync + /// + [WebService(Namespace = "http://tempuri.org/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [System.ComponentModel.ToolboxItem(false)] + public class esLync : WebService + { + + [WebMethod] + public LyncUserResult CreateLyncUser(int itemId, int accountId, int lyncUserPlanId) + { + return LyncController.CreateLyncUser(itemId, accountId, lyncUserPlanId); + } + + [WebMethod] + public ResultObject DeleteLyncUser(int itemId, int accountId) + { + return LyncController.DeleteLyncUser(itemId, accountId); + } + + [WebMethod] + public LyncUsersPagedResult GetLyncUsersPaged(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows) + { + return LyncController.GetLyncUsers(itemId, sortColumn, sortDirection, startRow, maximumRows); + } + + [WebMethod] + public IntResult GetLyncUserCount(int itemId) + { + return LyncController.GetLyncUsersCount(itemId); + } + + + #region Lync User Plans + [WebMethod] + public List GetLyncUserPlans(int itemId) + { + return LyncController.GetLyncUserPlans(itemId); + } + + [WebMethod] + public LyncUserPlan GetLyncUserPlan(int itemId, int lyncUserPlanId) + { + return LyncController.GetLyncUserPlan(itemId, lyncUserPlanId); + } + + [WebMethod] + public int AddLyncUserPlan(int itemId, LyncUserPlan lyncUserPlan) + { + return LyncController.AddLyncUserPlan(itemId, lyncUserPlan); + } + + [WebMethod] + public int DeleteLyncUserPlan(int itemId, int lyncUserPlanId) + { + return LyncController.DeleteLyncUserPlan(itemId, lyncUserPlanId); + } + + [WebMethod] + public int SetOrganizationDefaultLyncUserPlan(int itemId, int lyncUserPlanId) + { + return LyncController.SetOrganizationDefaultLyncUserPlan(itemId, lyncUserPlanId); + } + + [WebMethod] + public LyncUser GetLyncUserGeneralSettings(int itemId, int accountId) + { + return LyncController.GetLyncUserGeneralSettings(itemId, accountId); + } + + [WebMethod] + public LyncUserResult SetUserLyncPlan(int itemId, int accountId, int lyncUserPlanId) + { + return LyncController.SetUserLyncPlan(itemId, accountId, lyncUserPlanId); + } + + [WebMethod] + public LyncFederationDomain[] GetFederationDomains(int itemId) + { + return LyncController.GetFederationDomains(itemId); + } + + [WebMethod] + public LyncUserResult AddFederationDomain(int itemId, string domainName, string proxyFqdn) + { + return LyncController.AddFederationDomain(itemId, domainName, proxyFqdn); + } + + [WebMethod] + public LyncUserResult RemoveFederationDomain(int itemId, string domainName) + { + return LyncController.RemoveFederationDomain(itemId, domainName); + } + + #endregion + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs index 3f9dccbd..9bccc46a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2011, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -46,10 +46,10 @@ namespace WebsitePanel.EnterpriseServer #region Organizations [WebMethod] - public int CreateOrganization(int packageId, string organizationID, string organizationName) + public int CreateOrganization(int packageId, string organizationID, string organizationName) { return OrganizationController.CreateOrganization(packageId, organizationID, organizationName); - + } [WebMethod] @@ -60,7 +60,7 @@ namespace WebsitePanel.EnterpriseServer filterColumn, filterValue, sortColumn, startRow, maximumRows); } - + [WebMethod] public List GetOrganizations(int packageId, bool recursive) { @@ -72,13 +72,13 @@ namespace WebsitePanel.EnterpriseServer { return OrganizationController.GetOrganizationUserSummuryLetter(itemId, accountId, pmm, emailMode, signup); } - + [WebMethod] public int SendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc) { return OrganizationController.SendSummaryLetter(itemId, accountId, signup, to, cc); } - + [WebMethod] public int DeleteOrganization(int itemId) { @@ -97,6 +97,13 @@ namespace WebsitePanel.EnterpriseServer return OrganizationController.GetOrganization(itemId); } + [WebMethod] + public int GetAccountIdByUserPrincipalName(int itemId, string userPrincipalName) + { + return OrganizationController.GetAccountIdByUserPrincipalName(itemId, userPrincipalName); + } + + #endregion @@ -107,13 +114,13 @@ namespace WebsitePanel.EnterpriseServer { return OrganizationController.AddOrganizationDomain(itemId, domainName); } - + [WebMethod] public List GetOrganizationDomains(int itemId) { return OrganizationController.GetOrganizationDomains(itemId); } - + [WebMethod] public int DeleteOrganizationDomain(int itemId, int domainId) { @@ -132,15 +139,22 @@ namespace WebsitePanel.EnterpriseServer #region Users [WebMethod] - public int CreateUser(int itemId, string displayName, string name, string domain, string password, bool sendNotification, string to) + public int CreateUser(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to) { string accountName; - return OrganizationController.CreateUser(itemId, displayName, name, domain, password, true, sendNotification, to, out accountName); + return OrganizationController.CreateUser(itemId, displayName, name, domain, password, subscriberNumber, true, sendNotification, to, out accountName); } + [WebMethod] + public int ImportUser(int itemId, string accountName, string displayName, string name, string domain, string password, string subscriberNumber) + { + return OrganizationController.ImportUser(itemId, accountName, displayName, name, domain, password, subscriberNumber); + } + + [WebMethod] public OrganizationUsersPaged GetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, - int startRow, int maximumRows) + int startRow, int maximumRows) { return OrganizationController.GetOrganizationUsersPaged(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows); } @@ -157,30 +171,30 @@ namespace WebsitePanel.EnterpriseServer string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes, string externalEmail) + string webPage, string notes, string externalEmail, string subscriberNumber) { return OrganizationController.SetUserGeneralSettings(itemId, accountId, displayName, password, hideAddressBook, disabled, locked, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, - webPage, notes, externalEmail); + webPage, notes, externalEmail, subscriberNumber); } [WebMethod] - public List SearchAccounts(int itemId, + public List SearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) { return OrganizationController.SearchAccounts(itemId, filterColumn, filterValue, sortColumn, includeMailboxes); } - + [WebMethod] public int DeleteUser(int itemId, int accountId) { - return OrganizationController.DeleteUser(itemId, accountId); + return OrganizationController.DeleteUser(itemId, accountId); } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/ExchangeHostedEdition/ExchangeOrganization.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/ExchangeHostedEdition/ExchangeOrganization.cs deleted file mode 100644 index 71a6d441..00000000 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/ExchangeHostedEdition/ExchangeOrganization.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace WebsitePanel.Providers.ExchangeHostedEdition -{ - public class ExchangeOrganization : ServiceProviderItem - { - // basic props - public string ExchangeControlPanelUrl { get; set; } - public string DistinguishedName { get; set; } - public string ServicePlan { get; set; } - public string ProgramId { get; set; } - public string OfferId { get; set; } - public string AdministratorName { get; set; } - public string AdministratorEmail { get; set; } - - // domains - public ExchangeOrganizationDomain[] Domains { get; set; } - - // this is real usage - public int MailboxCount { get; set; } - public int ContactCount { get; set; } - public int DistributionListCount { get; set; } - - // these quotas are set in Exchange for the organization - public int MailboxCountQuota { get; set; } - public int ContactCountQuota { get; set; } - public int DistributionListCountQuota { get; set; } - - // these quotas are set in the hosting plan + add-ons - public int MaxDomainsCountQuota { get; set; } - public int MaxMailboxCountQuota { get; set; } - public int MaxContactCountQuota { get; set; } - public int MaxDistributionListCountQuota { get; set; } - - // summary information - public string SummaryInformation { get; set; } - - [Persistent] - public string CatchAllAddress { get; set; } - } -} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/ExchangeHostedEdition/ExchangeOrganizationDomain.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/ExchangeHostedEdition/ExchangeOrganizationDomain.cs deleted file mode 100644 index 26cd4090..00000000 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/ExchangeHostedEdition/ExchangeOrganizationDomain.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace WebsitePanel.Providers.ExchangeHostedEdition -{ - public class ExchangeOrganizationDomain - { - public string Identity { get; set; } - public string Name { get; set; } - public bool IsDefault { get; set; } - public bool IsTemp { get; set; } - } -} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/ExchangeHostedEdition/IExchangeHostedEdition.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/ExchangeHostedEdition/IExchangeHostedEdition.cs deleted file mode 100644 index cc119413..00000000 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/ExchangeHostedEdition/IExchangeHostedEdition.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace WebsitePanel.Providers.ExchangeHostedEdition -{ - public interface IExchangeHostedEdition - { - void CreateOrganization(string organizationId, string programId, string offerId, - string domain, string adminName, string adminEmail, string adminPassword); - ExchangeOrganization GetOrganizationDetails(string organizationId); - - List GetOrganizationDomains(string organizationId); - void AddOrganizationDomain(string organizationId, string domain); - void DeleteOrganizationDomain(string organizationId, string domain); - - void UpdateOrganizationQuotas(string organizationId, int mailboxesNumber, int contactsNumber, int distributionListsNumber); - void UpdateOrganizationCatchAllAddress(string organizationId, string catchAllEmail); - void UpdateOrganizationServicePlan(string organizationId, string programId, string offerId); - void DeleteOrganization(string organizationId); - } -} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs index fb1092c6..cb38f66d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2011, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -39,7 +39,7 @@ namespace WebsitePanel.Providers.HostedSolution { public static DirectoryEntry GetADObject(string path) { - DirectoryEntry de = new DirectoryEntry(path); + DirectoryEntry de = new DirectoryEntry(path); de.RefreshCache(); return de; } @@ -48,16 +48,16 @@ namespace WebsitePanel.Providers.HostedSolution { bool res = false; DirectorySearcher deSearch = new DirectorySearcher - { - Filter = - ("(&(objectClass=user)(samaccountname=" + samAccountName + "))") - }; + { + Filter = + ("(&(objectClass=user)(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) @@ -81,8 +81,8 @@ namespace WebsitePanel.Providers.HostedSolution ou = parent.Children.Add( string.Format("OU={0}", name), - parent.SchemaClassName); - + parent.SchemaClassName); + ret = ou.Path; ou.CommitChanges(); } @@ -100,13 +100,13 @@ namespace WebsitePanel.Providers.HostedSolution public static void DeleteADObject(string path, bool removeChild) { DirectoryEntry entry = GetADObject(path); - + if (removeChild && entry.Children != null) foreach (DirectoryEntry child in entry.Children) { entry.Children.Remove(child); } - + DirectoryEntry parent = entry.Parent; if (parent != null) { @@ -115,7 +115,7 @@ namespace WebsitePanel.Providers.HostedSolution } } - + public static void DeleteADObject(string path) { DirectoryEntry entry = GetADObject(path); @@ -141,21 +141,34 @@ namespace WebsitePanel.Providers.HostedSolution } } else - { + { if (oDE.Properties.Contains(name)) { oDE.Properties[name].Remove(oDE.Properties[name][0]); } - + } } - public static void SetADObjectPropertyValue(DirectoryEntry oDE, string name, object value) + public static void SetADObjectPropertyValue(DirectoryEntry oDE, string name, string value) { PropertyValueCollection collection = oDE.Properties[name]; collection.Value = value; } - + + public static void SetADObjectPropertyValue(DirectoryEntry oDE, string name, Guid value) + { + PropertyValueCollection collection = oDE.Properties[name]; + collection.Value = value.ToByteArray(); + } + + public static void ClearADObjectPropertyValue(DirectoryEntry oDE, string name) + { + PropertyValueCollection collection = oDE.Properties[name]; + collection.Clear(); + } + + public static object GetADObjectProperty(DirectoryEntry entry, string name) { return entry.Properties.Contains(name) ? entry.Properties[name][0] : null; @@ -164,7 +177,7 @@ namespace WebsitePanel.Providers.HostedSolution public static string GetADObjectStringProperty(DirectoryEntry entry, string name) { object ret = GetADObjectProperty(entry, name); - return ret != null ? ret.ToString() : string.Empty; + return ret != null ? ret.ToString() : string.Empty; } public static string ConvertADPathToCanonicalName(string name) @@ -254,29 +267,38 @@ namespace WebsitePanel.Providers.HostedSolution return ret; } + public static string CreateUser(string path, string user, string displayName, string password, bool enabled) { - DirectoryEntry currentADObject = new DirectoryEntry(path); + return CreateUser(path, "", user, displayName, password, enabled); + } - DirectoryEntry newUserObject = currentADObject.Children.Add("CN=" + user, "User"); - - newUserObject.Properties[ADAttributes.SAMAccountName].Add(user); + public static string CreateUser(string path, string upn, string user, string displayName, string password, bool enabled) + { + DirectoryEntry currentADObject = new DirectoryEntry(path); + + string cn = string.Empty; + if (string.IsNullOrEmpty(upn)) cn = user; else cn = upn; + + DirectoryEntry newUserObject = currentADObject.Children.Add("CN=" + cn, "User"); + + newUserObject.Properties[ADAttributes.SAMAccountName].Add(user); SetADObjectProperty(newUserObject, ADAttributes.DisplayName, displayName); newUserObject.CommitChanges(); newUserObject.Invoke(ADAttributes.SetPassword, password); newUserObject.InvokeSet(ADAttributes.AccountDisabled, !enabled); newUserObject.CommitChanges(); - + return newUserObject.Path; } public static void CreateGroup(string path, string group) { - DirectoryEntry currentADObject = new DirectoryEntry(path); + DirectoryEntry currentADObject = new DirectoryEntry(path); DirectoryEntry newGroupObject = currentADObject.Children.Add("CN=" + group, "Group"); - + newGroupObject.Properties[ADAttributes.SAMAccountName].Add(group); newGroupObject.Properties[ADAttributes.GroupType].Add(-2147483640); @@ -320,7 +342,7 @@ namespace WebsitePanel.Providers.HostedSolution if (string.IsNullOrEmpty(primaryDomainController)) { dn = string.Format("LDAP://{0}", dn); - + } else dn = string.Format("LDAP://{0}/{1}", primaryDomainController, dn); @@ -358,7 +380,7 @@ namespace WebsitePanel.Providers.HostedSolution DirectoryEntry ou = GetADObject(ouPath); PropertyValueCollection prop = null; - prop = ou.Properties["uPNSuffixes"]; + prop = ou.Properties["uPNSuffixes"]; if (prop != null) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs index 53110402..36fbfdde 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs @@ -32,32 +32,35 @@ using System.Text; namespace WebsitePanel.Providers.HostedSolution { - public class ExchangeAccount - { - int accountId; - int itemId; + public class ExchangeAccount + { + int accountId; + int itemId; int packageId; - ExchangeAccountType accountType; - string accountName; - string displayName; - string primaryEmailAddress; - bool mailEnabledPublicFolder; + string subscriberNumber; + ExchangeAccountType accountType; + string accountName; + string displayName; + string primaryEmailAddress; + bool mailEnabledPublicFolder; MailboxManagerActions mailboxManagerActions; string accountPassword; string samAccountName; + int mailboxPlanId; + string mailboxPlan; string publicFolderPermission; - public int AccountId - { - get { return this.accountId; } - set { this.accountId = value; } - } + public int AccountId + { + get { return this.accountId; } + set { this.accountId = value; } + } - public int ItemId - { + public int ItemId + { get { return this.itemId; } set { this.itemId = value; } - } + } public int PackageId { @@ -65,17 +68,17 @@ namespace WebsitePanel.Providers.HostedSolution set { this.packageId = value; } } - public ExchangeAccountType AccountType - { - get { return this.accountType; } - set { this.accountType = value; } - } + public ExchangeAccountType AccountType + { + get { return this.accountType; } + set { this.accountType = value; } + } - public string AccountName - { - get { return this.accountName; } - set { this.accountName = value; } - } + public string AccountName + { + get { return this.accountName; } + set { this.accountName = value; } + } public string SamAccountName { @@ -83,23 +86,23 @@ namespace WebsitePanel.Providers.HostedSolution set { this.samAccountName = value; } } - public string DisplayName - { - get { return this.displayName; } - set { this.displayName = value; } - } + public string DisplayName + { + get { return this.displayName; } + set { this.displayName = value; } + } - public string PrimaryEmailAddress - { - get { return this.primaryEmailAddress; } - set { this.primaryEmailAddress = value; } - } + public string PrimaryEmailAddress + { + get { return this.primaryEmailAddress; } + set { this.primaryEmailAddress = value; } + } - public bool MailEnabledPublicFolder - { - get { return this.mailEnabledPublicFolder; } - set { this.mailEnabledPublicFolder = value; } - } + public bool MailEnabledPublicFolder + { + get { return this.mailEnabledPublicFolder; } + set { this.mailEnabledPublicFolder = value; } + } public string AccountPassword { @@ -113,10 +116,31 @@ namespace WebsitePanel.Providers.HostedSolution set { this.mailboxManagerActions = value; } } + public int MailboxPlanId + { + get { return this.mailboxPlanId; } + set { this.mailboxPlanId = value; } + } + + public string MailboxPlan + { + get { return this.mailboxPlan; } + set { this.mailboxPlan = value; } + } + + + public string SubscriberNumber + { + get { return this.subscriberNumber; } + set { this.subscriberNumber = value; } + } + public string PublicFolderPermission { get { return this.publicFolderPermission; } set { this.publicFolderPermission = value; } } - } + + + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeContact.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeContact.cs index fe8984cc..689d1558 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeContact.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeContact.cs @@ -32,209 +32,219 @@ using System.Text; namespace WebsitePanel.Providers.HostedSolution { - public class ExchangeContact - { - string displayName; - string accountName; - string emailAddress; - bool hideFromAddressBook; + public class ExchangeContact + { + string displayName; + string accountName; + string emailAddress; + bool hideFromAddressBook; - string firstName; - string initials; - string lastName; + string firstName; + string initials; + string lastName; - string jobTitle; - string company; - string department; - string office; - ExchangeAccount managerAccount; + string jobTitle; + string company; + string department; + string office; + ExchangeAccount managerAccount; - string businessPhone; - string fax; - string homePhone; - string mobilePhone; - string pager; - string webPage; + string businessPhone; + string fax; + string homePhone; + string mobilePhone; + string pager; + string webPage; - string address; - string city; - string state; - string zip; - string country; + string address; + string city; + string state; + string zip; + string country; - string notes; - private int useMapiRichTextFormat; - - ExchangeAccount[] acceptAccounts; - ExchangeAccount[] rejectAccounts; - bool requireSenderAuthentication; + string notes; + string sAMAccountName; + private int useMapiRichTextFormat; - public string DisplayName - { - get { return this.displayName; } - set { this.displayName = value; } - } + ExchangeAccount[] acceptAccounts; + ExchangeAccount[] rejectAccounts; + bool requireSenderAuthentication; - public string AccountName - { - get { return this.accountName; } - set { this.accountName = value; } - } + public string DisplayName + { + get { return this.displayName; } + set { this.displayName = value; } + } - public string EmailAddress - { - get { return this.emailAddress; } - set { this.emailAddress = value; } - } + public string AccountName + { + get { return this.accountName; } + set { this.accountName = value; } + } - public bool HideFromAddressBook - { - get { return this.hideFromAddressBook; } - set { this.hideFromAddressBook = value; } - } + public string EmailAddress + { + get { return this.emailAddress; } + set { this.emailAddress = value; } + } - public string FirstName - { - get { return this.firstName; } - set { this.firstName = value; } - } + public bool HideFromAddressBook + { + get { return this.hideFromAddressBook; } + set { this.hideFromAddressBook = value; } + } - public string Initials - { - get { return this.initials; } - set { this.initials = value; } - } + public string FirstName + { + get { return this.firstName; } + set { this.firstName = value; } + } - public string LastName - { - get { return this.lastName; } - set { this.lastName = value; } - } + public string Initials + { + get { return this.initials; } + set { this.initials = value; } + } - public string JobTitle - { - get { return this.jobTitle; } - set { this.jobTitle = value; } - } + public string LastName + { + get { return this.lastName; } + set { this.lastName = value; } + } - public string Company - { - get { return this.company; } - set { this.company = value; } - } + public string JobTitle + { + get { return this.jobTitle; } + set { this.jobTitle = value; } + } - public string Department - { - get { return this.department; } - set { this.department = value; } - } + public string Company + { + get { return this.company; } + set { this.company = value; } + } - public string Office - { - get { return this.office; } - set { this.office = value; } - } + public string Department + { + get { return this.department; } + set { this.department = value; } + } - public ExchangeAccount ManagerAccount - { - get { return this.managerAccount; } - set { this.managerAccount = value; } - } + public string Office + { + get { return this.office; } + set { this.office = value; } + } - public string BusinessPhone - { - get { return this.businessPhone; } - set { this.businessPhone = value; } - } + public ExchangeAccount ManagerAccount + { + get { return this.managerAccount; } + set { this.managerAccount = value; } + } - public string Fax - { - get { return this.fax; } - set { this.fax = value; } - } + public string BusinessPhone + { + get { return this.businessPhone; } + set { this.businessPhone = value; } + } - public string HomePhone - { - get { return this.homePhone; } - set { this.homePhone = value; } - } + public string Fax + { + get { return this.fax; } + set { this.fax = value; } + } - public string MobilePhone - { - get { return this.mobilePhone; } - set { this.mobilePhone = value; } - } + public string HomePhone + { + get { return this.homePhone; } + set { this.homePhone = value; } + } - public string Pager - { - get { return this.pager; } - set { this.pager = value; } - } + public string MobilePhone + { + get { return this.mobilePhone; } + set { this.mobilePhone = value; } + } - public string WebPage - { - get { return this.webPage; } - set { this.webPage = value; } - } + public string Pager + { + get { return this.pager; } + set { this.pager = value; } + } - public string Address - { - get { return this.address; } - set { this.address = value; } - } + public string WebPage + { + get { return this.webPage; } + set { this.webPage = value; } + } - public string City - { - get { return this.city; } - set { this.city = value; } - } + public string Address + { + get { return this.address; } + set { this.address = value; } + } - public string State - { - get { return this.state; } - set { this.state = value; } - } + public string City + { + get { return this.city; } + set { this.city = value; } + } - public string Zip - { - get { return this.zip; } - set { this.zip = value; } - } + public string State + { + get { return this.state; } + set { this.state = value; } + } - public string Country - { - get { return this.country; } - set { this.country = value; } - } + public string Zip + { + get { return this.zip; } + set { this.zip = value; } + } - public string Notes - { - get { return this.notes; } - set { this.notes = value; } - } + public string Country + { + get { return this.country; } + set { this.country = value; } + } - public ExchangeAccount[] AcceptAccounts - { - get { return this.acceptAccounts; } - set { this.acceptAccounts = value; } - } + public string Notes + { + get { return this.notes; } + set { this.notes = value; } + } - public ExchangeAccount[] RejectAccounts - { - get { return this.rejectAccounts; } - set { this.rejectAccounts = value; } - } + public ExchangeAccount[] AcceptAccounts + { + get { return this.acceptAccounts; } + set { this.acceptAccounts = value; } + } - public bool RequireSenderAuthentication - { - get { return requireSenderAuthentication; } - set { requireSenderAuthentication = value; } - } + public ExchangeAccount[] RejectAccounts + { + get { return this.rejectAccounts; } + set { this.rejectAccounts = value; } + } - public int UseMapiRichTextFormat - { + public bool RequireSenderAuthentication + { + get { return requireSenderAuthentication; } + set { requireSenderAuthentication = value; } + } + + public int UseMapiRichTextFormat + { get { return useMapiRichTextFormat; } set { useMapiRichTextFormat = value; } - } - } + } + + public string SAMAccountName + { + get { return sAMAccountName; } + set { sAMAccountName = value; } + } + + + + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeDistributionList.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeDistributionList.cs index 17840d1f..6d3c5322 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeDistributionList.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeDistributionList.cs @@ -32,72 +32,79 @@ using System.Text; namespace WebsitePanel.Providers.HostedSolution { - public class ExchangeDistributionList - { - public string DisplayName - { - get; - set; - } + public class ExchangeDistributionList + { + public string DisplayName + { + get; + set; + } - public string AccountName - { - get; - set; - } + public string AccountName + { + get; + set; + } - public bool HideFromAddressBook - { - get; - set; - } + public bool HideFromAddressBook + { + get; + set; + } - public ExchangeAccount[] MembersAccounts - { - get; - set; - } + public ExchangeAccount[] MembersAccounts + { + get; + set; + } - public ExchangeAccount ManagerAccount - { - get; - set; - } + public ExchangeAccount ManagerAccount + { + get; + set; + } - public string Notes - { - get; - set; - } + public string Notes + { + get; + set; + } - public ExchangeAccount[] AcceptAccounts - { - get; - set; - } + public ExchangeAccount[] AcceptAccounts + { + get; + set; + } - public ExchangeAccount[] RejectAccounts - { - get; - set; - } + public ExchangeAccount[] RejectAccounts + { + get; + set; + } - public bool RequireSenderAuthentication - { - get; - set; - } - - public ExchangeAccount[] SendAsAccounts - { - get; - set; - } + public bool RequireSenderAuthentication + { + get; + set; + } - public ExchangeAccount[] SendOnBehalfAccounts - { - get; - set; - } - } + public ExchangeAccount[] SendAsAccounts + { + get; + set; + } + + public ExchangeAccount[] SendOnBehalfAccounts + { + get; + set; + } + + public string SAMAccountName + { + get; + set; + } + + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs new file mode 100644 index 00000000..167c5f04 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs @@ -0,0 +1,160 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class ExchangeMailboxPlan + { + int mailboxPlanId; + string mailboxPlan; + int mailboxSizeMB; + int maxRecipients; + int maxSendMessageSizeKB; + int maxReceiveMessageSizeKB; + + bool enablePOP; + bool enableIMAP; + bool enableOWA; + bool enableMAPI; + bool enableActiveSync; + + int issueWarningPct; + int prohibitSendPct; + int prohibitSendReceivePct; + int keepDeletedItemsDays; + bool isDefault; + bool hideFromAddressBook; + + public int MailboxPlanId + { + get { return this.mailboxPlanId; } + set { this.mailboxPlanId = value; } + } + + public string MailboxPlan + { + get { return this.mailboxPlan; } + set { this.mailboxPlan = value; } + } + + public int MailboxSizeMB + { + get { return this.mailboxSizeMB; } + set { this.mailboxSizeMB = value; } + } + + public bool IsDefault + { + get { return this.isDefault; } + set { this.isDefault = value; } + } + + public int MaxRecipients + { + get { return this.maxRecipients; } + set { this.maxRecipients = value; } + } + + public int MaxSendMessageSizeKB + { + get { return this.maxSendMessageSizeKB; } + set { this.maxSendMessageSizeKB = value; } + } + + public int MaxReceiveMessageSizeKB + { + get { return this.maxReceiveMessageSizeKB; } + set { this.maxReceiveMessageSizeKB = value; } + } + + public bool EnablePOP + { + get { return this.enablePOP; } + set { this.enablePOP = value; } + } + + public bool EnableIMAP + { + get { return this.enableIMAP; } + set { this.enableIMAP = value; } + } + + public bool EnableOWA + { + get { return this.enableOWA; } + set { this.enableOWA = value; } + } + + public bool EnableMAPI + { + get { return this.enableMAPI; } + set { this.enableMAPI = value; } + } + + public bool EnableActiveSync + { + get { return this.enableActiveSync; } + set { this.enableActiveSync = value; } + } + + public int IssueWarningPct + { + get { return this.issueWarningPct; } + set { this.issueWarningPct = value; } + } + + public int ProhibitSendPct + { + get { return this.prohibitSendPct; } + set { this.prohibitSendPct = value; } + } + + public int ProhibitSendReceivePct + { + get { return this.prohibitSendReceivePct; } + set { this.prohibitSendReceivePct = value; } + } + + public int KeepDeletedItemsDays + { + get { return this.keepDeletedItemsDays; } + set { this.keepDeletedItemsDays = value; } + } + + public bool HideFromAddressBook + { + get { return this.hideFromAddressBook; } + set { this.hideFromAddressBook = value; } + } + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IExchangeServer.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IExchangeServer.cs index 34651e08..559b9385 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IExchangeServer.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IExchangeServer.cs @@ -30,70 +30,71 @@ namespace WebsitePanel.Providers.HostedSolution { public interface IExchangeServer { - + bool CheckAccountCredentials(string username, string password); - // Organizations + // Organizations - string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, - string mailboxDatabase, string offlineAddressBook, - string accountName, bool enablePOP, bool enableIMAP, - bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, - int keepDeletedItemsDays); - - Organization ExtendToExchangeOrganization(string organizationId, string securityGroup); - string GetOABVirtualDirectory(); - Organization CreateOrganizationOfflineAddressBook(string organizationId, string securityGroup, string oabVirtualDir); - void UpdateOrganizationOfflineAddressBook(string id); - bool DeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup); - void SetOrganizationStorageLimits(string organizationDistinguishedName, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays); - ExchangeItemStatistics[] GetMailboxesStatistics(string organizationDistinguishedName); + string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, + string mailboxDatabase, string offlineAddressBook, string addressBookPolicy, + string accountName, bool enablePOP, bool enableIMAP, + bool enableOWA, bool enableMAPI, bool enableActiveSync, + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, + int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook, bool isConsumer); - // Domains + Organization ExtendToExchangeOrganization(string organizationId, string securityGroup, bool IsConsumer); + string GetOABVirtualDirectory(); + Organization CreateOrganizationOfflineAddressBook(string organizationId, string securityGroup, string oabVirtualDir); + Organization CreateOrganizationAddressBookPolicy(string organizationId, string gal, string addressBook, string roomList, string oab); + void UpdateOrganizationOfflineAddressBook(string id); + bool DeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy); + void SetOrganizationStorageLimits(string organizationDistinguishedName, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays); + ExchangeItemStatistics[] GetMailboxesStatistics(string organizationDistinguishedName); + + // Domains void AddAuthoritativeDomain(string domain); void DeleteAuthoritativeDomain(string domain); - string[] GetAuthoritativeDomains(); + string[] GetAuthoritativeDomains(); - // Mailboxes - string CreateMailbox(string organizationId, string organizationDistinguishedName, string mailboxDatabase, string securityGroup, string offlineAddressBook, ExchangeAccountType accountType, string displayName, string accountName, string name, string domain, string password, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays); - void DeleteMailbox(string accountName); + // Mailboxes + //string CreateMailbox(string organizationId, string organizationDistinguishedName, string mailboxDatabase, string securityGroup, string offlineAddressBook, string addressBookPolicy, ExchangeAccountType accountType, string displayName, string accountName, string name, string domain, string password, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, + // int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB,bool hideFromAddressBook); + void DeleteMailbox(string accountName); void DisableMailbox(string id); - ExchangeMailbox GetMailboxGeneralSettings(string accountName); - void SetMailboxGeneralSettings(string accountName, string displayName, string password, bool hideFromAddressBook, bool disabled, string firstName, string initials, string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes); - ExchangeMailbox GetMailboxMailFlowSettings(string accountName); - void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication); - ExchangeMailbox GetMailboxAdvancedSettings(string accountName); - void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays); - ExchangeEmailAddress[] GetMailboxEmailAddresses(string accountName); - void SetMailboxEmailAddresses(string accountName, string[] emailAddresses); - void SetMailboxPrimaryEmailAddress(string accountName, string emailAddress); - void SetMailboxPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] fullAccessAccounts); - ExchangeMailbox GetMailboxPermissions(string organizationId, string accountName); - ExchangeMailboxStatistics GetMailboxStatistics(string accountName); + ExchangeMailbox GetMailboxGeneralSettings(string accountName); + void SetMailboxGeneralSettings(string accountName, bool hideFromAddressBook, bool disabled); + ExchangeMailbox GetMailboxMailFlowSettings(string accountName); + void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication); + ExchangeMailbox GetMailboxAdvancedSettings(string accountName); + void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB); + ExchangeEmailAddress[] GetMailboxEmailAddresses(string accountName); + void SetMailboxEmailAddresses(string accountName, string[] emailAddresses); + void SetMailboxPrimaryEmailAddress(string accountName, string emailAddress); + void SetMailboxPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] fullAccessAccounts); + ExchangeMailbox GetMailboxPermissions(string organizationId, string accountName); + ExchangeMailboxStatistics GetMailboxStatistics(string accountName); - // Contacts - void CreateContact(string organizationId, string organizationDistinguishedName, string contactDisplayName, string contactAccountName, string contactEmail, string defaultOrganizationDomain); - void DeleteContact(string accountName); - ExchangeContact GetContactGeneralSettings(string accountName); + // Contacts + void CreateContact(string organizationId, string organizationDistinguishedName, string contactDisplayName, string contactAccountName, string contactEmail, string defaultOrganizationDomain); + void DeleteContact(string accountName); + ExchangeContact GetContactGeneralSettings(string accountName); void SetContactGeneralSettings(string accountName, string displayName, string email, bool hideFromAddressBook, string firstName, string initials, string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes, int useMapiRichTextFormat, string defaultDomain); - ExchangeContact GetContactMailFlowSettings(string accountName); - void SetContactMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication); + ExchangeContact GetContactMailFlowSettings(string accountName); + void SetContactMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication); - // Distribution Lists - void CreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy); - void DeleteDistributionList(string accountName); - ExchangeDistributionList GetDistributionListGeneralSettings(string accountName); - void SetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] memebers, string notes); - void AddDistributionListMembers(string accountName, string[] memberAccounts); - void RemoveDistributionListMembers(string accountName, string[] memberAccounts); - ExchangeDistributionList GetDistributionListMailFlowSettings(string accountName); - void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication); - ExchangeEmailAddress[] GetDistributionListEmailAddresses(string accountName); - void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses); - void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress); - ExchangeDistributionList GetDistributionListPermissions(string organizationId, string accountName); - void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts); + // Distribution Lists + void CreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists); + void DeleteDistributionList(string accountName); + ExchangeDistributionList GetDistributionListGeneralSettings(string accountName); + void SetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] memebers, string notes, string[] addressLists); + void AddDistributionListMembers(string accountName, string[] memberAccounts, string[] addressLists); + void RemoveDistributionListMembers(string accountName, string[] memberAccounts, string[] addressLists); + ExchangeDistributionList GetDistributionListMailFlowSettings(string accountName); + void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists); + ExchangeEmailAddress[] GetDistributionListEmailAddresses(string accountName); + void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses, string[] addressLists); + void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress, string[] addressLists); + ExchangeDistributionList GetDistributionListPermissions(string organizationId, string accountName); + void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists); // Public Folders void CreatePublicFolder(string organizationId, string securityGroup, string parentFolder, string folderName, bool mailEnabled, string accountName, string name, string domain); @@ -111,20 +112,20 @@ namespace WebsitePanel.Providers.HostedSolution string[] GetPublicFoldersRecursive(string parent); long GetPublicFolderSize(string folder); - //ActiveSync - void CreateOrganizationActiveSyncPolicy(string organizationId); - ExchangeActiveSyncPolicy GetActiveSyncPolicy(string organizationId); - void SetActiveSyncPolicy(string organizationId, bool allowNonProvisionableDevices, bool attachmentsEnabled, - int maxAttachmentSizeKB, bool uncAccessEnabled, bool wssAccessEnabled, bool devicePasswordEnabled, - bool alphanumericPasswordRequired, bool passwordRecoveryEnabled, bool deviceEncryptionEnabled, - bool allowSimplePassword, int maxPasswordFailedAttempts, int minPasswordLength, int inactivityLockMin, - int passwordExpirationDays, int passwordHistory, int refreshInterval); + //ActiveSync + void CreateOrganizationActiveSyncPolicy(string organizationId); + ExchangeActiveSyncPolicy GetActiveSyncPolicy(string organizationId); + void SetActiveSyncPolicy(string organizationId, bool allowNonProvisionableDevices, bool attachmentsEnabled, + int maxAttachmentSizeKB, bool uncAccessEnabled, bool wssAccessEnabled, bool devicePasswordEnabled, + bool alphanumericPasswordRequired, bool passwordRecoveryEnabled, bool deviceEncryptionEnabled, + bool allowSimplePassword, int maxPasswordFailedAttempts, int minPasswordLength, int inactivityLockMin, + int passwordExpirationDays, int passwordHistory, int refreshInterval); - //Mobile Devices - ExchangeMobileDevice[] GetMobileDevices(string accountName); - ExchangeMobileDevice GetMobileDevice(string id); - void WipeDataFromDevice(string id); - void CancelRemoteWipeRequest(string id); - void RemoveDevice(string id); - } + //Mobile Devices + ExchangeMobileDevice[] GetMobileDevices(string accountName); + ExchangeMobileDevice GetMobileDevice(string id); + void WipeDataFromDevice(string id); + void CancelRemoteWipeRequest(string id); + void RemoveDevice(string id); + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs new file mode 100644 index 00000000..ef1047a0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs @@ -0,0 +1,51 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public interface ILyncServer + { + string CreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice); + bool DeleteOrganization(string organizationId, string sipDomain); + + bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan); + LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn); + bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan); + bool DeleteUser(string userUpn); + + LyncFederationDomain[] GetFederationDomains(string organizationId); + bool AddFederationDomain(string organizationId, string domainName, string proxyFqdn); + bool RemoveFederationDomain(string organizationId, string domainName); + + void ReloadConfiguration(); + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs index 11cef205..15846f9c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs @@ -33,10 +33,10 @@ namespace WebsitePanel.Providers.HostedSolution public interface IOrganization { Organization CreateOrganization(string organizationId); - + void DeleteOrganization(string organizationId); - void CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled); + int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled); void DeleteUser(string loginName, string organizationId); @@ -49,7 +49,7 @@ namespace WebsitePanel.Providers.HostedSolution string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes, string externalEmail); + string webPage, string notes, string externalEmail); bool OrganizationExists(string organizationId); @@ -58,5 +58,7 @@ namespace WebsitePanel.Providers.HostedSolution void CreateOrganizationDomain(string organizationDistinguishedName, string domain); PasswordPolicyResult GetPasswordPolicy(); + + string GetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncConstants.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncConstants.cs new file mode 100644 index 00000000..4da82007 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncConstants.cs @@ -0,0 +1,36 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +namespace WebsitePanel.Providers.HostedSolution + { + public class LyncConstants + { + public const string PoolFQDN = "PoolFQDN"; + public const string SimpleUrlRoot = "SimpleUrlRoot"; + } + } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs new file mode 100644 index 00000000..15cfbae8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs @@ -0,0 +1,74 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +namespace WebsitePanel.Providers.HostedSolution + { + public class LyncErrorCodes + { + public const string CANNOT_CHECK_IF_LYNC_USER_EXISTS = "CANNOT_CHECK_IF_LYNC_USER_EXISTS"; + + public const string USER_IS_ALREADY_LYNC_USER = "USER_IS_ALREADY_LYNC_USER"; + + public const string USER_FIRST_NAME_IS_NOT_SPECIFIED = "USER_FIRST_NAME_IS_NOT_SPECIFIED"; + + public const string USER_LAST_NAME_IS_NOT_SPECIFIED = "USER_LAST_NAME_IS_NOT_SPECIFIED"; + + public const string CANNOT_GET_USER_GENERAL_SETTINGS = "CANNOT_GET_USER_GENERAL_SETTINGS"; + + public const string CANNOT_ADD_LYNC_USER_TO_DATABASE = "CANNOT_ADD_LYNC_USER_TO_DATABASE"; + + public const string GET_LYNC_USER_COUNT = "GET_LYNC_USER_COUNT"; + + public const string GET_LYNC_USERS = "GET_LYNC_USERS"; + + public const string CANNOT_DELETE_LYNC_USER_FROM_METADATA = "CANNOT_DELETE_LYNC_USER_FROM_METADATA"; + + public const string CANNOT_DELETE_LYNC_USER = "CANNOT_DELETE_LYNC_USER"; + + public const string CANNOT_GET_LYNC_PROXY = "CANNOT_GET_LYNC_PROXY"; + + public const string USER_QUOTA_HAS_BEEN_REACHED = "USER_QUOTA_HAS_BEEN_REACHED"; + + public const string CANNOT_CHECK_QUOTA = "CANNOT_CHECK_QUOTA"; + + public const string CANNOT_SET_DEFAULT_SETTINGS = "CANNOT_SET_DEFAULT_SETTINGS"; + + public const string CANNOT_ADD_LYNC_USER = "CANNOT_ADD_LYNC_USER"; + + public const string CANNOT_UPDATE_LYNC_USER = "CANNOT_UPDATE_LYNC_USER"; + + public const string CANNOT_ENABLE_ORG = "CANNOT_ENABLE_ORG"; + + public const string NOT_AUTHORIZED = "NOT_AUTHORIZED"; + + public const string CANNOT_ADD_LYNC_FEDERATIONDOMAIN = "CANNOT_ADD_LYNC_FEDERATIONDOMAIN"; + + public const string CANNOT_REMOVE_LYNC_FEDERATIONDOMAIN = "CANNOT_REMOVE_LYNC_FEDERATIONDOMAIN"; + + } + } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettingsExchangeHostedEdition.ascx.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncFederationDomain.cs similarity index 62% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettingsExchangeHostedEdition.ascx.cs rename to WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncFederationDomain.cs index 77cbfbc8..f5ac4498 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceSettingsExchangeHostedEdition.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncFederationDomain.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2012, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -27,37 +27,40 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; -using System.Data; -using System.Configuration; -using System.Collections; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using System.Web.UI.HtmlControls; +using System.Collections.Generic; +using System.Text; -using WebsitePanel.EnterpriseServer; - -namespace WebsitePanel.Portal +namespace WebsitePanel.Providers.HostedSolution { - public partial class SpaceSettingsExchangeHostedEdition : WebsitePanelControlBase, IPackageSettingsEditorControl - { - protected void Page_Load(object sender, EventArgs e) - { + public class LyncFederationDomain + { + string domainName; + string comment; + bool markForMonitoring; + string proxyFqdn; - } + public string DomainName + { + get { return this.domainName; } + set { this.domainName = value; } + } - public void BindSettings(PackageSettings settings) - { - temporaryDomain.Text = settings["temporaryDomain"]; - ecpURL.Text = settings["ecpURL"]; - } + public string Comment + { + get { return this.comment; } + set { this.comment = value; } + } - public void SaveSettings(PackageSettings settings) - { - settings["temporaryDomain"] = temporaryDomain.Text.Trim(); - settings["ecpURL"] = ecpURL.Text.Trim(); - } - } -} \ No newline at end of file + public bool MarkForMonitoring + { + get { return this.markForMonitoring; } + set { this.markForMonitoring = value; } + } + + public string ProxyFqdn + { + get { return this.proxyFqdn; } + set { this.proxyFqdn = value; } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs new file mode 100644 index 00000000..1a4dd851 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs @@ -0,0 +1,45 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class LyncUser + { + public string PrimaryUri { get; set; } + public string PrimaryEmailAddress { get; set; } + public string DisplayName { get; set; } + public string LineUri { get; set; } + public int AccountID { get; set; } + public int LyncUserPlanId { get; set; } + public string LyncUserPlanName { get; set; } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserPlan.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserPlan.cs new file mode 100644 index 00000000..27b236ec --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserPlan.cs @@ -0,0 +1,112 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class LyncUserPlan + { + int lyncUserPlanId; + string lyncUserPlanName; + + bool im; + bool federation; + bool conferencing; + bool enterpriseVoice; + bool mobility; + bool mobilityEnableOutsideVoice; + LyncVoicePolicyType voicePolicy; + + bool isDefault; + + public int LyncUserPlanId + { + get { return this.lyncUserPlanId; } + set { this.lyncUserPlanId = value; } + } + + public string LyncUserPlanName + { + get { return this.lyncUserPlanName; } + set { this.lyncUserPlanName = value; } + } + + public bool IM + { + get { return this.im; } + set { this.im = value; } + } + + public bool IsDefault + { + get { return this.isDefault; } + set { this.isDefault = value; } + } + + public bool Federation + { + get { return this.federation; } + set { this.federation = value; } + } + + public bool Conferencing + { + get { return this.conferencing; } + set { this.conferencing = value; } + } + + public bool EnterpriseVoice + { + get { return this.enterpriseVoice; } + set { this.enterpriseVoice = value; } + } + + public bool Mobility + { + get { return this.mobility; } + set { this.mobility = value; } + } + + public bool MobilityEnableOutsideVoice + { + get { return this.mobilityEnableOutsideVoice; } + set { this.mobilityEnableOutsideVoice = value; } + } + + public LyncVoicePolicyType VoicePolicy + { + get { return this.voicePolicy; } + set { this.voicePolicy = value; } + } + + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeHostedEditionPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUsersPaged.cs similarity index 66% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeHostedEditionPolicy.ascx.cs rename to WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUsersPaged.cs index f0621cf4..6df0867c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeHostedEditionPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUsersPaged.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2012, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -26,33 +26,25 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -using System; -using System.Data; -using System.Configuration; -using System.Collections; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using System.Web.UI.HtmlControls; + -using WebsitePanel.EnterpriseServer; - -namespace WebsitePanel.Portal +namespace WebsitePanel.Providers.HostedSolution { - public partial class SettingsExchangeHostedEditionPolicy : WebsitePanelControlBase, IUserSettingsEditorControl + public class LyncUsersPaged { - public void BindSettings(UserSettings settings) + int recordsCount; + LyncUser[] pageUsers; + + public int RecordsCount { - // mailbox - mailboxPasswordPolicy.Value = settings["MailboxPasswordPolicy"]; + get { return recordsCount; } + set { recordsCount = value; } } - public void SaveSettings(UserSettings settings) + public LyncUser[] PageUsers { - // mailbox - settings["MailboxPasswordPolicy"] = mailboxPasswordPolicy.Value; + get { return pageUsers; } + set { pageUsers = value; } } - } -} \ No newline at end of file + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncVoicePolicyType.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncVoicePolicyType.cs new file mode 100644 index 00000000..fc203a67 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncVoicePolicyType.cs @@ -0,0 +1,39 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +namespace WebsitePanel.Providers.HostedSolution +{ + public enum LyncVoicePolicyType + { + None = 0, + Emergency = 1, + National = 2, + Mobile = 3, + International = 4 + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/Organization.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/Organization.cs index 677a52a7..3abfbd7f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/Organization.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/Organization.cs @@ -41,12 +41,12 @@ namespace WebsitePanel.Providers.HostedSolution private string addressList; private string roomsAddressList; private string globalAddressList; + private string addressBookPolicy; + private string database; private string securityGroup; + private string lyncTenantId; private int diskSpace; - private int issueWarningKB; - private int prohibitSendKB; - private int prohibitSendReceiveKB; private int keepDeletedItemsDays; @@ -125,7 +125,7 @@ namespace WebsitePanel.Providers.HostedSolution get { return crmCurrency; } set { crmCurrency = value; } } - + [Persistent] public string DistinguishedName { @@ -151,7 +151,7 @@ namespace WebsitePanel.Providers.HostedSolution { return defaultDomain; } - } + } [Persistent] @@ -182,6 +182,13 @@ namespace WebsitePanel.Providers.HostedSolution set { globalAddressList = value; } } + [Persistent] + public string AddressBookPolicy + { + get { return addressBookPolicy; } + set { addressBookPolicy = value; } + } + [Persistent] public string Database { @@ -203,27 +210,6 @@ namespace WebsitePanel.Providers.HostedSolution set { diskSpace = value; } } - [Persistent] - public int IssueWarningKB - { - get { return issueWarningKB; } - set { issueWarningKB = value; } - } - - [Persistent] - public int ProhibitSendKB - { - get { return prohibitSendKB; } - set { prohibitSendKB = value; } - } - - [Persistent] - public int ProhibitSendReceiveKB - { - get { return prohibitSendReceiveKB; } - set { prohibitSendReceiveKB = value; } - } - [Persistent] public int KeepDeletedItemsDays { @@ -233,5 +219,15 @@ namespace WebsitePanel.Providers.HostedSolution [Persistent] public bool IsOCSOrganization { get; set; } + + + [Persistent] + public string LyncTenantId + { + get { return lyncTenantId; } + set { lyncTenantId = value; } + } + + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs index bc322dd4..50981d9e 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs @@ -173,6 +173,8 @@ namespace WebsitePanel.Providers.HostedSolution public int CreatedOCSUsers { get; set; } public int AllocatedOCSUsers { get; set; } + public int CreatedLyncUsers { get; set; } + public int AllocatedLyncUsers { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs index 53d73e5f..d3e2b62c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs @@ -37,6 +37,7 @@ namespace WebsitePanel.Providers.HostedSolution private int accountId; private int itemId; private int packageId; + private string subscriberNumber; private string primaryEmailAddress; private string accountPassword; @@ -298,5 +299,13 @@ namespace WebsitePanel.Providers.HostedSolution set { isBlackBerryUser = value; } } + public string SubscriberNumber + { + get { return subscriberNumber; } + set { subscriberNumber = value; } + } + + + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/TransactionAction.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/TransactionAction.cs new file mode 100644 index 00000000..9b16e530 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/TransactionAction.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class TransactionAction + { + private TransactionActionTypes actionType; + + public TransactionActionTypes ActionType + { + get { return actionType; } + set { actionType = value; } + } + + private string id; + + public string Id + { + get { return id; } + set { id = value; } + } + + private string suffix; + + public string Suffix + { + get { return suffix; } + set { suffix = value; } + } + + private string account; + + public string Account + { + get { return account; } + set { account = value; } + + } + + public enum TransactionActionTypes + { + CreateOrganizationUnit, + CreateGlobalAddressList, + CreateAddressList, + CreateAddressBookPolicy, + CreateOfflineAddressBook, + CreateDistributionGroup, + EnableDistributionGroup, + CreateAcceptedDomain, + AddUPNSuffix, + CreateMailbox, + CreateContact, + CreatePublicFolder, + CreateActiveSyncPolicy, + AddMailboxFullAccessPermission, + AddSendAsPermission, + RemoveMailboxFullAccessPermission, + RemoveSendAsPermission, + EnableMailbox, + LyncNewSipDomain, + LyncNewSimpleUrl, + LyncNewUser, + LyncNewConferencingPolicy, + LyncNewExternalAccessPolicy, + LyncNewMobilityPolicy + }; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemUser.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemUser.cs index f9564913..314b44cc 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemUser.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemUser.cs @@ -40,6 +40,8 @@ namespace WebsitePanel.Providers.OS private string fullName; private string description = "WebsitePanel system account"; private string password; + private string msIIS_FTPDir = ""; + private string msIIS_FTPRoot = ""; private bool passwordCantChange; private bool passwordNeverExpires; private bool accountDisabled; @@ -98,5 +100,18 @@ namespace WebsitePanel.Providers.OS get { return memberOf; } set { memberOf = value; } } + + public string MsIIS_FTPDir + { + get { return msIIS_FTPDir; } + set { msIIS_FTPDir = value; } + } + + public string MsIIS_FTPRoot + { + get { return msIIS_FTPRoot; } + set { msIIS_FTPRoot = value; } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/ResultObjects/LyncUserResult.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/ResultObjects/LyncUserResult.cs new file mode 100644 index 00000000..bf5e64fd --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/ResultObjects/LyncUserResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Providers.ResultObjects +{ + public class LyncUserResult : ValueResultObject + { + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/ResultObjects/LyncUsersPagedResult.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/ResultObjects/LyncUsersPagedResult.cs new file mode 100644 index 00000000..169b13cd --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/ResultObjects/LyncUsersPagedResult.cs @@ -0,0 +1,36 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Providers.ResultObjects +{ + public class LyncUsersPagedResult : ValueResultObject + { + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index df882803..d5f41672 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -74,14 +74,21 @@ - - - + + + + + + + + + + @@ -119,6 +126,8 @@ + + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs index 793ee9d6..60c3e411 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs @@ -28,6 +28,7 @@ using System; using System.IO; +using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Text; @@ -67,7 +68,6 @@ namespace WebsitePanel.Providers.HostedSolution #region Constants private const string CONFIG_CLEAR_QUERYBASEDN = "WebsitePanel.Exchange.ClearQueryBaseDN"; - private const string CONFIG_ENABLESP2ABP = "WebsitePanel.Exchange.enableSP2abp"; #endregion #region Properties @@ -87,7 +87,12 @@ namespace WebsitePanel.Providers.HostedSolution get { return ProviderSettings["MailboxDatabase"]; } } - internal int KeepDeletedItemsDays + internal bool PublicFolderDistributionEnabled + { + get { return ProviderSettings.GetBool("PublicFolderDistributionEnabled"); } + } + + internal int KeepDeletedItemsDays { get { return Int32.Parse(ProviderSettings["KeepDeletedItemsDays"]); } } @@ -152,10 +157,10 @@ namespace WebsitePanel.Providers.HostedSolution /// /// /// - public Organization ExtendToExchangeOrganization(string organizationId, string securityGroup) - { - return ExtendToExchangeOrganizationInternal(organizationId, securityGroup); - } + public Organization ExtendToExchangeOrganization(string organizationId, string securityGroup, bool IsConsumer) + { + return ExtendToExchangeOrganizationInternal(organizationId, securityGroup, IsConsumer); + } /// /// Creates organization OAB on the Client Access Server @@ -183,13 +188,18 @@ namespace WebsitePanel.Providers.HostedSolution return GetOABVirtualDirectoryInternal(); } - public bool DeleteOrganization(string organizationId, string distinguishedName, - string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, - string securityGroup) - { - return DeleteOrganizationInternal(organizationId, distinguishedName, globalAddressList, - addressList, roomsAddressList, offlineAddressBook, securityGroup); - } + public Organization CreateOrganizationAddressBookPolicy(string organizationId, string gal, string addressBook, string roomList, string oab) + { + return CreateOrganizationAddressBookPolicyInternal(organizationId, gal, addressBook, roomList, oab); + } + + public bool DeleteOrganization(string organizationId, string distinguishedName, + string globalAddressList, string addressList, string roomList, string offlineAddressBook, + string securityGroup, string addressBookPolicy) + { + return DeleteOrganizationInternal(organizationId, distinguishedName, globalAddressList, + addressList, roomList, offlineAddressBook, securityGroup, addressBookPolicy); + } public void SetOrganizationStorageLimits(string organizationDistinguishedName, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) @@ -234,7 +244,7 @@ namespace WebsitePanel.Providers.HostedSolution SetMailboxPermissionsInternal(organizationId, accountName, sendAsAccounts, fullAccessAccounts); } - +/* public string CreateMailbox(string organizationId, string organizationDistinguishedName, string mailboxDatabase, string securityGroup, string offlineAddressBook, ExchangeAccountType accountType, string displayName, @@ -247,7 +257,7 @@ namespace WebsitePanel.Providers.HostedSolution enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); } - +*/ public void DeleteMailbox(string accountName) { DeleteMailboxInternal(accountName); @@ -258,17 +268,9 @@ namespace WebsitePanel.Providers.HostedSolution return GetMailboxGeneralSettingsInternal(accountName); } - public void SetMailboxGeneralSettings(string accountName, string displayName, string password, - bool hideFromAddressBook, bool disabled, string firstName, string initials, string lastName, - string address, string city, string state, string zip, string country, string jobTitle, - string company, string department, string office, string managerAccountName, - string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes) + public void SetMailboxGeneralSettings(string accountName, bool hideFromAddressBook, bool disabled) { - SetMailboxGeneralSettingsInternal(accountName, displayName, password, hideFromAddressBook, - disabled, firstName, initials, lastName, address, city, state, zip, country, jobTitle, - company, department, office, managerAccountName, businessPhone, fax, homePhone, - mobilePhone, pager, webPage, notes); + SetMailboxGeneralSettingsInternal(accountName, hideFromAddressBook, disabled); } public ExchangeMailbox GetMailboxMailFlowSettings(string accountName) @@ -276,29 +278,28 @@ namespace WebsitePanel.Providers.HostedSolution return GetMailboxMailFlowSettingsInternal(accountName); } - public void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, - string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, - string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, - int maxReceiveMessageSizeKB, bool requireSenderAuthentication) - { - SetMailboxMailFlowSettingsInternal(accountName, enableForwarding, forwardingAccountName, - forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, maxRecipients, - maxSendMessageSizeKB, maxReceiveMessageSizeKB, requireSenderAuthentication); - } + public void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, + string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + SetMailboxMailFlowSettingsInternal(accountName, enableForwarding, forwardingAccountName, + forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, requireSenderAuthentication); + } public ExchangeMailbox GetMailboxAdvancedSettings(string accountName) { return GetMailboxAdvancedSettingsInternal(accountName); } - public void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, - bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) - { - SetMailboxAdvancedSettingsInternal(organizationId, accountName, enablePOP, enableIMAP, enableOWA, - enableMAPI, enableActiveSync, issueWarningKB, - prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); - } + public void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, + bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB) + { + SetMailboxAdvancedSettingsInternal(organizationId, accountName, enablePOP, enableIMAP, enableOWA, + enableMAPI, enableActiveSync, issueWarningKB, + prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB); + } public ExchangeEmailAddress[] GetMailboxEmailAddresses(string accountName) { @@ -363,12 +364,12 @@ namespace WebsitePanel.Providers.HostedSolution #endregion #region Distribution lists - public void CreateDistributionList(string organizationId, string organizationDistinguishedName, - string displayName, string accountName, string name, string domain, string managedBy) - { - CreateDistributionListInternal(organizationId, organizationDistinguishedName, displayName, - accountName, name, domain, managedBy); - } + public void CreateDistributionList(string organizationId, string organizationDistinguishedName, + string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists) + { + CreateDistributionListInternal(organizationId, organizationDistinguishedName, displayName, + accountName, name, domain, managedBy, addressLists); + } public void DeleteDistributionList(string accountName) { @@ -380,58 +381,59 @@ namespace WebsitePanel.Providers.HostedSolution return GetDistributionListGeneralSettingsInternal(accountName); } - public void SetDistributionListGeneralSettings(string accountName, string displayName, - bool hideFromAddressBook, string managedBy, string[] members, string notes) - { - SetDistributionListGeneralSettingsInternal(accountName, displayName, hideFromAddressBook, - managedBy, members, notes); - } + public void SetDistributionListGeneralSettings(string accountName, string displayName, + bool hideFromAddressBook, string managedBy, string[] members, string notes, string[] addressLists) + { + SetDistributionListGeneralSettingsInternal(accountName, displayName, hideFromAddressBook, + managedBy, members, notes, addressLists); + } - public void AddDistributionListMembers(string accountName, string[] memberAccounts) - { - AddDistributionListMembersInternal(accountName, memberAccounts); - } + public void AddDistributionListMembers(string accountName, string[] memberAccounts, string[] addressLists) + { + AddDistributionListMembersInternal(accountName, memberAccounts, addressLists); + } - public void RemoveDistributionListMembers(string accountName, string[] memberAccounts) - { - RemoveDistributionListMembersInternal(accountName, memberAccounts); - } + + public void RemoveDistributionListMembers(string accountName, string[] memberAccounts, string[] addressLists) + { + RemoveDistributionListMembersInternal(accountName, memberAccounts, addressLists); + } public ExchangeDistributionList GetDistributionListMailFlowSettings(string accountName) { return GetDistributionListMailFlowSettingsInternal(accountName); } - public void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, - string[] rejectAccounts, bool requireSenderAuthentication) - { - SetDistributionListMailFlowSettingsInternal(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication); - } + public void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, + string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists) + { + SetDistributionListMailFlowSettingsInternal(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication, addressLists); + } public ExchangeEmailAddress[] GetDistributionListEmailAddresses(string accountName) { return GetDistributionListEmailAddressesInternal(accountName); } - public void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses) - { - SetDistributionListEmailAddressesInternal(accountName, emailAddresses); - } + public void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses, string[] addressLists) + { + SetDistributionListEmailAddressesInternal(accountName, emailAddresses, addressLists); + } - public void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress) - { - SetDistributionListPrimaryEmailAddressInternal(accountName, emailAddress); - } + public void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress, string[] addressLists) + { + SetDistributionListPrimaryEmailAddressInternal(accountName, emailAddress, addressLists); + } public ExchangeDistributionList GetDistributionListPermissions(string organizationId, string accountName) { return GetDistributionListPermissionsInternal(organizationId, accountName, null); } - public void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts) - { - SetDistributionListPermissionsInternal(organizationId, accountName, sendAsAccounts, sendOnBehalfAccounts); - } + public void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists) + { + SetDistributionListPermissionsInternal(organizationId, accountName, sendAsAccounts, sendOnBehalfAccounts, addressLists); + } #endregion #region Public folders @@ -455,10 +457,10 @@ namespace WebsitePanel.Providers.HostedSolution public void DisableMailbox(string id) { - DisableMailboxIntenal(id); + DisableMailboxInternal(id); } - private void DisableMailboxIntenal(string id) + internal virtual void DisableMailboxInternal(string id) { ExchangeLog.LogStart("DisableMailboxIntenal"); Runspace runSpace = null; @@ -617,9 +619,9 @@ namespace WebsitePanel.Providers.HostedSolution if (item is Organization) { Organization org = item as Organization; - DeleteOrganization(org.OrganizationId, org.DistinguishedName, org.GlobalAddressList, - org.AddressList, org.RoomsAddressList, org.OfflineAddressBook, org.SecurityGroup); - } + DeleteOrganization(org.OrganizationId, org.DistinguishedName, org.GlobalAddressList, + org.AddressList, org.RoomsAddressList, org.OfflineAddressBook, org.SecurityGroup, org.AddressBookPolicy); + } else if (item is ExchangeDomain) { DeleteAcceptedDomain(item.Name); @@ -706,9 +708,9 @@ namespace WebsitePanel.Providers.HostedSolution /// /// /// - private Organization ExtendToExchangeOrganizationInternal(string organizationId, string securityGroup) - { - ExchangeLog.LogStart("CreateOrganizationInternal"); + internal virtual Organization ExtendToExchangeOrganizationInternal(string organizationId, string securityGroup, bool IsConsumer) + { + ExchangeLog.LogStart("CreateOrganizationInternal"); ExchangeLog.DebugInfo(" Organization Id: {0}", organizationId); ExchangeTransaction transaction = StartTransaction(); @@ -724,7 +726,7 @@ namespace WebsitePanel.Providers.HostedSolution //Create mail enabled organization security group EnableMailSecurityDistributionGroup(runSpace, securityGroup, organizationId); transaction.RegisterMailEnabledDistributionGroup(securityGroup); - UpdateSecurityDistributionGroup(runSpace, securityGroup, organizationId); + UpdateSecurityDistributionGroup(runSpace, securityGroup, organizationId, IsConsumer); //create GAL string galId = CreateGlobalAddressList(runSpace, organizationId); @@ -742,7 +744,7 @@ namespace WebsitePanel.Providers.HostedSolution string ralId = CreateRoomsAddressList(runSpace, organizationId); transaction.RegisterNewRoomsAddressList(ralId); ExchangeLog.LogInfo(" Rooms Address List: {0}", ralId); - UpdateRoomsAddressList(runSpace, ralId, securityGroupPath); + UpdateAddressList(runSpace, ralId, securityGroupPath); //create ActiveSync policy string asId = CreateActiveSyncPolicy(runSpace, organizationId); @@ -847,20 +849,6 @@ namespace WebsitePanel.Providers.HostedSolution transaction.RegisterNewOfflineAddressBook(oabId); UpdateOfflineAddressBook(runSpace, oabId, securityGroupId); info.OfflineAddressBook = oabId; - - //create ABP - - bool enableSP2abp = false; - if (ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP] != null) - enableSP2abp = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP]); - Version exchangeVersion = GetExchangeVersion(); - - if (enableSP2abp && (exchangeVersion >= new Version(14, 2))) - { - string abpId = CreateAddressPolicy(runSpace, organizationId); - transaction.RegisterNewAddressPolicy(abpId); - ExchangeLog.LogInfo(" Address Policy: {0}", abpId); - } } catch (Exception ex) { @@ -908,11 +896,17 @@ namespace WebsitePanel.Providers.HostedSolution } ExchangeLog.LogEnd("UpdateOrganizationOfflineAddressBookInternal"); } + + internal virtual Organization CreateOrganizationAddressBookPolicyInternal(string organizationId, string gal, string addressBook, string roomList, string oab) + { + Organization info = new Organization(); + return info; + } - private bool DeleteOrganizationInternal(string organizationId, string distinguishedName, - string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup) - { + internal virtual bool DeleteOrganizationInternal(string organizationId, string distinguishedName, + string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup, string addressBookPolicy) + { ExchangeLog.LogStart("DeleteOrganizationInternal"); bool ret = true; @@ -944,30 +938,6 @@ namespace WebsitePanel.Providers.HostedSolution if (!DeleteOrganizationPublicFolders(runSpace, organizationId)) ret = false; - //delete ABP - - bool enableSP2abp = false; - if (ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP] != null) - enableSP2abp = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP]); - Version exchangeVersion = GetExchangeVersion(); - - if (enableSP2abp && (exchangeVersion >= new Version(14, 2))) - { - - - string adpstring = GetAddressPolicyName(organizationId); - - try - { - if (!string.IsNullOrEmpty(adpstring)) - DeleteAddressPolicy(runSpace, adpstring); - } - catch (Exception ex) - { - ret = false; - ExchangeLog.LogError("Could not delete Address Policy " + globalAddressList, ex); - } - } //delete OAB try @@ -997,7 +967,7 @@ namespace WebsitePanel.Providers.HostedSolution try { if (!string.IsNullOrEmpty(roomsAddressList)) - DeleteRoomsAddressList(runSpace, roomsAddressList); + DeleteAddressList(runSpace, roomsAddressList); } catch (Exception ex) { @@ -1101,7 +1071,7 @@ namespace WebsitePanel.Providers.HostedSolution return ret; } - private bool DeleteOrganizationMailboxes(Runspace runSpace, string ou) + internal bool DeleteOrganizationMailboxes(Runspace runSpace, string ou) { ExchangeLog.LogStart("DeleteOrganizationMailboxes"); bool ret = true; @@ -1131,7 +1101,7 @@ namespace WebsitePanel.Providers.HostedSolution return ret; } - private bool DeleteOrganizationContacts(Runspace runSpace, string ou) + internal bool DeleteOrganizationContacts(Runspace runSpace, string ou) { ExchangeLog.LogStart("DeleteOrganizationContacts"); bool ret = true; @@ -1161,7 +1131,7 @@ namespace WebsitePanel.Providers.HostedSolution return ret; } - private bool DeleteOrganizationDistributionLists(Runspace runSpace, string ou) + internal bool DeleteOrganizationDistributionLists(Runspace runSpace, string ou) { ExchangeLog.LogStart("DeleteOrganizationDistributionLists"); bool ret = true; @@ -1392,7 +1362,7 @@ namespace WebsitePanel.Providers.HostedSolution return size; } - private long CalculatePublicFolderDiskSpace(Runspace runSpace, string folder) + internal virtual long CalculatePublicFolderDiskSpace(Runspace runSpace, string folder) { ExchangeLog.LogStart("CalculatePublicFolderDiskSpace"); ExchangeLog.DebugInfo("Folder: {0}", folder); @@ -1649,7 +1619,7 @@ namespace WebsitePanel.Providers.HostedSolution } - private void RemoveMailboxAccessPermission(Runspace runSpace, string accountName, string account, string accessRights) + internal void RemoveMailboxAccessPermission(Runspace runSpace, string accountName, string account, string accessRights) { ExchangeLog.LogStart("RemoveMailboxFullAccessPermission"); @@ -1779,167 +1749,165 @@ namespace WebsitePanel.Providers.HostedSolution public string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, - string mailboxDatabase, string offlineAddressBook, + string mailboxDatabase, string offlineAddressBook,string addressBookPolicy, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, + int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook, bool IsConsumer) { return CreateMailEnableUserInternal(upn, organizationId, organizationDistinguishedName, accountType, - mailboxDatabase, offlineAddressBook, + mailboxDatabase, offlineAddressBook,addressBookPolicy, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays); + keepDeletedItemsDays, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, hideFromAddressBook, IsConsumer); } - private string CreateMailEnableUserInternal(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, - string mailboxDatabase, string offlineAddressBook, - string accountName, bool enablePOP, bool enableIMAP, - bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) - { + internal virtual string CreateMailEnableUserInternal(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, + string mailboxDatabase, string offlineAddressBook, string addressBookPolicy, + string accountName, bool enablePOP, bool enableIMAP, + bool enableOWA, bool enableMAPI, bool enableActiveSync, + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, + int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook, bool IsConsumer) + { - ExchangeLog.LogStart("CreateMailEnableUserInternal"); - ExchangeLog.DebugInfo("Organization Id: {0}", organizationId); + ExchangeLog.LogStart("CreateMailEnableUserInternal"); + ExchangeLog.DebugInfo("Organization Id: {0}", organizationId); - string ret = null; - ExchangeTransaction transaction = StartTransaction(); - Runspace runSpace = null; + string ret = null; + ExchangeTransaction transaction = StartTransaction(); + Runspace runSpace = null; - int attempts = 0; - string id = null; + int attempts = 0; + string id = null; Version exchangeVersion = GetExchangeVersion(); + + try + { + runSpace = OpenRunspace(); + Command cmd = null; + Collection result = null; + //try to enable mail user for 10 times + while (true) + { + try + { - try - { - runSpace = OpenRunspace(); - Command cmd = null; - Collection result = null; - - //try to enable mail user for 10 times - while (true) - { - try - { - //create mailbox - cmd = new Command("Enable-Mailbox"); - cmd.Parameters.Add("Identity", upn); - cmd.Parameters.Add("Alias", accountName); + //create mailbox + cmd = new Command("Enable-Mailbox"); + cmd.Parameters.Add("Identity", upn); + cmd.Parameters.Add("Alias", accountName); if (!(mailboxDatabase == "*" && exchangeVersion >= new Version(14, 0))) cmd.Parameters.Add("Database", mailboxDatabase); - if (accountType == ExchangeAccountType.Equipment) - cmd.Parameters.Add("Equipment"); - else if (accountType == ExchangeAccountType.Room) - cmd.Parameters.Add("Room"); + if (accountType == ExchangeAccountType.Equipment) + cmd.Parameters.Add("Equipment"); + else if (accountType == ExchangeAccountType.Room) + cmd.Parameters.Add("Room"); - result = ExecuteShellCommand(runSpace, cmd); + result = ExecuteShellCommand(runSpace, cmd); - id = CheckResultObjectDN(result); - } - catch (Exception ex) - { - ExchangeLog.LogError(ex); - } - if (id != null) - break; + id = CheckResultObjectDN(result); + } + catch (Exception ex) + { + ExchangeLog.LogError(ex); + } + if (id != null) + break; - if (attempts > 9) - throw new Exception( - string.Format("Could not enable mail user '{0}' ", accountName)); + if (attempts > 9) + throw new Exception( + string.Format("Could not enable mail user '{0}' ", accountName)); - attempts++; - ExchangeLog.LogWarning("Attempt #{0} to enable mail user failed!", attempts); - // wait 5 sec - System.Threading.Thread.Sleep(5000); - } + attempts++; + ExchangeLog.LogWarning("Attempt #{0} to enable mail user failed!", attempts); + // wait 5 sec + System.Threading.Thread.Sleep(5000); + } - //transaction.RegisterNewMailbox(id); + //transaction.RegisterNewMailbox(id); - string windowsEmailAddress = ObjToString(GetPSObjectProperty(result[0], "WindowsEmailAddress")); - string adpstring = GetAddressPolicyName(organizationId); + string windowsEmailAddress = ObjToString(GetPSObjectProperty(result[0], "WindowsEmailAddress")); - //update mailbox - cmd = new Command("Set-Mailbox"); - cmd.Parameters.Add("Identity", id); - cmd.Parameters.Add("OfflineAddressBook", offlineAddressBook); - cmd.Parameters.Add("EmailAddressPolicyEnabled", false); - cmd.Parameters.Add("CustomAttribute1", organizationId); - cmd.Parameters.Add("CustomAttribute3", windowsEmailAddress); - cmd.Parameters.Add("PrimarySmtpAddress", upn); - cmd.Parameters.Add("WindowsEmailAddress", upn); - - bool enableSP2abp = false; - if (ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP] != null) - enableSP2abp = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP]); - if (enableSP2abp && (exchangeVersion >= new Version(14, 2))) - cmd.Parameters.Add("AddressBookPolicy", adpstring); + //update mailbox + cmd = new Command("Set-Mailbox"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("OfflineAddressBook", offlineAddressBook); + cmd.Parameters.Add("EmailAddressPolicyEnabled", false); + cmd.Parameters.Add("CustomAttribute1", organizationId); + cmd.Parameters.Add("CustomAttribute3", windowsEmailAddress); + cmd.Parameters.Add("PrimarySmtpAddress", upn); + cmd.Parameters.Add("WindowsEmailAddress", upn); - cmd.Parameters.Add("UseDatabaseQuotaDefaults", new bool?(false)); - cmd.Parameters.Add("UseDatabaseRetentionDefaults", false); - cmd.Parameters.Add("IssueWarningQuota", ConvertKBToUnlimited(issueWarningKB)); - cmd.Parameters.Add("ProhibitSendQuota", ConvertKBToUnlimited(prohibitSendKB)); - cmd.Parameters.Add("ProhibitSendReceiveQuota", ConvertKBToUnlimited(prohibitSendReceiveKB)); - cmd.Parameters.Add("RetainDeletedItemsFor", ConvertDaysToEnhancedTimeSpan(keepDeletedItemsDays)); - ExecuteShellCommand(runSpace, cmd); + cmd.Parameters.Add("UseDatabaseQuotaDefaults", new bool?(false)); + cmd.Parameters.Add("UseDatabaseRetentionDefaults", false); + cmd.Parameters.Add("IssueWarningQuota", ConvertKBToUnlimited(issueWarningKB)); + cmd.Parameters.Add("ProhibitSendQuota", ConvertKBToUnlimited(prohibitSendKB)); + cmd.Parameters.Add("ProhibitSendReceiveQuota", ConvertKBToUnlimited(prohibitSendReceiveKB)); + cmd.Parameters.Add("RetainDeletedItemsFor", ConvertDaysToEnhancedTimeSpan(keepDeletedItemsDays)); + cmd.Parameters.Add("RecipientLimits", ConvertInt32ToUnlimited(maxRecipients)); + cmd.Parameters.Add("MaxSendSize", ConvertKBToUnlimited(maxSendMessageSizeKB)); + cmd.Parameters.Add("MaxReceiveSize", ConvertKBToUnlimited(maxReceiveMessageSizeKB)); + cmd.Parameters.Add("HiddenFromAddressListsEnabled", hideFromAddressBook); + ExecuteShellCommand(runSpace, cmd); + //update AD object + string globalAddressListName = this.GetGlobalAddressListName(organizationId); + string globalAddressListDN = this.GetGlobalAddressListDN(runSpace, globalAddressListName); + string path = AddADPrefix(id); + DirectoryEntry mailbox = GetADObject(path); + // check if msExchQueryBaseDN must be cleared for Exchange 2010 SP1 + bool clearQueryBaseDN = false; + if (ConfigurationManager.AppSettings[CONFIG_CLEAR_QUERYBASEDN] != null) + clearQueryBaseDN = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_CLEAR_QUERYBASEDN]); - //update AD object - string globalAddressListName = this.GetGlobalAddressListName(organizationId); - string globalAddressListDN = this.GetGlobalAddressListDN(runSpace, globalAddressListName); - string path = AddADPrefix(id); - DirectoryEntry mailbox = GetADObject(path); + if (!(clearQueryBaseDN && (exchangeVersion >= new Version(14, 1)))) + SetADObjectPropertyValue(mailbox, "msExchQueryBaseDN", globalAddressListDN); - // check if msExchQueryBaseDN must be cleared for Exchange 2010 SP1 - bool clearQueryBaseDN = false; - if (ConfigurationManager.AppSettings[CONFIG_CLEAR_QUERYBASEDN] != null) - clearQueryBaseDN = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_CLEAR_QUERYBASEDN]); + //SetADObjectPropertyValue(mailbox, "msExchUseOAB", offlineAddressBook); + mailbox.CommitChanges(); + mailbox.Close(); - if (!(clearQueryBaseDN && (exchangeVersion >= new Version(14, 1)))) - SetADObjectPropertyValue(mailbox, "msExchQueryBaseDN", globalAddressListDN); + //Client Access + cmd = new Command("Set-CASMailbox"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("ActiveSyncEnabled", enableActiveSync); + if (enableActiveSync) + { + cmd.Parameters.Add("ActiveSyncMailboxPolicy", organizationId); + } + cmd.Parameters.Add("OWAEnabled", enableOWA); + cmd.Parameters.Add("MAPIEnabled", enableMAPI); + cmd.Parameters.Add("PopEnabled", enablePOP); + cmd.Parameters.Add("ImapEnabled", enableIMAP); + ExecuteShellCommand(runSpace, cmd); - //SetADObjectPropertyValue(mailbox, "msExchUseOAB", offlineAddressBook); - mailbox.CommitChanges(); - mailbox.Close(); + //calendar settings + if (accountType == ExchangeAccountType.Equipment || accountType == ExchangeAccountType.Room) + { + //SetCalendarSettings(runSpace, id); + } - //Client Access - cmd = new Command("Set-CASMailbox"); - cmd.Parameters.Add("Identity", id); - cmd.Parameters.Add("ActiveSyncEnabled", enableActiveSync); - if (enableActiveSync) - { - cmd.Parameters.Add("ActiveSyncMailboxPolicy", organizationId); - } - cmd.Parameters.Add("OWAEnabled", enableOWA); - cmd.Parameters.Add("MAPIEnabled", enableMAPI); - cmd.Parameters.Add("PopEnabled", enablePOP); - cmd.Parameters.Add("ImapEnabled", enableIMAP); - ExecuteShellCommand(runSpace, cmd); - - //calendar settings - if (accountType == ExchangeAccountType.Equipment || accountType == ExchangeAccountType.Room) - { - SetCalendarSettings(runSpace, id); - } - - ret = string.Format("{0}\\{1}", GetNETBIOSDomainName(), accountName); - ExchangeLog.LogEnd("CreateMailEnableUserInternal"); - return ret; - } - catch (Exception ex) - { - ExchangeLog.LogError("CreateMailEnableUserInternal", ex); - RollbackTransaction(transaction); - throw; - } - finally - { - CloseRunspace(runSpace); - } - } + ret = string.Format("{0}\\{1}", GetNETBIOSDomainName(), accountName); + ExchangeLog.LogEnd("CreateMailEnableUserInternal"); + return ret; + } + catch (Exception ex) + { + ExchangeLog.LogError("CreateMailEnableUserInternal", ex); + RollbackTransaction(transaction); + throw; + } + finally + { + CloseRunspace(runSpace); + } + } + /* private string CreateMailboxInternal(string organizationId, string organizationDistinguishedName, string mailboxDatabase, string securityGroup, string offlineAddressBook, ExchangeAccountType accountType, string displayName, @@ -2074,7 +2042,7 @@ namespace WebsitePanel.Providers.HostedSolution CloseRunspace(runSpace); } } - +*/ internal virtual void SetCalendarSettings(Runspace runspace, string id) { ExchangeLog.LogStart("SetCalendarSettings"); @@ -2085,7 +2053,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("SetCalendarSettings"); } - private void DeleteMailboxInternal(string accountName) + internal virtual void DeleteMailboxInternal(string accountName) { ExchangeLog.LogStart("DeleteMailboxInternal"); ExchangeLog.DebugInfo("Account Name: {0}", accountName); @@ -2105,7 +2073,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("DeleteMailboxInternal"); } - private void RemoveMailbox(Runspace runSpace, string id) + internal void RemoveMailbox(Runspace runSpace, string id) { ExchangeLog.LogStart("RemoveMailbox"); Command cmd = new Command("Remove-Mailbox"); @@ -2116,6 +2084,16 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("RemoveMailbox"); } + private void DisableMailbox(Runspace runSpace, string id) + { + ExchangeLog.LogStart("DisableMailbox"); + Command cmd = new Command("Disable-Mailbox"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("Confirm", false); + ExecuteShellCommand(runSpace, cmd); + ExchangeLog.LogEnd("DisableMailbox"); + } + private string GetMailboxCommonName(Runspace runSpace, string accountName) { ExchangeLog.LogStart("GetMailboxCommonName"); @@ -2212,71 +2190,39 @@ namespace WebsitePanel.Providers.HostedSolution } - private void SetMailboxGeneralSettingsInternal(string accountName, string displayName, string password, - bool hideFromAddressBook, bool disabled, string firstName, string initials, string lastName, - string address, string city, string state, string zip, string country, string jobTitle, - string company, string department, string office, string managerAccountName, string businessPhone, - string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes) - { - ExchangeLog.LogStart("SetMailboxGeneralSettingsInternal"); - ExchangeLog.DebugInfo("Account: {0}", accountName); + private void SetMailboxGeneralSettingsInternal(string accountName, bool hideFromAddressBook, bool disabled) + { + ExchangeLog.LogStart("SetMailboxGeneralSettingsInternal"); + ExchangeLog.DebugInfo("Account: {0}", accountName); - Runspace runSpace = null; - try - { - runSpace = OpenRunspace(); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); - Collection result = GetMailboxObject(runSpace, accountName); - PSObject mailbox = result[0]; + Collection result = GetMailboxObject(runSpace, accountName); + PSObject mailbox = result[0]; - string id = GetResultObjectDN(result); - string path = AddADPrefix(id); - DirectoryEntry entry = GetADObject(path); - entry.InvokeSet("AccountDisabled", disabled); - if (!string.IsNullOrEmpty(password)) - entry.Invoke("SetPassword", password); - entry.CommitChanges(); + string id = GetResultObjectDN(result); + string path = AddADPrefix(id); + DirectoryEntry entry = GetADObject(path); + entry.InvokeSet("AccountDisabled", disabled); + entry.CommitChanges(); - Command cmd = new Command("Set-Mailbox"); - cmd.Parameters.Add("Identity", accountName); - cmd.Parameters.Add("DisplayName", displayName); - cmd.Parameters.Add("HiddenFromAddressListsEnabled", hideFromAddressBook); - cmd.Parameters.Add("CustomAttribute2", (disabled ? "disabled" : null)); - ExecuteShellCommand(runSpace, cmd); + Command cmd = new Command("Set-Mailbox"); + cmd.Parameters.Add("Identity", accountName); + cmd.Parameters.Add("HiddenFromAddressListsEnabled", hideFromAddressBook); + cmd.Parameters.Add("CustomAttribute2", (disabled ? "disabled" : null)); + ExecuteShellCommand(runSpace, cmd); - cmd = new Command("Set-User"); - cmd.Parameters.Add("Identity", accountName); - cmd.Parameters.Add("FirstName", firstName); - cmd.Parameters.Add("Initials", initials); - cmd.Parameters.Add("LastName", lastName); - cmd.Parameters.Add("StreetAddress", address); - cmd.Parameters.Add("City", city); - cmd.Parameters.Add("StateOrProvince", state); - cmd.Parameters.Add("PostalCode", zip); - cmd.Parameters.Add("CountryOrRegion", ParseCountryInfo(country)); - cmd.Parameters.Add("Title", jobTitle); - cmd.Parameters.Add("Company", company); - cmd.Parameters.Add("Department", department); - cmd.Parameters.Add("Office", office); - cmd.Parameters.Add("Manager", managerAccountName); - cmd.Parameters.Add("Phone", businessPhone); - cmd.Parameters.Add("Fax", fax); - cmd.Parameters.Add("HomePhone", homePhone); - cmd.Parameters.Add("MobilePhone", mobilePhone); - cmd.Parameters.Add("Pager", pager); - cmd.Parameters.Add("WebPage", webPage); - cmd.Parameters.Add("Notes", notes); + } + finally + { - ExecuteShellCommand(runSpace, cmd); - - } - finally - { - - CloseRunspace(runSpace); - } - ExchangeLog.LogEnd("SetMailboxGeneralSettingsInternal"); - } + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("SetMailboxGeneralSettingsInternal"); + } private void ChangeMailboxState(string id, bool enabled) { @@ -2334,62 +2280,58 @@ namespace WebsitePanel.Providers.HostedSolution return info; } - private void SetMailboxMailFlowSettingsInternal(string accountName, bool enableForwarding, - string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, - string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, - int maxReceiveMessageSizeKB, bool requireSenderAuthentication) - { - ExchangeLog.LogStart("SetMailboxMailFlowSettingsInternal"); - ExchangeLog.DebugInfo("Account: {0}", accountName); + private void SetMailboxMailFlowSettingsInternal(string accountName, bool enableForwarding, + string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + ExchangeLog.LogStart("SetMailboxMailFlowSettingsInternal"); + ExchangeLog.DebugInfo("Account: {0}", accountName); - Runspace runSpace = null; - try - { - runSpace = OpenRunspace(); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); - Command cmd = new Command("Set-Mailbox"); - cmd.Parameters.Add("Identity", accountName); + Command cmd = new Command("Set-Mailbox"); + cmd.Parameters.Add("Identity", accountName); - if (enableForwarding) - { - cmd.Parameters.Add("ForwardingAddress", forwardingAccountName); - cmd.Parameters.Add("DeliverToMailboxAndForward", forwardToBoth); - } - else - { - cmd.Parameters.Add("ForwardingAddress", null); - cmd.Parameters.Add("DeliverToMailboxAndForward", false); - } + if (enableForwarding) + { + cmd.Parameters.Add("ForwardingAddress", forwardingAccountName); + cmd.Parameters.Add("DeliverToMailboxAndForward", forwardToBoth); + } + else + { + cmd.Parameters.Add("ForwardingAddress", null); + cmd.Parameters.Add("DeliverToMailboxAndForward", false); + } - cmd.Parameters.Add("GrantSendOnBehalfTo", SetSendOnBehalfAccounts(runSpace, sendOnBehalfAccounts)); + cmd.Parameters.Add("GrantSendOnBehalfTo", SetSendOnBehalfAccounts(runSpace, sendOnBehalfAccounts)); - MultiValuedProperty ids = null; - MultiValuedProperty dlIds = null; + MultiValuedProperty ids = null; + MultiValuedProperty dlIds = null; - SetAccountIds(runSpace, acceptAccounts, out ids, out dlIds); - cmd.Parameters.Add("AcceptMessagesOnlyFrom", ids); - cmd.Parameters.Add("AcceptMessagesOnlyFromDLMembers", dlIds); + SetAccountIds(runSpace, acceptAccounts, out ids, out dlIds); + cmd.Parameters.Add("AcceptMessagesOnlyFrom", ids); + cmd.Parameters.Add("AcceptMessagesOnlyFromDLMembers", dlIds); - SetAccountIds(runSpace, rejectAccounts, out ids, out dlIds); - cmd.Parameters.Add("RejectMessagesFrom", ids); - cmd.Parameters.Add("RejectMessagesFromDLMembers", dlIds); + SetAccountIds(runSpace, rejectAccounts, out ids, out dlIds); + cmd.Parameters.Add("RejectMessagesFrom", ids); + cmd.Parameters.Add("RejectMessagesFromDLMembers", dlIds); - cmd.Parameters.Add("RecipientLimits", ConvertInt32ToUnlimited(maxRecipients)); - cmd.Parameters.Add("MaxSendSize", ConvertKBToUnlimited(maxSendMessageSizeKB)); - cmd.Parameters.Add("MaxReceiveSize", ConvertKBToUnlimited(maxReceiveMessageSizeKB)); - cmd.Parameters.Add("RequireSenderAuthenticationEnabled", requireSenderAuthentication); + cmd.Parameters.Add("RequireSenderAuthenticationEnabled", requireSenderAuthentication); - ExecuteShellCommand(runSpace, cmd); + ExecuteShellCommand(runSpace, cmd); - } - finally - { + } + finally + { - CloseRunspace(runSpace); - } - ExchangeLog.LogEnd("SetMailboxMailFlowSettingsInternal"); - } + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("SetMailboxMailFlowSettingsInternal"); + } private ExchangeMailbox GetMailboxAdvancedSettingsInternal(string accountName) { @@ -2464,48 +2406,52 @@ namespace WebsitePanel.Providers.HostedSolution return info; } - private void SetMailboxAdvancedSettingsInternal(string organizationId, string accountName, bool enablePOP, bool enableIMAP, - bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, - int prohibitSendReceiveKB, int keepDeletedItemsDays) - { - ExchangeLog.LogStart("SetMailboxAdvancedSettingsInternal"); - ExchangeLog.DebugInfo("Account: {0}", accountName); + private void SetMailboxAdvancedSettingsInternal(string organizationId, string accountName, bool enablePOP, bool enableIMAP, + bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, + int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB) + { + ExchangeLog.LogStart("SetMailboxAdvancedSettingsInternal"); + ExchangeLog.DebugInfo("Account: {0}", accountName); - Runspace runSpace = null; - try - { - runSpace = OpenRunspace(); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); - Command cmd = new Command("Set-Mailbox"); - cmd.Parameters.Add("Identity", accountName); - cmd.Parameters.Add("IssueWarningQuota", ConvertKBToUnlimited(issueWarningKB)); - cmd.Parameters.Add("ProhibitSendQuota", ConvertKBToUnlimited(prohibitSendKB)); - cmd.Parameters.Add("ProhibitSendReceiveQuota", ConvertKBToUnlimited(prohibitSendReceiveKB)); - cmd.Parameters.Add("RetainDeletedItemsFor", ConvertDaysToEnhancedTimeSpan(keepDeletedItemsDays)); - ExecuteShellCommand(runSpace, cmd); + Command cmd = new Command("Set-Mailbox"); + cmd.Parameters.Add("Identity", accountName); + cmd.Parameters.Add("IssueWarningQuota", ConvertKBToUnlimited(issueWarningKB)); + cmd.Parameters.Add("ProhibitSendQuota", ConvertKBToUnlimited(prohibitSendKB)); + cmd.Parameters.Add("ProhibitSendReceiveQuota", ConvertKBToUnlimited(prohibitSendReceiveKB)); + cmd.Parameters.Add("RetainDeletedItemsFor", ConvertDaysToEnhancedTimeSpan(keepDeletedItemsDays)); + cmd.Parameters.Add("RecipientLimits", ConvertInt32ToUnlimited(maxRecipients)); + cmd.Parameters.Add("MaxSendSize", ConvertKBToUnlimited(maxSendMessageSizeKB)); + cmd.Parameters.Add("MaxReceiveSize", ConvertKBToUnlimited(maxReceiveMessageSizeKB)); + ExecuteShellCommand(runSpace, cmd); - //Client Access - cmd = new Command("Set-CASMailbox"); - cmd.Parameters.Add("Identity", accountName); - cmd.Parameters.Add("ActiveSyncEnabled", enableActiveSync); - if (enableActiveSync) - { - cmd.Parameters.Add("ActiveSyncMailboxPolicy", organizationId); - } - cmd.Parameters.Add("OWAEnabled", enableOWA); - cmd.Parameters.Add("MAPIEnabled", enableMAPI); - cmd.Parameters.Add("PopEnabled", enablePOP); - cmd.Parameters.Add("ImapEnabled", enableIMAP); - ExecuteShellCommand(runSpace, cmd); - } - finally - { + //Client Access + cmd = new Command("Set-CASMailbox"); + cmd.Parameters.Add("Identity", accountName); + cmd.Parameters.Add("ActiveSyncEnabled", enableActiveSync); + if (enableActiveSync) + { + cmd.Parameters.Add("ActiveSyncMailboxPolicy", organizationId); + } + cmd.Parameters.Add("OWAEnabled", enableOWA); + cmd.Parameters.Add("MAPIEnabled", enableMAPI); + cmd.Parameters.Add("PopEnabled", enablePOP); + cmd.Parameters.Add("ImapEnabled", enableIMAP); + ExecuteShellCommand(runSpace, cmd); + } + finally + { - CloseRunspace(runSpace); - } - ExchangeLog.LogEnd("SetMailboxAdvancedSettingsInternal"); - } + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("SetMailboxAdvancedSettingsInternal"); + } private ExchangeEmailAddress[] GetMailboxEmailAddressesInternal(string accountName) { @@ -3267,7 +3213,7 @@ namespace WebsitePanel.Providers.HostedSolution return id; } - private string EnableMailSecurityDistributionGroup(Runspace runSpace, string distName, string groupName) + internal string EnableMailSecurityDistributionGroup(Runspace runSpace, string distName, string groupName) { ExchangeLog.LogStart("EnableMailSecurityDistributionGroup"); ExchangeLog.DebugInfo("Group Distinguished Name: {0}", distName); @@ -3312,7 +3258,7 @@ namespace WebsitePanel.Providers.HostedSolution return securityGroupId; } - private void DisableMailSecurityDistributionGroup(Runspace runSpace, string id) + internal void DisableMailSecurityDistributionGroup(Runspace runSpace, string id) { ExchangeLog.LogStart("DisableMailSecurityDistributionGroup"); ExchangeLog.DebugInfo("Group Id: {0}", id); @@ -3324,7 +3270,7 @@ namespace WebsitePanel.Providers.HostedSolution } - private void UpdateSecurityDistributionGroup(Runspace runSpace, string id, string groupName) + internal void UpdateSecurityDistributionGroup(Runspace runSpace, string id, string groupName, bool isConsumer) { ExchangeLog.LogStart("UpdateSecurityDistributionGroup"); @@ -3332,21 +3278,22 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("Identity", id); cmd.Parameters.Add("EmailAddressPolicyEnabled", false); cmd.Parameters.Add("CustomAttribute1", groupName); - cmd.Parameters.Add("HiddenFromAddressListsEnabled", true); + cmd.Parameters.Add("HiddenFromAddressListsEnabled", !isConsumer); ExecuteShellCommand(runSpace, cmd); ExchangeLog.LogEnd("UpdateSecurityDistributionGroup"); } - private void CreateDistributionListInternal( - string organizationId, - string organizationDistinguishedName, - string displayName, - string accountName, - string name, - string domain, - string managedBy) - { + private void CreateDistributionListInternal( + string organizationId, + string organizationDistinguishedName, + string displayName, + string accountName, + string name, + string domain, + string managedBy, + string[] addressLists) + { ExchangeLog.LogStart("CreateDistributionListInternal"); ExchangeLog.DebugInfo("Organization Id: {0}", organizationId); ExchangeLog.DebugInfo("Name: {0}", name); @@ -3395,6 +3342,11 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("WindowsEmailAddress", email); cmd.Parameters.Add("RequireSenderAuthenticationEnabled", false); ExecuteShellCommand(runSpace, cmd); + + //fix showInAddressBook Attribute + if (addressLists.Length > 0) + FixShowInAddressBook(runSpace, email, addressLists); + } catch (Exception ex) { @@ -3410,6 +3362,23 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("CreateDistributionListInternal"); } + private void FixShowInAddressBook(Runspace runSpace, string accountName, string[] addressLists) + { + Command cmd = new Command("Get-DistributionGroup"); + cmd.Parameters.Add("Identity", accountName); + + Collection result = ExecuteShellCommand(runSpace, cmd); + string id = GetResultObjectDN(result); + + DirectoryEntry dlDEEntry = GetADObject(AddADPrefix(id)); + dlDEEntry.Properties["showInAddressBook"].Clear(); + foreach (string addressList in addressLists) + { + dlDEEntry.Properties["showInAddressBook"].Add(addressList); + } + dlDEEntry.CommitChanges(); + } + private void DeleteDistributionListInternal(string accountName) { ExchangeLog.LogStart("DeleteDistributionListInternal"); @@ -3450,27 +3419,29 @@ namespace WebsitePanel.Providers.HostedSolution Runspace runSpace = null; try { - runSpace = OpenRunspace(); + runSpace = OpenRunspace(); - Command cmd = new Command("Get-DistributionGroup"); - cmd.Parameters.Add("Identity", accountName); - Collection result = ExecuteShellCommand(runSpace, cmd); - PSObject distributionGroup = result[0]; + Command cmd = new Command("Get-DistributionGroup"); + cmd.Parameters.Add("Identity", accountName); + Collection result = ExecuteShellCommand(runSpace, cmd); + PSObject distributionGroup = result[0]; - info.DisplayName = (string)GetPSObjectProperty(distributionGroup, "DisplayName"); - info.HideFromAddressBook = - (bool)GetPSObjectProperty(distributionGroup, "HiddenFromAddressListsEnabled"); + info.DisplayName = (string)GetPSObjectProperty(distributionGroup, "DisplayName"); + info.HideFromAddressBook = + (bool)GetPSObjectProperty(distributionGroup, "HiddenFromAddressListsEnabled"); - cmd = new Command("Get-Group"); - cmd.Parameters.Add("Identity", accountName); - result = ExecuteShellCommand(runSpace, cmd); - PSObject group = result[0]; + info.SAMAccountName = string.Format("{0}\\{1}", GetNETBIOSDomainName(), (string)GetPSObjectProperty(distributionGroup, "SamAccountName")); - info.ManagerAccount = GetGroupManagerAccount(runSpace, group); - info.MembersAccounts = GetGroupMembers(runSpace, accountName); - info.Notes = (string)GetPSObjectProperty(group, "Notes"); - } + cmd = new Command("Get-Group"); + cmd.Parameters.Add("Identity", accountName); + result = ExecuteShellCommand(runSpace, cmd); + PSObject group = result[0]; + + info.ManagerAccount = GetGroupManagerAccount(runSpace, group); + info.MembersAccounts = GetGroupMembers(runSpace, accountName); + info.Notes = (string)GetPSObjectProperty(group, "Notes"); + } finally { @@ -3490,9 +3461,9 @@ namespace WebsitePanel.Providers.HostedSolution return ObjToString(GetPSObjectProperty(group, "ManagedBy")); } - private void SetDistributionListGeneralSettingsInternal(string accountName, string displayName, - bool hideFromAddressBook, string managedBy, string[] memberAccounts, string notes) - { + private void SetDistributionListGeneralSettingsInternal(string accountName, string displayName, + bool hideFromAddressBook, string managedBy, string[] memberAccounts, string notes, string[] addressLists) + { ExchangeLog.LogStart("SetDistributionListGeneralSettingsInternal"); ExchangeLog.DebugInfo("Account: {0}", accountName); @@ -3561,6 +3532,10 @@ namespace WebsitePanel.Providers.HostedSolution { AddADPermission(runSpace, accountName, managedBy, "WriteProperty", null, "Member"); } + + if (addressLists.Length > 0) + FixShowInAddressBook(runSpace, accountName, addressLists); + } finally { @@ -3605,7 +3580,7 @@ namespace WebsitePanel.Providers.HostedSolution } - private void AddDistributionListMembersInternal(string accountName, string[] memberAccounts) + private void AddDistributionListMembersInternal(string accountName, string[] memberAccounts, string[] addressLists) { ExchangeLog.LogStart("AddDistributionListMembersInternal"); ExchangeLog.DebugInfo("Account: {0}", accountName); @@ -3624,8 +3599,13 @@ namespace WebsitePanel.Providers.HostedSolution cmd = new Command("Add-DistributionGroupMember"); cmd.Parameters.Add("Identity", accountName); cmd.Parameters.Add("Member", member); + cmd.Parameters.Add("BypassSecurityGroupManagerCheck", true); ExecuteShellCommand(runSpace, cmd); } + + if (addressLists.Length > 0) + FixShowInAddressBook(runSpace, accountName, addressLists); + } finally { @@ -3636,7 +3616,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("AddDistributionListMembersInternal"); } - private void RemoveDistributionListMembersInternal(string accountName, string[] memberAccounts) + private void RemoveDistributionListMembersInternal(string accountName, string[] memberAccounts, string[] addressLists) { ExchangeLog.LogStart("RemoveDistributionListMembersInternal"); ExchangeLog.DebugInfo("Account: {0}", accountName); @@ -3658,6 +3638,10 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("Confirm", false); ExecuteShellCommand(runSpace, cmd); } + + if (addressLists.Length > 0) + FixShowInAddressBook(runSpace, accountName, addressLists); + } finally { @@ -3698,9 +3682,9 @@ namespace WebsitePanel.Providers.HostedSolution return info; } - private void SetDistributionListMailFlowSettingsInternal(string accountName, - string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { + private void SetDistributionListMailFlowSettingsInternal(string accountName, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists) + { ExchangeLog.LogStart("SetDistributionListMailFlowSettingsInternal"); ExchangeLog.DebugInfo("Account: {0}", accountName); @@ -3727,6 +3711,9 @@ namespace WebsitePanel.Providers.HostedSolution ExecuteShellCommand(runSpace, cmd); + if (addressLists.Length > 0) + FixShowInAddressBook(runSpace, accountName, addressLists); + } finally { @@ -3809,7 +3796,7 @@ namespace WebsitePanel.Providers.HostedSolution return list.ToArray(); } - private void SetDistributionListEmailAddressesInternal(string accountName, string[] emailAddresses) + private void SetDistributionListEmailAddressesInternal(string accountName, string[] emailAddresses, string[] addressLists) { ExchangeLog.LogStart("SetDistributionListEmailAddressesInternal"); ExchangeLog.DebugInfo("Account: {0}", accountName); @@ -3859,6 +3846,9 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("WindowsEmailAddress", primaryEmail); } ExecuteShellCommand(runSpace, cmd); + + if (addressLists.Length > 0) + FixShowInAddressBook(runSpace, accountName, addressLists); } finally { @@ -3868,7 +3858,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("SetDistributionListEmailAddressesInternal"); } - private void SetDistributionListPrimaryEmailAddressInternal(string accountName, string emailAddress) + private void SetDistributionListPrimaryEmailAddressInternal(string accountName, string emailAddress, string[] addressLists) { ExchangeLog.LogStart("SetDistributionListPrimaryEmailAddressInternal"); ExchangeLog.DebugInfo("Account: {0}", accountName); @@ -3886,6 +3876,8 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("WindowsEmailAddress", primaryEmail); ExecuteShellCommand(runSpace, cmd); + + } finally { @@ -3941,7 +3933,7 @@ namespace WebsitePanel.Providers.HostedSolution return exchangeDistributionList; } - private void SetDistributionListPermissionsInternal(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts) + private void SetDistributionListPermissionsInternal(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists) { ExchangeLog.LogStart("SetDistributionListPermissionsInternal"); @@ -3964,6 +3956,9 @@ namespace WebsitePanel.Providers.HostedSolution SetSendAsPermissions(runspace, distributionList.SendAsAccounts, cn, sendAsAccounts); SetDistributionListSendOnBehalfAccounts(runspace, accountName, sendOnBehalfAccounts); + if (addressLists.Length > 0) + FixShowInAddressBook(runspace, accountName, addressLists); + } catch (Exception ex) { @@ -4760,7 +4755,7 @@ namespace WebsitePanel.Providers.HostedSolution return resultObjectDN; } - private string CreateAddressList(Runspace runSpace, string organizationId) + internal string CreateAddressList(Runspace runSpace, string organizationId) { ExchangeLog.LogStart("CreateAddressList"); string addressListName = this.GetAddressListName(organizationId); @@ -4812,7 +4807,60 @@ namespace WebsitePanel.Providers.HostedSolution return addressListDN; } - private void UpdateAddressList(Runspace runSpace, string id, string securityGroup) + internal string CreateRoomsAddressList(Runspace runSpace, string organizationId) + { + ExchangeLog.LogStart("CreateRoomList"); + string addressListName = this.GetRoomsAddressListName(organizationId); + string addressListDN = this.GetAddressListDN(runSpace, addressListName); + if (!string.IsNullOrEmpty(addressListDN)) + { + //address list already exists - we will use it + ExchangeLog.LogWarning("Room List '{0}' already exists", new object[] { addressListName }); + } + else + { + //try to create a new address list (10 attempts) + int attempts = 0; + Command cmd = null; + Collection result = null; + + while (true) + { + try + { + //try to create address list + cmd = new Command("New-AddressList"); + cmd.Parameters.Add("Name", addressListName); + cmd.Parameters.Add("IncludedRecipients", "Resources"); + cmd.Parameters.Add("ConditionalCustomAttribute1", organizationId); + + result = ExecuteShellCommand(runSpace, cmd); + addressListDN = CheckResultObjectDN(result); + } + catch (Exception ex) + { + ExchangeLog.LogError(ex); + } + if (addressListDN != null) + break; + + if (attempts > 9) + throw new Exception( + string.Format("Could not create Room List '{0}' ", addressListName)); + + attempts++; + ExchangeLog.LogWarning("Attempt #{0} to create room list failed!", attempts); + // wait 1 sec + System.Threading.Thread.Sleep(1000); + } + } + + ExchangeLog.LogEnd("CreateRoomList"); + return addressListDN; + } + + + internal void UpdateAddressList(Runspace runSpace, string id, string securityGroup) { ExchangeLog.LogStart("UpdateAddressList"); @@ -4826,7 +4874,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("UpdateAddressList"); } - private void DeleteAddressList(Runspace runSpace, string id) + internal void DeleteAddressList(Runspace runSpace, string id) { ExchangeLog.LogStart("DeleteAddressList"); Command cmd = new Command("Remove-AddressList"); @@ -4836,116 +4884,33 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("DeleteAddressList"); } - private string GetRoomsAddressListDN(Runspace runSpace, string id) + + internal virtual void DeleteAddressBookPolicy(Runspace runSpace, string id) { - ExchangeLog.LogStart("GetRoomsAddressListDN"); + ExchangeLog.LogStart("DeleteAddressBookPolicy"); + ExchangeLog.LogEnd("DeleteAddressBookPolicy"); + } + + + + internal string GetGlobalAddressListDN(Runspace runSpace, string id) + { + ExchangeLog.LogStart("GetGlobalAddressListDN"); string resultObjectDN = null; - Command cmd = new Command("Get-AddressList"); + Command cmd = new Command("Get-GlobalAddressList"); cmd.Parameters.Add("Identity", id); Collection result = this.ExecuteShellCommand(runSpace, cmd); if ((result != null) && (result.Count > 0)) { resultObjectDN = this.GetResultObjectDN(result); - ExchangeLog.DebugInfo("RAL DN: {0}", new object[] { resultObjectDN }); + ExchangeLog.DebugInfo("GAL DN: {0}", new object[] { resultObjectDN }); } - ExchangeLog.DebugInfo("GetRommsAddressListDN, cmd = {0}", cmd.CommandText); - ExchangeLog.LogEnd("GetRoomsAddressListDN"); + ExchangeLog.LogEnd("GetGlobalAddressListDN"); return resultObjectDN; } - private string CreateRoomsAddressList(Runspace runSpace, string organizationId) - { - ExchangeLog.LogStart("CreateRoomsAddressList"); - string roomsAddressListName = this.GetRoomsAddressListName(organizationId); - string roomsAddressListDN = this.GetRoomsAddressListDN(runSpace, roomsAddressListName); - if (!string.IsNullOrEmpty(roomsAddressListDN)) - { - //rooms address list already exists - we will use it - ExchangeLog.LogWarning("Rooms Address List '{0}' already exists", new object[] { roomsAddressListName }); - } - else - { - //try to create a new rooms address list (10 attempts) - int attempts = 0; - Command cmd = null; - Collection result = null; - while (true) - { - try - { - //try to create address list - cmd = new Command("New-AddressList"); - cmd.Parameters.Add("Name", roomsAddressListName); - cmd.Parameters.Add("IncludedRecipients", "Resources"); - cmd.Parameters.Add("ConditionalCustomAttribute1", organizationId); - - result = ExecuteShellCommand(runSpace, cmd); - roomsAddressListDN = CheckResultObjectDN(result); - } - catch (Exception ex) - { - ExchangeLog.LogError(ex); - } - if (roomsAddressListDN != null) - break; - - if (attempts > 9) - throw new Exception( - string.Format("Could not create Rooms Address List '{0}' cmd = '{1}'", roomsAddressListName, cmd)); - - attempts++; - ExchangeLog.LogWarning("Attempt #{0} to create rooms address list failed!", attempts); - // wait 1 sec - System.Threading.Thread.Sleep(1000); - } - } - - ExchangeLog.LogEnd("CreateRoomsAddressList"); - return roomsAddressListDN; - } - - private void UpdateRoomsAddressList(Runspace runSpace, string id, string securityGroup) - { - ExchangeLog.LogStart("UpdateRoomsAddressList"); - - string path = AddADPrefix(id); - Command cmd = new Command("Update-AddressList"); - cmd.Parameters.Add("Identity", id); - ExecuteShellCommand(runSpace, cmd); - - AdjustADSecurity(path, securityGroup, false); - - ExchangeLog.LogEnd("UpdateRoomsAddressList"); - } - - private void DeleteRoomsAddressList(Runspace runSpace, string id) - { - ExchangeLog.LogStart("DeleteRoomsAddressList"); - Command cmd = new Command("Remove-AddressList"); - cmd.Parameters.Add("Identity", id); - cmd.Parameters.Add("Confirm", false); - ExecuteShellCommand(runSpace, cmd); - ExchangeLog.LogEnd("DeleteRoomsAddressList"); - } - - private string GetGlobalAddressListDN(Runspace runSpace, string id) - { - ExchangeLog.LogStart("GetGlobalAddressListDN"); - string resultObjectDN = null; - Command cmd = new Command("Get-GlobalAddressList"); - cmd.Parameters.Add("Identity", id); - Collection result = this.ExecuteShellCommand(runSpace, cmd); - if ((result != null) && (result.Count > 0)) - { - resultObjectDN = this.GetResultObjectDN(result); - ExchangeLog.DebugInfo("GAL DN: {0}", new object[] { resultObjectDN }); - } - ExchangeLog.LogEnd("GetGlobalAddressListDN"); - return resultObjectDN; - } - - private string CreateGlobalAddressList(Runspace runSpace, string organizationId) + internal string CreateGlobalAddressList(Runspace runSpace, string organizationId) { ExchangeLog.LogStart("CreateGlobalAddressList"); @@ -4962,7 +4927,7 @@ namespace WebsitePanel.Providers.HostedSolution return id; } - private void UpdateGlobalAddressList(Runspace runSpace, string id, string securityGroup) + internal void UpdateGlobalAddressList(Runspace runSpace, string id, string securityGroup) { ExchangeLog.LogStart("UpdateGlobalAddressList"); @@ -4977,7 +4942,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("UpdateGlobalAddressList"); } - private void DeleteGlobalAddressList(Runspace runSpace, string id) + internal void DeleteGlobalAddressList(Runspace runSpace, string id) { ExchangeLog.LogStart("DeleteGlobalAddressList"); Command cmd = new Command("Remove-GlobalAddressList"); @@ -4989,44 +4954,39 @@ namespace WebsitePanel.Providers.HostedSolution private string CreateOfflineAddressBook(Runspace runSpace, string organizationId, string server, string oabVirtualDirs) { - ExchangeLog.LogStart("CreateOfflineAddressBook"); + ExchangeLog.LogStart("CreateOfflineAddressBook"); - string oabName = GetOfflineAddressBookName(organizationId); + string oabName = GetOfflineAddressBookName(organizationId); + string addressListName = GetAddressListName(organizationId); - bool enableSP2abp = false; - if (ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP] != null) - enableSP2abp = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP]); - Version exchangeVersion = GetExchangeVersion(); - string addressListName; - if (enableSP2abp && (exchangeVersion >= new Version(14, 2))) - { - // Ex2010SP2 with ABP support, want to use GAL for OAB - addressListName = GetGlobalAddressListName(organizationId); - } - else - { - // Ex2007 or Ex2010 without ABP support, have to use AL for OAB - addressListName = GetAddressListName(organizationId); - } + Command cmd = new Command("New-OfflineAddressBook"); + cmd.Parameters.Add("Name", oabName); + cmd.Parameters.Add("Server", server); + cmd.Parameters.Add("AddressLists", addressListName); + cmd.Parameters.Add("PublicFolderDistributionEnabled", PublicFolderDistributionEnabled); + cmd.Parameters.Add("IsDefault", false); - Command cmd = new Command("New-OfflineAddressBook"); - cmd.Parameters.Add("Name", oabName); - cmd.Parameters.Add("Server", server); - cmd.Parameters.Add("AddressLists", addressListName); - cmd.Parameters.Add("PublicFolderDistributionEnabled", true); - cmd.Parameters.Add("IsDefault", false); - if (!string.IsNullOrEmpty(oabVirtualDirs)) - { - cmd.Parameters.Add("VirtualDirectories", oabVirtualDirs); - } - Collection result = ExecuteShellCommand(runSpace, cmd); - string id = GetResultObjectDN(result); + //TODO: fix web distribution + if (!string.IsNullOrEmpty(oabVirtualDirs)) + { + ArrayList virtualDirs = new ArrayList(); + string[] strTmp = oabVirtualDirs.Split(','); + foreach (string s in strTmp) + { + virtualDirs.Add(s); + } - ExchangeLog.LogEnd("CreateOfflineAddressBook"); + cmd.Parameters.Add("VirtualDirectories", (String[])virtualDirs.ToArray(typeof(string))); + } - return id; - } + Collection result = ExecuteShellCommand(runSpace, cmd); + string id = GetResultObjectDN(result); + + ExchangeLog.LogEnd("CreateOfflineAddressBook"); + + return id; + } private void UpdateOfflineAddressBook(Runspace runSpace, string id, string securityGroup) { @@ -5044,7 +5004,7 @@ namespace WebsitePanel.Providers.HostedSolution } - private void DeleteOfflineAddressBook(Runspace runSpace, string id) + internal void DeleteOfflineAddressBook(Runspace runSpace, string id) { ExchangeLog.LogStart("DeleteOfflineAddressBook"); Command cmd = new Command("Remove-OfflineAddressBook"); @@ -5054,31 +5014,6 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("DeleteOfflineAddressBook"); } - private string CreateAddressPolicy(Runspace runSpace, string organizationId) - { - ExchangeLog.LogStart("CreateAddressPolicy"); - - string ABP = GetAddressPolicyName(organizationId); - string AL = GetAddressListName(organizationId); - string GAL = GetGlobalAddressListName(organizationId); - string OAB = GetOfflineAddressBookName(organizationId); - string RL = GetRoomsAddressListName(organizationId); - - Command cmd = new Command("New-AddressBookPolicy"); - cmd.Parameters.Add("Name", ABP); - cmd.Parameters.Add("GlobalAddressList", GAL); - cmd.Parameters.Add("OfflineAddressBook", OAB); - cmd.Parameters.Add("AddressLists", AL); - cmd.Parameters.Add("RoomList", RL); - - - Collection result = ExecuteShellCommand(runSpace, cmd); - string id = GetResultObjectDN(result); - - ExchangeLog.LogEnd("CreateAddressPolicy"); - return id; - } - private void DeleteAddressPolicy(Runspace runSpace, string id) { ExchangeLog.LogStart("DeleteAddressPolicy"); @@ -5094,7 +5029,7 @@ namespace WebsitePanel.Providers.HostedSolution return orgName + " Address List"; } - private string GetGlobalAddressListName(string orgName) + internal string GetGlobalAddressListName(string orgName) { return orgName + " Global Address List"; } @@ -5103,7 +5038,8 @@ namespace WebsitePanel.Providers.HostedSolution { return orgName + " Offline Address Book"; } - private string GetAddressPolicyName(string orgName) + + internal string GetAddressBookPolicyName(string orgName) { return orgName + " Address Policy"; } @@ -5162,7 +5098,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("DeleteADObject"); } - private DirectoryEntry GetRootOU() + private DirectoryEntry GetRootOU() { ExchangeLog.LogStart("GetRootOU"); StringBuilder sb = new StringBuilder(); @@ -5177,7 +5113,7 @@ namespace WebsitePanel.Providers.HostedSolution return de; } - private void SetADObjectProperty(DirectoryEntry oDE, string name, string value) + private void SetADObjectProperty(DirectoryEntry oDE, string name, string value) { if (!string.IsNullOrEmpty(value)) { @@ -5192,14 +5128,14 @@ namespace WebsitePanel.Providers.HostedSolution } } - private void SetADObjectPropertyValue(DirectoryEntry oDE, string name, string value) + internal void SetADObjectPropertyValue(DirectoryEntry oDE, string name, string value) { PropertyValueCollection collection = oDE.Properties[name]; collection.Value = value; } - private void AddADObjectProperty(DirectoryEntry oDE, string name, string value) + internal void AddADObjectProperty(DirectoryEntry oDE, string name, string value) { if (!string.IsNullOrEmpty(value)) { @@ -5208,7 +5144,7 @@ namespace WebsitePanel.Providers.HostedSolution } } - private DirectoryEntry GetADObject(string path) + internal DirectoryEntry GetADObject(string path) { DirectoryEntry de = null; if (path.StartsWith("LDAP://" + PrimaryDomainController + "/", true, CultureInfo.InvariantCulture)) @@ -5226,7 +5162,7 @@ namespace WebsitePanel.Providers.HostedSolution return de; } - private object GetADObjectProperty(DirectoryEntry entry, string name) + internal object GetADObjectProperty(DirectoryEntry entry, string name) { if (entry.Properties.Contains(name)) return entry.Properties[name][0]; @@ -5234,6 +5170,18 @@ namespace WebsitePanel.Providers.HostedSolution return String.Empty; } + + private string GetOrganizationPath(string organizationId) + { + StringBuilder sb = new StringBuilder(); + // append provider + AppendOUPath(sb, organizationId); + AppendOUPath(sb, RootOU); + AppendDomainPath(sb, RootDomain); + + return sb.ToString(); + } + private void AppendProtocol(StringBuilder sb) { sb.Append("LDAP://"); @@ -5270,7 +5218,7 @@ namespace WebsitePanel.Providers.HostedSolution } } - private string AddADPrefix(string path) + internal string AddADPrefix(string path) { string dn = path; if (!dn.ToUpper().StartsWith("LDAP://")) @@ -5296,7 +5244,7 @@ namespace WebsitePanel.Providers.HostedSolution return dn; } - private string ConvertADPathToCanonicalName(string name) + internal string ConvertADPathToCanonicalName(string name) { if (string.IsNullOrEmpty(name)) @@ -5355,7 +5303,7 @@ namespace WebsitePanel.Providers.HostedSolution } - private void AdjustADSecurity(string objPath, string securityGroupPath, bool isAddressBook) + internal virtual void AdjustADSecurity(string objPath, string securityGroupPath, bool isAddressBook) { ExchangeLog.LogStart("AdjustADSecurity"); ExchangeLog.DebugInfo(" Active Direcory object: {0}", objPath); @@ -5487,7 +5435,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("AddGlobalUPNSuffix"); }*/ - private string GetNETBIOSDomainName() + internal string GetNETBIOSDomainName() { ExchangeLog.LogStart("GetNETBIOSDomainName"); string ret = string.Empty; @@ -6026,7 +5974,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("CreateOrganizationActiveSyncPolicyInternal"); } - private string CreateActiveSyncPolicy(Runspace runSpace, string organizationId) + internal string CreateActiveSyncPolicy(Runspace runSpace, string organizationId) { ExchangeLog.LogStart("CreateActiveSyncPolicy"); Command cmd = new Command("New-ActiveSyncMailboxPolicy"); @@ -6039,7 +5987,7 @@ namespace WebsitePanel.Providers.HostedSolution return id; } - private void DeleteActiveSyncPolicy(Runspace runSpace, string id) + internal void DeleteActiveSyncPolicy(Runspace runSpace, string id) { ExchangeLog.LogStart("DeleteActiveSyncPolicy"); Command cmd = new Command("Remove-ActiveSyncMailboxPolicy"); @@ -6175,35 +6123,43 @@ namespace WebsitePanel.Providers.HostedSolution private ExchangeMobileDevice[] GetMobileDevicesInternal(string accountName) { - ExchangeLog.LogStart("GetMobileDevicesInternal"); - ExchangeLog.DebugInfo("Account name: {0}", accountName); + ExchangeLog.LogStart("GetMobileDevicesInternal"); + ExchangeLog.DebugInfo("Account name: {0}", accountName); - List devices = new List(); - ExchangeMobileDevice device = null; + List devices = new List(); + ExchangeMobileDevice device = null; - Runspace runSpace = null; - try - { - runSpace = OpenRunspace(); - Command cmd = new Command("Get-ActiveSyncDeviceStatistics"); - cmd.Parameters.Add("Mailbox", accountName); - Collection result = ExecuteShellCommand(runSpace, cmd); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + Command cmd = new Command("Get-ActiveSyncDeviceStatistics"); + cmd.Parameters.Add("Mailbox", accountName); - if (result != null) - { - foreach (PSObject obj in result) - { - device = GetMobileDeviceObject(obj); - devices.Add(device); - } - } - } - finally - { - CloseRunspace(runSpace); - } - ExchangeLog.LogEnd("GetMobileDevicesInternal"); - return devices.ToArray(); + Collection result = null; + try + { + result = ExecuteShellCommand(runSpace, cmd); + } + catch (Exception) + { + } + + if (result != null) + { + foreach (PSObject obj in result) + { + device = GetMobileDeviceObject(obj); + devices.Add(device); + } + } + } + finally + { + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("GetMobileDevicesInternal"); + return devices.ToArray(); } private ExchangeMobileDevice GetMobileDeviceObject(PSObject obj) @@ -6616,7 +6572,7 @@ namespace WebsitePanel.Providers.HostedSolution return ret; } - private string GetServerName() + internal string GetServerName() { string ret = null; if (!string.IsNullOrEmpty(MailboxCluster)) @@ -6659,12 +6615,12 @@ namespace WebsitePanel.Providers.HostedSolution #region Transactions - private ExchangeTransaction StartTransaction() + internal ExchangeTransaction StartTransaction() { return new ExchangeTransaction(); } - private void RollbackTransaction(ExchangeTransaction transaction) + internal void RollbackTransaction(ExchangeTransaction transaction) { ExchangeLog.LogStart("RollbackTransaction"); Runspace runSpace = null; @@ -6703,58 +6659,61 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogInfo("Rollback action: {0}", action.ActionType); switch (action.ActionType) { - case TransactionAction.TransactionActionTypes.CreateOrganizationUnit: - DeleteADObject(action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateDistributionGroup: - RemoveDistributionGroup(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.EnableDistributionGroup: - DisableMailSecurityDistributionGroup(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateGlobalAddressList: - DeleteGlobalAddressList(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateAddressList: - DeleteAddressList(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateRoomsAddressList: - DeleteRoomsAddressList(runspace, action.Id); + case TransactionAction.TransactionActionTypes.CreateOrganizationUnit: + DeleteADObject(action.Id); break; - case TransactionAction.TransactionActionTypes.CreateOfflineAddressBook: - DeleteOfflineAddressBook(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateActiveSyncPolicy: - DeleteActiveSyncPolicy(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateAcceptedDomain: - RemoveAcceptedDomain(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.AddUPNSuffix: - RemoveUPNSuffix(action.Id, action.Suffix); - break; - case TransactionAction.TransactionActionTypes.CreateMailbox: - RemoveMailbox(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateContact: - RemoveContact(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreatePublicFolder: - RemovePublicFolder(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.AddMailboxFullAccessPermission: - RemoveMailboxAccessPermission(runspace, action.Account, action.Id, "FullAccess"); - break; - case TransactionAction.TransactionActionTypes.AddSendAsPermission: - RemoveADPermission(runspace, action.Account, action.Id, null, "Send-as", null); - break; - case TransactionAction.TransactionActionTypes.RemoveMailboxFullAccessPermission: - SetMailboxPermission(runspace, action.Account, action.Id, "FullAccess"); - break; - case TransactionAction.TransactionActionTypes.RemoveSendAsPermission: - SetExtendedRights(runspace, action.Account, action.Id, "Send-as"); - break; - } + case TransactionAction.TransactionActionTypes.CreateDistributionGroup: + RemoveDistributionGroup(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.EnableDistributionGroup: + DisableMailSecurityDistributionGroup(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateGlobalAddressList: + DeleteGlobalAddressList(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateAddressList: + DeleteAddressList(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateAddressBookPolicy: + DeleteAddressBookPolicy(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateOfflineAddressBook: + DeleteOfflineAddressBook(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateActiveSyncPolicy: + DeleteActiveSyncPolicy(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateAcceptedDomain: + RemoveAcceptedDomain(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.AddUPNSuffix: + RemoveUPNSuffix(action.Id, action.Suffix); + break; + case TransactionAction.TransactionActionTypes.CreateMailbox: + RemoveMailbox(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.EnableMailbox: + DisableMailbox(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateContact: + RemoveContact(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreatePublicFolder: + RemovePublicFolder(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.AddMailboxFullAccessPermission: + RemoveMailboxAccessPermission(runspace, action.Account, action.Id, "FullAccess"); + break; + case TransactionAction.TransactionActionTypes.AddSendAsPermission: + RemoveADPermission(runspace, action.Account, action.Id, null, "Send-as", null); + break; + case TransactionAction.TransactionActionTypes.RemoveMailboxFullAccessPermission: + SetMailboxPermission(runspace, action.Account, action.Id, "FullAccess"); + break; + case TransactionAction.TransactionActionTypes.RemoveSendAsPermission: + SetExtendedRights(runspace, action.Account, action.Id, "Send-as"); + break; + } } #endregion } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs index 63c46ed2..fdb674cf 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs @@ -167,7 +167,7 @@ namespace WebsitePanel.Providers.HostedSolution return runspace; } - private static Assembly ResolveExchangeAssembly(object p, ResolveEventArgs args) + internal static Assembly ResolveExchangeAssembly(object p, ResolveEventArgs args) { //Add path for the Exchange 2007 DLLs if (args.Name.Contains("Microsoft.Exchange")) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs new file mode 100644 index 00000000..e2b16d4f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs @@ -0,0 +1,753 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.IO; +using System.Configuration; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; +using System.Reflection; +using System.Globalization; +using System.Collections; + +using System.DirectoryServices; +using System.Security; +using System.Security.Principal; +using System.Security.AccessControl; + +using System.Management.Automation; +using System.Management.Automation.Runspaces; + +using WebsitePanel.Providers; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.Utils; +using WebsitePanel.Server.Utils; +using Microsoft.Exchange.Data.Directory.Recipient; +using Microsoft.Win32; + +using Microsoft.Exchange.Data; +using Microsoft.Exchange.Data.Directory; +using Microsoft.Exchange.Data.Storage; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class Exchange2010SP2 : Exchange2010 + { + #region Static constructor + + static private Hashtable htBbalancer = new Hashtable(); + + static Exchange2010SP2() + { + AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(ResolveExchangeAssembly); + ExchangeRegistryPath = "SOFTWARE\\Microsoft\\ExchangeServer\\v14\\Setup"; + } + #endregion + + + #region Organization + /// + /// Creates organization on Mail Server + /// + /// + /// + internal override Organization ExtendToExchangeOrganizationInternal(string organizationId, string securityGroup, bool IsConsumer) + { + ExchangeLog.LogStart("CreateOrganizationInternal"); + ExchangeLog.DebugInfo(" Organization Id: {0}", organizationId); + + ExchangeTransaction transaction = StartTransaction(); + Organization info = new Organization(); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + string server = GetServerName(); + string securityGroupPath = AddADPrefix(securityGroup); + + //Create mail enabled organization security group + EnableMailSecurityDistributionGroup(runSpace, securityGroup, organizationId); + transaction.RegisterMailEnabledDistributionGroup(securityGroup); + UpdateSecurityDistributionGroup(runSpace, securityGroup, organizationId, IsConsumer); + + //create GAL + string galId = CreateGlobalAddressList(runSpace, organizationId); + transaction.RegisterNewGlobalAddressList(galId); + ExchangeLog.LogInfo(" Global Address List: {0}", galId); + UpdateGlobalAddressList(runSpace, galId, securityGroupPath); + + //create AL + string alId = CreateAddressList(runSpace, organizationId); + transaction.RegisterNewAddressList(alId); + ExchangeLog.LogInfo(" Address List: {0}", alId); + UpdateAddressList(runSpace, alId, securityGroupPath); + + //create RAL + string ralId = CreateRoomsAddressList(runSpace, organizationId); + transaction.RegisterNewRoomsAddressList(ralId); + ExchangeLog.LogInfo(" Rooms Address List: {0}", ralId); + UpdateAddressList(runSpace, ralId, securityGroupPath); + + //create ActiveSync policy + string asId = CreateActiveSyncPolicy(runSpace, organizationId); + transaction.RegisterNewActiveSyncPolicy(asId); + ExchangeLog.LogInfo(" ActiveSync Policy: {0}", asId); + + info.AddressList = alId; + info.GlobalAddressList = galId; + info.RoomsAddressList = ralId; + info.OrganizationId = organizationId; + } + catch (Exception ex) + { + ExchangeLog.LogError("CreateOrganizationInternal", ex); + RollbackTransaction(transaction); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("CreateOrganizationInternal"); + return info; + } + + + internal override Organization CreateOrganizationAddressBookPolicyInternal(string organizationId, string gal, string addressBook, string roomList, string oab) + { + ExchangeLog.LogStart("CreateOrganizationAddressBookPolicyInternal"); + ExchangeLog.LogInfo(" Organization Id: {0}", organizationId); + ExchangeLog.LogInfo(" GAL: {0}", gal); + ExchangeLog.LogInfo(" AddressBook: {0}", addressBook); + ExchangeLog.LogInfo(" RoomList: {0}", roomList); + ExchangeLog.LogInfo(" OAB: {0}", oab); + + ExchangeTransaction transaction = StartTransaction(); + + Organization info = new Organization(); + string policyName = GetAddressBookPolicyName(organizationId); + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + Command cmd = new Command("New-AddressBookPolicy"); + cmd.Parameters.Add("Name", policyName); + cmd.Parameters.Add("AddressLists", addressBook); + cmd.Parameters.Add("RoomList", roomList); + cmd.Parameters.Add("GlobalAddressList", gal); + cmd.Parameters.Add("OfflineAddressBook", oab); + + Collection result = ExecuteShellCommand(runSpace, cmd); + info.AddressBookPolicy = GetResultObjectDN(result); + + } + catch (Exception ex) + { + ExchangeLog.LogError("CreateOrganizationAddressBookPolicyInternal", ex); + RollbackTransaction(transaction); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("CreateOrganizationAddressBookPolicyInternal"); + return info; + } + + internal override bool DeleteOrganizationInternal(string organizationId, string distinguishedName, + string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy) + { + ExchangeLog.LogStart("DeleteOrganizationInternal"); + bool ret = true; + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + + string ou = ConvertADPathToCanonicalName(distinguishedName); + + if (!DeleteOrganizationMailboxes(runSpace, ou)) + ret = false; + + if (!DeleteOrganizationContacts(runSpace, ou)) + ret = false; + + if (!DeleteOrganizationDistributionLists(runSpace, ou)) + ret = false; + + //delete AddressBookPolicy + try + { + if (!string.IsNullOrEmpty(addressBookPolicy)) + DeleteAddressBookPolicy(runSpace, addressBookPolicy); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not delete AddressBook Policy " + addressBookPolicy, ex); + } + + //delete OAB + try + { + if (!string.IsNullOrEmpty(offlineAddressBook)) + DeleteOfflineAddressBook(runSpace, offlineAddressBook); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not delete Offline Address Book " + offlineAddressBook, ex); + } + + //delete AL + try + { + if (!string.IsNullOrEmpty(addressList)) + DeleteAddressList(runSpace, addressList); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not delete Address List " + addressList, ex); + } + + //delete RL + try + { + if (!string.IsNullOrEmpty(roomList)) + DeleteAddressList(runSpace, roomList); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not delete Address List " + roomList, ex); + } + + + //delete GAL + try + { + if (!string.IsNullOrEmpty(globalAddressList)) + DeleteGlobalAddressList(runSpace, globalAddressList); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not delete Global Address List " + globalAddressList, ex); + } + + //delete ActiveSync policy + try + { + DeleteActiveSyncPolicy(runSpace, organizationId); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not delete ActiveSyncPolicy " + organizationId, ex); + } + + //disable mail security distribution group + try + { + DisableMailSecurityDistributionGroup(runSpace, securityGroup); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not disable mail security distribution group " + securityGroup, ex); + } + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("DeleteOrganizationInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("DeleteOrganizationInternal"); + return ret; + } + + internal override void DeleteAddressBookPolicy(Runspace runSpace, string id) + { + ExchangeLog.LogStart("DeleteAddressBookPolicy"); + //if (id != "IsConsumer") + //{ + Command cmd = new Command("Remove-AddressBookPolicy"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("Confirm", false); + ExecuteShellCommand(runSpace, cmd); + //} + ExchangeLog.LogEnd("DeleteAddressBookPolicy"); + } + + #endregion + + #region Mailbox + internal override string CreateMailEnableUserInternal(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, + string mailboxDatabase, string offlineAddressBook, string addressBookPolicy, + string accountName, bool enablePOP, bool enableIMAP, + bool enableOWA, bool enableMAPI, bool enableActiveSync, + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, + int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook, bool IsConsumer) + { + + ExchangeLog.LogStart("CreateMailEnableUserInternal"); + ExchangeLog.DebugInfo("Organization Id: {0}", organizationId); + + string ret = null; + ExchangeTransaction transaction = StartTransaction(); + Runspace runSpace = null; + + int attempts = 0; + string id = null; + + try + { + runSpace = OpenRunspace(); + Command cmd = null; + Collection result = null; + + //try to enable mail user for 10 times + while (true) + { + try + { + //create mailbox + cmd = new Command("Enable-Mailbox"); + cmd.Parameters.Add("Identity", upn); + cmd.Parameters.Add("Alias", accountName); + string database = GetDatabase(runSpace, PrimaryDomainController, mailboxDatabase); + ExchangeLog.DebugInfo("database: " + database); + if (database != string.Empty) + { + cmd.Parameters.Add("Database", database); + } + if (accountType == ExchangeAccountType.Equipment) + cmd.Parameters.Add("Equipment"); + else if (accountType == ExchangeAccountType.Room) + cmd.Parameters.Add("Room"); + + result = ExecuteShellCommand(runSpace, cmd); + + id = CheckResultObjectDN(result); + } + catch (Exception ex) + { + ExchangeLog.LogError(ex); + } + if (id != null) + break; + + if (attempts > 9) + throw new Exception( + string.Format("Could not enable mail user '{0}' ", upn)); + + attempts++; + ExchangeLog.LogWarning("Attempt #{0} to enable mail user failed!", attempts); + // wait 5 sec + System.Threading.Thread.Sleep(1000); + } + + transaction.RegisterEnableMailbox(id); + + string windowsEmailAddress = ObjToString(GetPSObjectProperty(result[0], "WindowsEmailAddress")); + + //update mailbox + cmd = new Command("Set-Mailbox"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("OfflineAddressBook", offlineAddressBook); + cmd.Parameters.Add("EmailAddressPolicyEnabled", false); + cmd.Parameters.Add("CustomAttribute1", organizationId); + cmd.Parameters.Add("CustomAttribute3", windowsEmailAddress); + cmd.Parameters.Add("PrimarySmtpAddress", upn); + cmd.Parameters.Add("WindowsEmailAddress", upn); + + cmd.Parameters.Add("UseDatabaseQuotaDefaults", new bool?(false)); + cmd.Parameters.Add("UseDatabaseRetentionDefaults", false); + cmd.Parameters.Add("IssueWarningQuota", ConvertKBToUnlimited(issueWarningKB)); + cmd.Parameters.Add("ProhibitSendQuota", ConvertKBToUnlimited(prohibitSendKB)); + cmd.Parameters.Add("ProhibitSendReceiveQuota", ConvertKBToUnlimited(prohibitSendReceiveKB)); + cmd.Parameters.Add("RetainDeletedItemsFor", ConvertDaysToEnhancedTimeSpan(keepDeletedItemsDays)); + cmd.Parameters.Add("RecipientLimits", ConvertInt32ToUnlimited(maxRecipients)); + cmd.Parameters.Add("MaxSendSize", ConvertKBToUnlimited(maxSendMessageSizeKB)); + cmd.Parameters.Add("MaxReceiveSize", ConvertKBToUnlimited(maxReceiveMessageSizeKB)); + if (IsConsumer) cmd.Parameters.Add("HiddenFromAddressListsEnabled", true); + else + cmd.Parameters.Add("HiddenFromAddressListsEnabled", hideFromAddressBook); + cmd.Parameters.Add("AddressBookPolicy", addressBookPolicy); + ExecuteShellCommand(runSpace, cmd); + + //Client Access + cmd = new Command("Set-CASMailbox"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("ActiveSyncEnabled", enableActiveSync); + if (enableActiveSync) + { + cmd.Parameters.Add("ActiveSyncMailboxPolicy", organizationId); + } + cmd.Parameters.Add("OWAEnabled", enableOWA); + cmd.Parameters.Add("MAPIEnabled", enableMAPI); + cmd.Parameters.Add("PopEnabled", enablePOP); + cmd.Parameters.Add("ImapEnabled", enableIMAP); + ExecuteShellCommand(runSpace, cmd); + + //add to the security group + cmd = new Command("Add-DistributionGroupMember"); + cmd.Parameters.Add("Identity", organizationId); + cmd.Parameters.Add("Member", id); + cmd.Parameters.Add("BypassSecurityGroupManagerCheck", true); + ExecuteShellCommand(runSpace, cmd); + + if (!IsConsumer) + { + //Set-MailboxFolderPermission for calendar + cmd = new Command("Add-MailboxFolderPermission"); + cmd.Parameters.Add("Identity", id + ":\\calendar"); + cmd.Parameters.Add("AccessRights", "Reviewer"); + cmd.Parameters.Add("User", organizationId); + ExecuteShellCommand(runSpace, cmd); + } + cmd = new Command("Set-MailboxFolderPermission"); + cmd.Parameters.Add("Identity", id + ":\\calendar"); + cmd.Parameters.Add("AccessRights", "None"); + cmd.Parameters.Add("User", "Default"); + ExecuteShellCommand(runSpace, cmd); + + ret = string.Format("{0}\\{1}", GetNETBIOSDomainName(), accountName); + ExchangeLog.LogEnd("CreateMailEnableUserInternal"); + return ret; + } + catch (Exception ex) + { + ExchangeLog.LogError("CreateMailEnableUserInternal", ex); + RollbackTransaction(transaction); + throw; + } + finally + { + CloseRunspace(runSpace); + } + } + + + internal override void DisableMailboxInternal(string id) + { + ExchangeLog.LogStart("DisableMailboxInternal"); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-Mailbox"); + cmd.Parameters.Add("Identity", id); + Collection result = ExecuteShellCommand(runSpace, cmd); + + if (result != null && result.Count > 0) + { + string upn = ObjToString(GetPSObjectProperty(result[0], "UserPrincipalName")); + + string addressbookPolicy = ObjToString(GetPSObjectProperty(result[0], "AddressBookPolicy")); + + cmd = new Command("Disable-Mailbox"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("Confirm", false); + ExecuteShellCommand(runSpace, cmd); + + if (addressbookPolicy == (upn + " AP")) + { + try + { + DeleteAddressBookPolicy(runSpace, upn + " AP"); + } + catch (Exception) + { + } + + try + { + DeleteGlobalAddressList(runSpace, upn + " GAL"); + } + catch (Exception) + { + } + + try + { + DeleteAddressList(runSpace, upn + " AL"); + } + catch (Exception) + { + } + } + + + } + + } + + finally + { + + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("DisableMailboxInternal"); + } + + + internal override void DeleteMailboxInternal(string accountName) + { + ExchangeLog.LogStart("DeleteMailboxInternal"); + ExchangeLog.DebugInfo("Account Name: {0}", accountName); + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-Mailbox"); + cmd.Parameters.Add("Identity", accountName); + Collection result = ExecuteShellCommand(runSpace, cmd); + + if (result != null && result.Count > 0) + { + string upn = ObjToString(GetPSObjectProperty(result[0], "UserPrincipalName")); + string addressbookPolicy = ObjToString(GetPSObjectProperty(result[0], "AddressBookPolicy")); + + RemoveMailbox(runSpace, accountName); + + if (addressbookPolicy == (upn + " AP")) + { + try + { + DeleteAddressBookPolicy(runSpace, upn + " AP"); + } + catch (Exception) + { + } + + try + { + DeleteGlobalAddressList(runSpace, upn + " GAL"); + } + catch (Exception) + { + } + + try + { + DeleteAddressList(runSpace, upn + " AL"); + } + catch (Exception) + { + } + } + } + + + } + finally + { + + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("DeleteMailboxInternal"); + } + + + internal string GetDatabase(Runspace runSpace, string primaryDomainController, string dagName) + { + string database = string.Empty; + + if (string.IsNullOrEmpty(dagName)) return string.Empty; + + ExchangeLog.LogStart("GetDatabase"); + ExchangeLog.LogInfo("DAG: " + dagName); + + //Get Dag Servers + Collection dags = null; + Command cmd = new Command("Get-DatabaseAvailabilityGroup"); + cmd.Parameters.Add("Identity", dagName); + dags = ExecuteShellCommand(runSpace, cmd); + + if (htBbalancer == null) + htBbalancer = new Hashtable(); + + if (htBbalancer[dagName] == null) + htBbalancer.Add(dagName, 0); + + if (dags != null && dags.Count > 0) + { + + ADMultiValuedProperty servers = (ADMultiValuedProperty)GetPSObjectProperty(dags[0], "Servers"); + + if (servers != null) + { + System.Collections.Generic.List lstDatabase = new System.Collections.Generic.List(); + + foreach (object objServer in servers) + { + Collection databases = null; + cmd = new Command("Get-MailboxDatabase"); + cmd.Parameters.Add("Server", ObjToString(objServer)); + databases = ExecuteShellCommand(runSpace, cmd); + + foreach (PSObject objDatabase in databases) + { + if (((bool)GetPSObjectProperty(objDatabase, "IsExcludedFromProvisioning") == false) && + ((bool)GetPSObjectProperty(objDatabase, "IsSuspendedFromProvisioning") == false)) + { + string db = ObjToString(GetPSObjectProperty(objDatabase, "Identity")); + + bool bAdd = true; + foreach (string s in lstDatabase) + { + if (s.ToLower() == db.ToLower()) + { + bAdd = false; + break; + } + } + + if (bAdd) + { + lstDatabase.Add(db); + ExchangeLog.LogInfo("AddDatabase: " + db); + } + } + } + } + + int balancer = (int)htBbalancer[dagName]; + balancer++; + if (balancer >= lstDatabase.Count) balancer = 0; + htBbalancer[dagName] = balancer; + if (lstDatabase.Count != 0) database = lstDatabase[balancer]; + + } + } + + ExchangeLog.LogEnd("GetDatabase"); + return database; + } + + + #endregion + + #region AddressBook + internal override void AdjustADSecurity(string objPath, string securityGroupPath, bool isAddressBook) + { + ExchangeLog.LogStart("AdjustADSecurity"); + ExchangeLog.DebugInfo(" Active Direcory object: {0}", objPath); + ExchangeLog.DebugInfo(" Security Group: {0}", securityGroupPath); + + if (isAddressBook) + { + ExchangeLog.DebugInfo(" Updating Security"); + //"Download Address Book" security permission for offline address book + Guid openAddressBookGuid = new Guid("{bd919c7c-2d79-4950-bc9c-e16fd99285e8}"); + + DirectoryEntry groupEntry = GetADObject(securityGroupPath); + byte[] byteSid = (byte[])GetADObjectProperty(groupEntry, "objectSid"); + + DirectoryEntry objEntry = GetADObject(objPath); + ActiveDirectorySecurity security = objEntry.ObjectSecurity; + + // Create a SecurityIdentifier object for security group. + SecurityIdentifier groupSid = new SecurityIdentifier(byteSid, 0); + + // Create an access rule to allow users in Security Group to open address book. + ActiveDirectoryAccessRule allowOpenAddressBook = + new ActiveDirectoryAccessRule( + groupSid, + ActiveDirectoryRights.ExtendedRight, + AccessControlType.Allow, + openAddressBookGuid); + + // Create an access rule to allow users in Security Group to read object. + ActiveDirectoryAccessRule allowRead = + new ActiveDirectoryAccessRule( + groupSid, + ActiveDirectoryRights.GenericRead, + AccessControlType.Allow); + + // Remove existing rules if exist + security.RemoveAccessRuleSpecific(allowOpenAddressBook); + security.RemoveAccessRuleSpecific(allowRead); + + // Add a new access rule to allow users in Security Group to open address book. + security.AddAccessRule(allowOpenAddressBook); + // Add a new access rule to allow users in Security Group to read object. + security.AddAccessRule(allowRead); + + // Commit the changes. + objEntry.CommitChanges(); + } + + ExchangeLog.LogEnd("AdjustADSecurity"); + } + + + #endregion + + + + public override bool IsInstalled() + { + int value = 0; + bool bResult = false; + RegistryKey root = Registry.LocalMachine; + RegistryKey rk = root.OpenSubKey(ExchangeRegistryPath); + if (rk != null) + { + value = (int)rk.GetValue("MsiProductMajor", null); + if (value == 14) + { + value = (int)rk.GetValue("MsiProductMinor", null); + if (value == 2) bResult = true; + } + rk.Close(); + } + return bResult; + } + } +} + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeLog.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeLog.cs index 5472863c..aa965e8f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeLog.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeLog.cs @@ -33,71 +33,67 @@ using WebsitePanel.Server.Utils; namespace WebsitePanel.Providers.HostedSolution { - /// - /// Exchange Log Helper Methods - /// - internal class ExchangeLog - { - internal static string LogPrefix = "Exchange"; + /// + /// Exchange Log Helper Methods + /// + internal class ExchangeLog + { + internal static string LogPrefix = "Exchange"; - internal static void LogStart(string message, params object[] args) - { - string text = String.Format(message, args); - Log.WriteStart("{0} {1}", LogPrefix, text); - } + internal static void LogStart(string message, params object[] args) + { + string text = String.Format(message, args); + Log.WriteStart("{0} {1}", LogPrefix, text); + } - internal static void LogEnd(string message, params object[] args) - { - string text = String.Format(message, args); - Log.WriteEnd("{0} {1}", LogPrefix, text); - } + internal static void LogEnd(string message, params object[] args) + { + string text = String.Format(message, args); + Log.WriteEnd("{0} {1}", LogPrefix, text); + } - internal static void LogInfo(string message, params object[] args) - { - string text = String.Format(message, args); - Log.WriteInfo("{0} {1}", LogPrefix, text); - } + internal static void LogInfo(string message, params object[] args) + { + string text = String.Format(message, args); + Log.WriteInfo("{0} {1}", LogPrefix, text); + } - internal static void LogWarning(string message, params object[] args) - { - string text = String.Format(message, args); - Log.WriteWarning("{0} {1}", LogPrefix, text); - } + internal static void LogWarning(string message, params object[] args) + { + string text = String.Format(message, args); + Log.WriteWarning("{0} {1}", LogPrefix, text); + } - internal static void LogError(Exception ex) - { - Log.WriteError(LogPrefix, ex); - } + internal static void LogError(Exception ex) + { + Log.WriteError(LogPrefix, ex); + } - internal static void LogError(string message, Exception ex) - { - string text = String.Format("{0} {1}", LogPrefix, message); - Log.WriteError(text, ex); - } + internal static void LogError(string message, Exception ex) + { + string text = String.Format("{0} {1}", LogPrefix, message); + Log.WriteError(text, ex); + } - internal static void DebugInfo(string message, params object[] args) - { -#if DEBUG - string text = String.Format(message, args); - Log.WriteInfo("{0} {1}", LogPrefix, text); -#endif - } + internal static void DebugInfo(string message, params object[] args) + { + string text = String.Format(message, args); + Log.WriteInfo("{0} {1}", LogPrefix, text); + } - internal static void DebugCommand(Command cmd) - { -#if DEBUG - StringBuilder sb = new StringBuilder(cmd.CommandText); - foreach (CommandParameter parameter in cmd.Parameters) - { - string formatString = " -{0} {1}"; - if (parameter.Value is string) - formatString = " -{0} '{1}'"; - else if (parameter.Value is bool) - formatString = " -{0} ${1}"; - sb.AppendFormat(formatString, parameter.Name, parameter.Value); - } - Log.WriteInfo("{0} {1}", LogPrefix, sb.ToString()); -#endif - } - } + internal static void DebugCommand(Command cmd) + { + StringBuilder sb = new StringBuilder(cmd.CommandText); + foreach (CommandParameter parameter in cmd.Parameters) + { + string formatString = " -{0} {1}"; + if (parameter.Value is string) + formatString = " -{0} '{1}'"; + else if (parameter.Value is bool) + formatString = " -{0} ${1}"; + sb.AppendFormat(formatString, parameter.Name, parameter.Value); + } + Log.WriteInfo("{0} {1}", LogPrefix, sb.ToString()); + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeTransaction.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeTransaction.cs index 0af4bb65..1d6e0eba 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeTransaction.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeTransaction.cs @@ -30,228 +30,180 @@ using System.Collections.Generic; namespace WebsitePanel.Providers.HostedSolution { - internal class ExchangeTransaction - { - List actions = null; + internal class ExchangeTransaction + { + List actions = null; - public ExchangeTransaction() - { - actions = new List(); - } + public ExchangeTransaction() + { + actions = new List(); + } - internal List Actions - { - get { return actions; } - } + internal List Actions + { + get { return actions; } + } - internal void RegisterNewOrganizationUnit(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateOrganizationUnit; - action.Id = id; - Actions.Add(action); - } + internal void RegisterNewOrganizationUnit(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateOrganizationUnit; + action.Id = id; + Actions.Add(action); + } - public void RegisterNewDistributionGroup(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateDistributionGroup; - action.Id = id; - Actions.Add(action); - } + public void RegisterNewDistributionGroup(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateDistributionGroup; + action.Id = id; + Actions.Add(action); + } - public void RegisterMailEnabledDistributionGroup(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.EnableDistributionGroup; - action.Id = id; - Actions.Add(action); - } + public void RegisterMailEnabledDistributionGroup(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.EnableDistributionGroup; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewGlobalAddressList(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateGlobalAddressList; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewAddressList(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateAddressList; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewAddressBookPolicy(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateAddressBookPolicy; + action.Id = id; + Actions.Add(action); + } - internal void RegisterNewGlobalAddressList(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateGlobalAddressList; - action.Id = id; - Actions.Add(action); - } - internal void RegisterNewAddressList(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateAddressList; - action.Id = id; - Actions.Add(action); - } internal void RegisterNewRoomsAddressList(string id) { TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateRoomsAddressList; + action.ActionType = TransactionAction.TransactionActionTypes.CreateAddressList; action.Id = id; Actions.Add(action); } - internal void RegisterNewAddressPolicy(string id) + + + internal void RegisterNewOfflineAddressBook(string id) { TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateAddressPolicy; + action.ActionType = TransactionAction.TransactionActionTypes.CreateOfflineAddressBook; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewActiveSyncPolicy(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateActiveSyncPolicy; action.Id = id; Actions.Add(action); } - internal void RegisterNewOfflineAddressBook(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateOfflineAddressBook; - action.Id = id; - Actions.Add(action); - } + internal void RegisterNewAcceptedDomain(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateAcceptedDomain; + action.Id = id; + Actions.Add(action); + } - internal void RegisterNewActiveSyncPolicy(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateActiveSyncPolicy; - action.Id = id; - Actions.Add(action); - } + internal void RegisterNewUPNSuffix(string id, string suffix) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.AddUPNSuffix; + action.Id = id; + action.Suffix = suffix; + Actions.Add(action); + } + + internal void RegisterNewMailbox(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateMailbox; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterEnableMailbox(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.EnableMailbox; + action.Id = id; + Actions.Add(action); + } - internal void RegisterNewAcceptedDomain(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateAcceptedDomain; - action.Id = id; - Actions.Add(action); - } + internal void RegisterNewContact(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateContact; + action.Id = id; + Actions.Add(action); + } - internal void RegisterNewUPNSuffix(string id, string suffix) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.AddUPNSuffix; - action.Id = id; - action.Suffix = suffix; - Actions.Add(action); - } + internal void RegisterNewPublicFolder(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreatePublicFolder; + action.Id = id; + Actions.Add(action); + } - internal void RegisterNewMailbox(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateMailbox; - action.Id = id; - Actions.Add(action); - } + internal void AddMailBoxFullAccessPermission(string accountName, string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.AddMailboxFullAccessPermission; + action.Id = id; + action.Account = accountName; + Actions.Add(action); + } - internal void RegisterNewContact(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateContact; - action.Id = id; - Actions.Add(action); - } - - internal void RegisterNewPublicFolder(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreatePublicFolder; - action.Id = id; - Actions.Add(action); - } - - internal void AddMailBoxFullAccessPermission(string accountName, string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.AddMailboxFullAccessPermission; - action.Id = id; - action.Account = accountName; - Actions.Add(action); - } - - internal void AddSendAsPermission(string accountName, string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.AddSendAsPermission; - action.Id = id; - action.Account = accountName; - Actions.Add(action); - } - - internal void RemoveMailboxFullAccessPermission(string accountName, string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.RemoveMailboxFullAccessPermission; - action.Id = id; - action.Account = accountName; - Actions.Add(action); - } - - internal void RemoveSendAsPermission(string accountName, string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.RemoveSendAsPermission; - action.Id = id; - action.Account = accountName; - Actions.Add(action); - } - } - - internal class TransactionAction - { - private TransactionActionTypes actionType; - - public TransactionActionTypes ActionType - { - get { return actionType; } - set { actionType = value; } - } - - private string id; - - public string Id - { - get { return id; } - set { id = value; } - } - - private string suffix; - - public string Suffix - { - get { return suffix; } - set { suffix = value; } - } - - private string account; - - public string Account - { - get { return account; } - set { account = value; } - - } - - internal enum TransactionActionTypes - { - CreateOrganizationUnit, - CreateGlobalAddressList, - CreateAddressList, - CreateAddressPolicy, - CreateOfflineAddressBook, - CreateDistributionGroup, - EnableDistributionGroup, - CreateAcceptedDomain, - AddUPNSuffix, - CreateMailbox, - CreateContact, - CreatePublicFolder, - CreateActiveSyncPolicy, - AddMailboxFullAccessPermission, - AddSendAsPermission, - RemoveMailboxFullAccessPermission, - RemoveSendAsPermission, - CreateRoomsAddressList - }; - } + internal void AddSendAsPermission(string accountName, string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.AddSendAsPermission; + action.Id = id; + action.Account = accountName; + Actions.Add(action); + } + internal void RemoveMailboxFullAccessPermission(string accountName, string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.RemoveMailboxFullAccessPermission; + action.Id = id; + action.Account = accountName; + Actions.Add(action); + } + internal void RemoveSendAsPermission(string accountName, string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.RemoveSendAsPermission; + action.Id = id; + action.Account = accountName; + Actions.Add(action); + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs new file mode 100644 index 00000000..21887292 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs @@ -0,0 +1,1248 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.IO; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; +using System.Reflection; +using System.Globalization; +using System.DirectoryServices; + +using Microsoft.Win32; + +using WebsitePanel.Providers; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.Utils; +using WebsitePanel.Server.Utils; + +using System.Management; +using System.Management.Automation; +using System.Management.Automation.Runspaces; + +using Microsoft.Rtc.Management.Hosted; +using Microsoft.Rtc.Management.WritableConfig.Settings.Edge; +using Microsoft.Rtc.Management.WritableConfig.Settings.SimpleUrl; + + +namespace WebsitePanel.Providers.HostedSolution +{ + public class Lync2010 : HostingServiceProviderBase, ILyncServer + { + + #region Static constructor + static Lync2010() + { + LyncRegistryPath = "SOFTWARE\\Microsoft\\Real-Time Communications"; + } + + internal static string LyncRegistryPath + { + get; + set; + } + + #endregion + + + #region Properties + + /// + /// Pool FQDN + /// + private string PoolFQDN + { + get { return ProviderSettings[LyncConstants.PoolFQDN]; } + } + + private string SimpleUrlRoot + { + get { return ProviderSettings[LyncConstants.SimpleUrlRoot]; } + } + + internal string PrimaryDomainController + { + get { return ProviderSettings["PrimaryDomainController"]; } + } + + private string RootOU + { + get { return ProviderSettings["RootOU"]; } + } + + private string RootDomain + { + get { return ServerSettings.ADRootDomain; } + } + + + #endregion + + #region ILyncServer implementation + + public string CreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) + { + return CreateOrganizationInternal(organizationId, sipDomain, enableConferencing, enableConferencingVideo, maxConferenceSize, enabledFederation, enabledEnterpriseVoice); + } + + public bool DeleteOrganization(string organizationId, string sipDomain) + { + return DeleteOrganizationInternal(organizationId, sipDomain); + } + + public bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan) + { + return CreateUserInternal(organizationId, userUpn, plan); + } + + public LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn) + { + return GetLyncUserGeneralSettingsInternal(organizationId, userUpn); + } + + public bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) + { + return SetLyncUserPlanInternal(organizationId, userUpn, plan, null); + } + + public bool DeleteUser(string userUpn) + { + return DeleteUserInternal(userUpn); + } + + public LyncFederationDomain[] GetFederationDomains(string organizationId) + { + return GetFederationDomainsInternal(organizationId); + } + + public bool AddFederationDomain(string organizationId, string domainName, string proxyFqdn) + { + return AddFederationDomainInternal(organizationId, domainName, proxyFqdn); + } + + public bool RemoveFederationDomain(string organizationId, string domainName) + { + return RemoveFederationDomainInternal(organizationId, domainName); + } + + public void ReloadConfiguration() + { + ReloadConfigurationInternal(); + } + + #endregion + + #region organization + private string CreateOrganizationInternal(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) + { + HostedSolutionLog.LogStart("CreateOrganizationInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("sipDomain: {0}", sipDomain); + + string TenantId = string.Empty; + + LyncTransaction transaction = StartTransaction(); + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + // create sip domain + Command cmd = new Command("New-CsSipDomain"); + cmd.Parameters.Add("Identity", sipDomain); + ExecuteShellCommand(runSpace, cmd, false); + + transaction.RegisterNewSipDomain(sipDomain); + + //set the msRTCSIP-Domains, TenantID, ObjectID + Guid id = Guid.NewGuid(); + + string path = AddADPrefix(GetOrganizationPath(organizationId)); + DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path); + ActiveDirectoryUtils.SetADObjectPropertyValue(ou, "msRTCSIP-Domains", sipDomain); + ActiveDirectoryUtils.SetADObjectPropertyValue(ou, "msRTCSIP-TenantId", id); + ActiveDirectoryUtils.SetADObjectPropertyValue(ou, "msRTCSIP-ObjectId", id); + ou.CommitChanges(); + + //Create simpleurls + CreateSimpleUrl(runSpace, sipDomain, id); + transaction.RegisterNewSimpleUrl(sipDomain, id.ToString()); + + //create conferencing policy + cmd = new Command("New-CsConferencingPolicy"); + cmd.Parameters.Add("Identity", organizationId); + cmd.Parameters.Add("MaxMeetingSize", maxConferenceSize); + cmd.Parameters.Add("AllowIPVideo", enableConferencingVideo); + ExecuteShellCommand(runSpace, cmd, false); + transaction.RegisterNewConferencingPolicy(organizationId); + + //create external access policy + cmd = new Command("New-CsExternalAccessPolicy"); + cmd.Parameters.Add("Identity", organizationId); + cmd.Parameters.Add("EnableFederationAccess", true); + cmd.Parameters.Add("EnableOutsideAccess", true); + cmd.Parameters.Add("EnablePublicCloudAccess", false); + cmd.Parameters.Add("EnablePublicCloudAudioVideoAccess", false); + ExecuteShellCommand(runSpace, cmd, false); + transaction.RegisterNewCsExternalAccessPolicy(organizationId); + + //Enable for federation + AllowList allowList = new AllowList(); + DomainPattern domain = new DomainPattern(sipDomain); + allowList.AllowedDomain.Add(domain); + + cmd = new Command("Set-CsTenantFederationConfiguration"); + cmd.Parameters.Add("Tenant", id); + cmd.Parameters.Add("AllowFederatedUsers", true); + cmd.Parameters.Add("AllowedDomains", allowList); + ExecuteShellCommand(runSpace, cmd, false); + + //create mobility policy + cmd = new Command("New-CsMobilityPolicy"); + cmd.Parameters.Add("Identity", organizationId + " EnableOutSideVoice"); + cmd.Parameters.Add("EnableMobility", true); + cmd.Parameters.Add("EnableOutsideVoice", true); + ExecuteShellCommand(runSpace, cmd, false); + transaction.RegisterNewCsMobilityPolicy(organizationId + " EnableOutSideVoice"); + + cmd = new Command("New-CsMobilityPolicy"); + cmd.Parameters.Add("Identity", organizationId + " DisableOutSideVoice"); + cmd.Parameters.Add("EnableMobility", true); + cmd.Parameters.Add("EnableOutsideVoice", false); + ExecuteShellCommand(runSpace, cmd, false); + transaction.RegisterNewCsMobilityPolicy(organizationId + " DisableOutSideVoice"); + + cmd = new Command("Invoke-CsManagementStoreReplication"); + ExecuteShellCommand(runSpace, cmd, false); + + + TenantId = id.ToString(); + } + catch (Exception ex) + { + HostedSolutionLog.LogError("CreateOrganizationInternal", ex); + RollbackTransaction(transaction); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + + HostedSolutionLog.LogEnd("CreateOrganizationInternal"); + + return TenantId; + } + + + + private bool DeleteOrganizationInternal(string organizationId, string sipDomain) + { + HostedSolutionLog.LogStart("DeleteOrganizationInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("sipDomain: {0}", sipDomain); + + bool ret = true; + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-CsTenant"); + cmd.Parameters.Add("Identity", GetOrganizationPath(organizationId)); + Collection result = ExecuteShellCommand(runSpace, cmd, false); + if ((result != null) && (result.Count > 0)) + { + Guid tenantId = (Guid)GetPSObjectProperty(result[0], "TenantId"); + + // create sip domain + DeleteSipDomain(runSpace, sipDomain); + + //clear the msRTCSIP-Domains, TenantID, ObjectID + string path = AddADPrefix(GetOrganizationPath(organizationId)); + DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path); + ActiveDirectoryUtils.ClearADObjectPropertyValue(ou, "msRTCSIP-Domains"); + ActiveDirectoryUtils.ClearADObjectPropertyValue(ou, "msRTCSIP-TenantId"); + ActiveDirectoryUtils.ClearADObjectPropertyValue(ou, "msRTCSIP-ObjectId"); + ou.CommitChanges(); + + try + { + DeleteConferencingPolicy(runSpace, organizationId); + } + catch (Exception) + { + } + + try + { + DeleteExternalAccessPolicy(runSpace, organizationId); + } + catch (Exception) + { + } + + try + { + DeleteMobilityPolicy(runSpace, organizationId + " EnableOutSideVoice"); + } + catch (Exception) + { + } + + try + { + DeleteMobilityPolicy(runSpace, organizationId + " DisableOutSideVoice"); + } + catch (Exception) + { + } + + try + { + DeleteSimpleUrl(runSpace, sipDomain, tenantId); + } + catch (Exception) + { + } + } + + cmd = new Command("Invoke-CsManagementStoreReplication"); + ExecuteShellCommand(runSpace, cmd, false); + + } + catch (Exception ex) + { + ret = false; + HostedSolutionLog.LogError("DeleteOrganizationInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("DeleteOrganizationInternal"); + return ret; + } + #endregion + + #region Users + private bool CreateUserInternal(string organizationId, string userUpn, LyncUserPlan plan) + { + HostedSolutionLog.LogStart("CreateUserInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn); + + bool ret = true; + Guid tenantId = Guid.Empty; + + LyncTransaction transaction = StartTransaction(); + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-CsTenant"); + cmd.Parameters.Add("Identity", GetOrganizationPath(organizationId)); + Collection result = ExecuteShellCommand(runSpace, cmd, false); + if ((result != null) && (result.Count > 0)) + { + tenantId = (Guid)GetPSObjectProperty(result[0], "TenantId"); + + //enable for lync + cmd = new Command("Enable-CsUser"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("RegistrarPool", PoolFQDN); + cmd.Parameters.Add("SipAddressType", "UserPrincipalName"); + ExecuteShellCommand(runSpace, cmd); + + transaction.RegisterNewCsUser(userUpn); + + //set groupingID and tenantID + cmd = new Command("Get-CsAdUser"); + cmd.Parameters.Add("Identity", userUpn); + result = ExecuteShellCommand(runSpace, cmd); + + + string path = AddADPrefix(GetResultObjectDN(result)); + DirectoryEntry user = ActiveDirectoryUtils.GetADObject(path); + ActiveDirectoryUtils.SetADObjectPropertyValue(user, "msRTCSIP-GroupingID", tenantId); + ActiveDirectoryUtils.SetADObjectPropertyValue(user, "msRTCSIP-TenantId", tenantId); + + string[] tmp = userUpn.Split('@'); + if (tmp.Length > 0) + { + string Url = SimpleUrlRoot + tmp[1]; + ActiveDirectoryUtils.SetADObjectPropertyValue(user, "msRTCSIP-BaseSimpleUrl", Url); + } + user.CommitChanges(); + + //set-plan + SetLyncUserPlanInternal(organizationId, userUpn, plan, runSpace); + + //initiate addressbook generation + cmd = new Command("Update-CsAddressBook"); + ExecuteShellCommand(runSpace, cmd, false); + + //initiate user database replication + cmd = new Command("Update-CsUserDatabase"); + ExecuteShellCommand(runSpace, cmd, false); + } + else + { + ret = false; + HostedSolutionLog.LogError("Failed to retrieve tenantID", null); + } + } + catch (Exception ex) + { + ret = false; + HostedSolutionLog.LogError("CreateUserInternal", ex); + RollbackTransaction(transaction); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("CreateUserInternal"); + return ret; + } + + private LyncUser GetLyncUserGeneralSettingsInternal(string organizationId, string userUpn) + { + HostedSolutionLog.LogStart("GetLyncUserGeneralSettingsInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn); + + LyncUser lyncUser = new LyncUser(); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-CsUser"); + cmd.Parameters.Add("Identity", userUpn); + Collection result = ExecuteShellCommand(runSpace, cmd); + PSObject user = result[0]; + + lyncUser.DisplayName = (string)GetPSObjectProperty(user, "DisplayName"); + lyncUser.PrimaryUri = (string)GetPSObjectProperty(user, "SipAddress"); + lyncUser.LineUri = (string)GetPSObjectProperty(user, "LineURI"); + } + catch (Exception ex) + { + HostedSolutionLog.LogError("GetLyncUserGeneralSettingsInternal", ex); + throw; + } + finally + { + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("GetLyncUserGeneralSettingsInternal"); + return lyncUser; + } + + + private bool SetLyncUserPlanInternal(string organizationId, string userUpn, LyncUserPlan plan, Runspace runSpace) + { + HostedSolutionLog.LogStart("SetLyncUserPlanInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn); + bool ret = true; + bool bCloseRunSpace = false; + + try + { + if (runSpace == null) + { + runSpace = OpenRunspace(); + bCloseRunSpace = true; + } + + //CsExternalAccessPolicy + Command cmd = new Command("Grant-CsExternalAccessPolicy"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("PolicyName", plan.Federation ? organizationId : null); + ExecuteShellCommand(runSpace, cmd); + + //CsConferencingPolicy + cmd = new Command("Grant-CsConferencingPolicy"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("PolicyName", plan.Federation ? organizationId : null); + ExecuteShellCommand(runSpace, cmd); + + //CsMobilityPolicy + cmd = new Command("Grant-CsMobilityPolicy"); + cmd.Parameters.Add("Identity", userUpn); + if (plan.Mobility) + cmd.Parameters.Add("PolicyName", plan.MobilityEnableOutsideVoice ? organizationId + " EnableOutSideVoice" : organizationId + " DisableOutSideVoice"); + else + cmd.Parameters.Add("PolicyName", null); + ExecuteShellCommand(runSpace, cmd); + + //initiate user database replication + cmd = new Command("Update-CsUserDatabase"); + ExecuteShellCommand(runSpace, cmd, false); + } + catch (Exception ex) + { + ret = false; + HostedSolutionLog.LogError("SetLyncUserPlanInternal", ex); + throw; + } + finally + { + + if (bCloseRunSpace) CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("SetLyncUserPlanInternal"); + return ret; + } + + + private bool DeleteUserInternal(string userUpn) + { + HostedSolutionLog.LogStart("DeleteUserInternal"); + HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn); + + bool ret = true; + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + //Delete User + DeleteUser(runSpace, userUpn); + + //Clear groupingID and tenantID + Command cmd = new Command("Get-CsAdUser"); + cmd.Parameters.Add("Identity", userUpn); + Collection result = ExecuteShellCommand(runSpace, cmd); + + string path = AddADPrefix(GetResultObjectDN(result)); + DirectoryEntry user = ActiveDirectoryUtils.GetADObject(path); + ActiveDirectoryUtils.ClearADObjectPropertyValue(user, "msRTCSIP-GroupingID"); + ActiveDirectoryUtils.ClearADObjectPropertyValue(user, "msRTCSIP-TenantId"); + ActiveDirectoryUtils.ClearADObjectPropertyValue(user, "msRTCSIP-BaseSimpleUrl"); + user.CommitChanges(); + + //initiate addressbook generation + cmd = new Command("Update-CsAddressBook"); + ExecuteShellCommand(runSpace, cmd, false); + + //initiate user database replication + cmd = new Command("Update-CsUserDatabase"); + ExecuteShellCommand(runSpace, cmd, false); + } + catch (Exception ex) + { + ret = false; + HostedSolutionLog.LogError("DeleteUserInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("DeleteUserInternal"); + return ret; + } + + internal void DeleteUser(Runspace runSpace, string userUpn) + { + HostedSolutionLog.LogStart("DeleteUser"); + HostedSolutionLog.DebugInfo("userUpn : {0}", userUpn); + Command cmd = new Command("Disable-CsUser"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("Confirm", false); + ExecuteShellCommand(runSpace, cmd, false); + HostedSolutionLog.LogEnd("DeleteUser"); + } + + #endregion + + #region SipDomains + internal void DeleteSipDomain(Runspace runSpace, string id) + { + HostedSolutionLog.LogStart("DeleteSipDomain"); + HostedSolutionLog.DebugInfo("SipDomain : {0}", id); + Command cmd = new Command("Remove-CsSipDomain"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("Confirm", false); + cmd.Parameters.Add("Force", true); + ExecuteShellCommand(runSpace, cmd, false); + HostedSolutionLog.LogEnd("DeleteSipDomain"); + } + + private void CreateSimpleUrl(Runspace runSpace, string sipDomain, Guid id) + { + //Create the simpleUrlEntry + Command cmd = new Command("Get-CsSipDomain"); + Collection sipDomains = ExecuteShellCommand(runSpace, cmd, false); + + IList SimpleUrls = new List(); + + + foreach (PSObject domain in sipDomains) + { + string d = (string)GetPSObjectProperty(domain, "Name"); + string Url = SimpleUrlRoot + d; + + + //Create the simpleUrlEntry + cmd = new Command("New-CsSimpleUrlEntry"); + cmd.Parameters.Add("Url", Url); + Collection simpleUrlEntry = ExecuteShellCommand(runSpace, cmd, false); + + //Create the simpleUrl + cmd = new Command("New-CsSimpleUrl"); + cmd.Parameters.Add("Component", "meet"); + cmd.Parameters.Add("Domain", d); + cmd.Parameters.Add("SimpleUrl", simpleUrlEntry[0]); + cmd.Parameters.Add("ActiveUrl", Url); + Collection simpleUrl = ExecuteShellCommand(runSpace, cmd, false); + + SimpleUrls.Add(simpleUrl[0]); + } + + Hashtable properties = new Hashtable(); + properties.Add("Add", SimpleUrls); + + //PSListModifier + cmd = new Command("Set-CsSimpleUrlConfiguration"); + cmd.Parameters.Add("Identity", "Global"); + cmd.Parameters.Add("Tenant", id); + cmd.Parameters.Add("SimpleUrl", SimpleUrls); + ExecuteShellCommand(runSpace, cmd, false); + } + + + internal void DeleteSimpleUrl(Runspace runSpace, string sipDomain, Guid id) + { + /* + //build the url + string Url = SimpleUrlRoot + sipDomain; + + //Create the simpleUrlEntry + Command cmd = new Command("New-CsSimpleUrlEntry"); + cmd.Parameters.Add("Url", Url); + Collection simpleUrlEntry = ExecuteShellCommand(runSpace, cmd, false); + + //Create the simpleUrl + cmd = new Command("New-CsSimpleUrl"); + cmd.Parameters.Add("Component", "meet"); + cmd.Parameters.Add("Domain", sipDomain); + cmd.Parameters.Add("SimpleUrl", simpleUrlEntry[0]); + cmd.Parameters.Add("ActiveUrl", Url); + Collection simpleUrl = ExecuteShellCommand(runSpace, cmd, false); + + //PSListModifier + + Hashtable properties = new Hashtable(); + properties.Add("Remove", simpleUrl[0]); + + cmd = new Command("Set-CsSimpleUrlConfiguration"); + cmd.Parameters.Add("Identity", "Global"); + cmd.Parameters.Add("Tenant", id); + cmd.Parameters.Add("SimpleUrl", properties); + ExecuteShellCommand(runSpace, cmd, false); + */ + } + + + #endregion + + #region Policies + + internal void DeleteConferencingPolicy(Runspace runSpace, string policyName) + { + HostedSolutionLog.LogStart("DeleteConferencingPolicy"); + HostedSolutionLog.DebugInfo("policyName : {0}", policyName); + Command cmd = new Command("Remove-CsConferencingPolicy"); + cmd.Parameters.Add("Identity", policyName); + cmd.Parameters.Add("Confirm", false); + cmd.Parameters.Add("Force", true); + ExecuteShellCommand(runSpace, cmd, false); + HostedSolutionLog.LogEnd("DeleteConferencingPolicy"); + } + + internal void DeleteExternalAccessPolicy(Runspace runSpace, string policyName) + { + HostedSolutionLog.LogStart("DeleteExternalAccessPolicy"); + HostedSolutionLog.DebugInfo("policyName : {0}", policyName); + Command cmd = new Command("Remove-CsExternalAccessPolicy"); + cmd.Parameters.Add("Identity", policyName); + cmd.Parameters.Add("Confirm", false); + cmd.Parameters.Add("Force", true); + ExecuteShellCommand(runSpace, cmd, false); + HostedSolutionLog.LogEnd("DeleteExternalAccessPolicy"); + } + + internal void DeleteMobilityPolicy(Runspace runSpace, string policyName) + { + HostedSolutionLog.LogStart("DeleteMobilityPolicy"); + HostedSolutionLog.DebugInfo("policyName : {0}", policyName); + Command cmd = new Command("Remove-CsMobilityPolicy"); + cmd.Parameters.Add("Identity", policyName); + cmd.Parameters.Add("Confirm", false); + cmd.Parameters.Add("Force", true); + ExecuteShellCommand(runSpace, cmd, false); + HostedSolutionLog.LogEnd("DeleteMobilityPolicy"); + } + + #endregion + + #region Sytsem Related Methods + private void ReloadConfigurationInternal() + { + HostedSolutionLog.LogStart("ReloadConfigurationInternal"); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Enable-CsComputer"); + ExecuteShellCommand(runSpace, cmd, false); + } + catch (Exception ex) + { + HostedSolutionLog.LogError("ReloadConfigurationInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("ReloadConfigurationInternal"); + } + + + #endregion + + #region Federation Domains + private LyncFederationDomain[] GetFederationDomainsInternal(string organizationId) + { + + HostedSolutionLog.LogStart("GetFederationDomainsInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + + + LyncFederationDomain[] domains = null; + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Guid tenantId = Guid.Empty; + + domains = GetFederationDomainsInternal(runSpace, organizationId, ref tenantId); + + } + catch (Exception ex) + { + HostedSolutionLog.LogError("GetFederationDomainsInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("GetFederationDomainsInternal"); + + return domains; + } + + private LyncFederationDomain[] GetFederationDomainsInternal(Runspace runSpace, string organizationId, ref Guid tenantId) + { + //Get TenantID + List domains = null; + Command cmd = new Command("Get-CsTenant"); + cmd.Parameters.Add("Identity", GetOrganizationPath(organizationId)); + Collection result = ExecuteShellCommand(runSpace, cmd, false); + if ((result != null) && (result.Count > 0)) + { + tenantId = (Guid)GetPSObjectProperty(result[0], "TenantId"); + + //Get-CSTenantFederationConfiguration (AllowedDomains) + cmd = new Command("Get-CsTenantFederationConfiguration"); + cmd.Parameters.Add("Tenant", tenantId); + result = ExecuteShellCommand(runSpace, cmd, false); + + if ((result != null) && (result.Count > 0)) + { + domains = new List(); + + if (GetPSObjectProperty(result[0], "AllowedDomains").GetType().ToString() == "Microsoft.Rtc.Management.WritableConfig.Settings.Edge.AllowList") + { + AllowList allowList = (AllowList)GetPSObjectProperty(result[0], "AllowedDomains"); + + foreach (DomainPattern d in allowList.AllowedDomain) + { + LyncFederationDomain domain = new LyncFederationDomain(); + domain.DomainName = d.Domain.ToString(); + domains.Add(domain); + } + } + } + } + + if (domains != null) + return domains.ToArray(); + else + return null; + } + + + private bool AddFederationDomainInternal(string organizationId, string domainName, string proxyFqdn) + { + HostedSolutionLog.LogStart("AddFederationDomainInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("domainName: {0}", domainName); + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Guid tenantId = Guid.Empty; + Command cmd = new Command("Get-CsTenant"); + cmd.Parameters.Add("Identity", GetOrganizationPath(organizationId)); + Collection result = ExecuteShellCommand(runSpace, cmd, false); + if ((result != null) && (result.Count > 0)) + { + tenantId = (Guid)GetPSObjectProperty(result[0], "TenantId"); + + //Get-CSTenantFederationConfiguration (AllowedDomains) + cmd = new Command("Get-CsTenantFederationConfiguration"); + cmd.Parameters.Add("Tenant", tenantId); + result = ExecuteShellCommand(runSpace, cmd, false); + + if ((result != null) && (result.Count > 0)) + { + AllowList allowList = null; + + if (GetPSObjectProperty(result[0], "AllowedDomains").GetType().ToString() == "Microsoft.Rtc.Management.WritableConfig.Settings.Edge.AllowList") + { + allowList = (AllowList)GetPSObjectProperty(result[0], "AllowedDomains"); + DomainPattern domain = new DomainPattern(domainName); + allowList.AllowedDomain.Add(domain); + } + else + { + allowList = new AllowList(); + DomainPattern domain = new DomainPattern(domainName); + allowList.AllowedDomain.Add(domain); + } + + cmd = new Command("Set-CsTenantFederationConfiguration"); + cmd.Parameters.Add("Tenant", tenantId); + cmd.Parameters.Add("AllowedDomains", allowList); + ExecuteShellCommand(runSpace, cmd, false); + } + } + } + catch (Exception ex) + { + HostedSolutionLog.LogError("AddFederationDomainInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("AddFederationDomainInternal"); + + return true; + } + + private bool RemoveFederationDomainInternal(string organizationId, string domainName) + { + HostedSolutionLog.LogStart("RemoveFederationDomainInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("domainName: {0}", domainName); + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Guid tenantId = Guid.Empty; + Command cmd = new Command("Get-CsTenant"); + cmd.Parameters.Add("Identity", GetOrganizationPath(organizationId)); + Collection result = ExecuteShellCommand(runSpace, cmd, false); + if ((result != null) && (result.Count > 0)) + { + tenantId = (Guid)GetPSObjectProperty(result[0], "TenantId"); + + //Get-CSTenantFederationConfiguration (AllowedDomains) + cmd = new Command("Get-CsTenantFederationConfiguration"); + cmd.Parameters.Add("Tenant", tenantId); + result = ExecuteShellCommand(runSpace, cmd, false); + + if ((result != null) && (result.Count > 0)) + { + AllowList allowList = null; + + if (GetPSObjectProperty(result[0], "AllowedDomains").GetType().ToString() == "Microsoft.Rtc.Management.WritableConfig.Settings.Edge.AllowList") + { + allowList = (AllowList)GetPSObjectProperty(result[0], "AllowedDomains"); + DomainPattern domain = new DomainPattern(domainName); + allowList.AllowedDomain.Remove(domain); + } + + cmd = new Command("Set-CsTenantFederationConfiguration"); + cmd.Parameters.Add("Tenant", tenantId); + cmd.Parameters.Add("AllowedDomains", allowList); + ExecuteShellCommand(runSpace, cmd, false); + } + } + } + catch (Exception ex) + { + HostedSolutionLog.LogError("RemoveFederationDomainInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("RemoveFederationDomainInternal"); + + return true; + } + + + + + #endregion + + #region PowerShell integration + private static InitialSessionState session = null; + + internal virtual Runspace OpenRunspace() + { + HostedSolutionLog.LogStart("OpenRunspace"); + + if (session == null) + { + session = InitialSessionState.CreateDefault(); + session.ImportPSModule(new string[] { "ActiveDirectory", "Lync", "LyncOnline" }); + } + Runspace runSpace = RunspaceFactory.CreateRunspace(session); + // + runSpace.Open(); + // + runSpace.SessionStateProxy.SetVariable("ConfirmPreference", "none"); + HostedSolutionLog.LogEnd("OpenRunspace"); + return runSpace; + } + + internal void CloseRunspace(Runspace runspace) + { + try + { + if (runspace != null && runspace.RunspaceStateInfo.State == RunspaceState.Opened) + { + runspace.Close(); + } + } + catch (Exception ex) + { + HostedSolutionLog.LogError("Runspace error", ex); + } + } + + 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) + { + HostedSolutionLog.LogStart("ExecuteShellCommand"); + List errorList = new List(); + + if (useDomainController) + { + CommandParameter dc = new CommandParameter("DomainController", PrimaryDomainController); + if (!cmd.Parameters.Contains(dc)) + { + cmd.Parameters.Add(dc); + } + } + + HostedSolutionLog.DebugCommand(cmd); + 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); + HostedSolutionLog.LogWarning(errorMessage); + } + } + } + pipeLine = null; + errors = errorList.ToArray(); + HostedSolutionLog.LogEnd("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) + { + HostedSolutionLog.LogStart("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(); + HostedSolutionLog.LogEnd("GetResultObjectIdentity"); + return ret; + } + + internal string GetResultObjectDN(Collection result) + { + HostedSolutionLog.LogStart("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(); + HostedSolutionLog.LogEnd("GetResultObjectDN"); + return ret; + } + + + #endregion + + #region Transactions + + internal LyncTransaction StartTransaction() + { + return new LyncTransaction(); + } + + internal void RollbackTransaction(LyncTransaction transaction) + { + HostedSolutionLog.LogStart("RollbackTransaction"); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + + for (int i = transaction.Actions.Count - 1; i > -1; i--) + { + //reverse order + try + { + RollbackAction(transaction.Actions[i], runSpace); + } + catch (Exception ex) + { + HostedSolutionLog.LogError("Rollback error", ex); + } + } + } + catch (Exception ex) + { + HostedSolutionLog.LogError("Rollback error", ex); + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("RollbackTransaction"); + } + + private void RollbackAction(TransactionAction action, Runspace runspace) + { + HostedSolutionLog.LogInfo("Rollback action: {0}", action.ActionType); + switch (action.ActionType) + { + case TransactionAction.TransactionActionTypes.LyncNewSipDomain: + DeleteSipDomain(runspace, action.Id); + break; + //case TransactionAction.TransactionActionTypes.LyncNewSimpleUrl: + //DeleteSimpleUrl(runspace, action.Id); + //break; + case TransactionAction.TransactionActionTypes.LyncNewUser: + DeleteUser(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.LyncNewConferencingPolicy: + DeleteConferencingPolicy(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.LyncNewExternalAccessPolicy: + DeleteExternalAccessPolicy(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.LyncNewMobilityPolicy: + DeleteMobilityPolicy(runspace, action.Id); + break; + } + } + + #endregion + + #region helpers + private string GetOrganizationPath(string organizationId) + { + StringBuilder sb = new StringBuilder(); + // append provider + AppendOUPath(sb, organizationId); + AppendOUPath(sb, RootOU); + AppendDomainPath(sb, RootDomain); + + return sb.ToString(); + } + + 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(","); + } + } + + internal string AddADPrefix(string path) + { + string dn = path; + if (!dn.ToUpper().StartsWith("LDAP://")) + { + dn = string.Format("LDAP://{0}/{1}", PrimaryDomainController, dn); + } + return dn; + } + + #endregion + + public override bool IsInstalled() + { + string value = ""; + bool bResult = false; + RegistryKey root = Registry.LocalMachine; + RegistryKey rk = root.OpenSubKey(LyncRegistryPath); + if (rk != null) + { + value = (string)rk.GetValue("ProductVersion", null); + if (value == "4.0.7577.0") + bResult = true; + + rk.Close(); + } + return bResult; + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/LyncTransaction.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/LyncTransaction.cs new file mode 100644 index 00000000..811a93ec --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/LyncTransaction.cs @@ -0,0 +1,97 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System.Collections.Generic; + +namespace WebsitePanel.Providers.HostedSolution +{ + internal class LyncTransaction + { + List actions = null; + + public LyncTransaction() + { + actions = new List(); + } + + internal List Actions + { + get { return actions; } + } + + internal void RegisterNewSipDomain(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.LyncNewSipDomain; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewSimpleUrl(string sipDomain, string tenantID) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.LyncNewSimpleUrl; + action.Id = sipDomain; + action.Account = tenantID; + Actions.Add(action); + } + + + internal void RegisterNewConferencingPolicy(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.LyncNewConferencingPolicy; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewCsExternalAccessPolicy(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.LyncNewExternalAccessPolicy; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewCsMobilityPolicy(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.LyncNewMobilityPolicy; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewCsUser(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.LyncNewUser; + action.Id = id; + Actions.Add(action); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index 6e3a9e9c..9b78cd77 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -342,9 +342,9 @@ namespace WebsitePanel.Providers.HostedSolution #region Users - public void CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) + public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) { - CreateUserInternal(organizationId, loginName, displayName, upn, password, enabled); + return CreateUserInternal(organizationId, loginName, displayName, upn, password, enabled); } internal int CreateUserInternal(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) @@ -356,36 +356,43 @@ namespace WebsitePanel.Providers.HostedSolution if (string.IsNullOrEmpty(organizationId)) throw new ArgumentNullException("organizationId"); - + if (string.IsNullOrEmpty(loginName)) throw new ArgumentNullException("loginName"); if (string.IsNullOrEmpty(password)) throw new ArgumentNullException("password"); - bool userCreated = false; + bool userCreated = false; string userPath = null; try { string path = GetOrganizationPath(organizationId); - userPath= GetUserPath(organizationId, loginName); + userPath = GetUserPath(organizationId, loginName); if (!ActiveDirectoryUtils.AdObjectExists(userPath)) { - userPath = ActiveDirectoryUtils.CreateUser(path, loginName, displayName, password, enabled); + userPath = ActiveDirectoryUtils.CreateUser(path, upn, loginName, displayName, password, enabled); DirectoryEntry entry = new DirectoryEntry(userPath); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.UserPrincipalName, upn); entry.CommitChanges(); userCreated = true; + HostedSolutionLog.DebugInfo("User created: {0}", displayName); } else + { + HostedSolutionLog.DebugInfo("AD_OBJECT_ALREADY_EXISTS: {0}", userPath); + HostedSolutionLog.LogEnd("CreateUserInternal"); return Errors.AD_OBJECT_ALREADY_EXISTS; - - string groupPath = GetGroupPath(organizationId); + } + + string groupPath = GetGroupPath(organizationId); + HostedSolutionLog.DebugInfo("Group retrieved: {0}", groupPath); + - ActiveDirectoryUtils.AddUserToGroup(userPath, groupPath); + HostedSolutionLog.DebugInfo("Added to group: {0}", groupPath); } - catch(Exception e) + catch (Exception e) { HostedSolutionLog.LogError(e); try @@ -393,10 +400,12 @@ namespace WebsitePanel.Providers.HostedSolution if (userCreated) ActiveDirectoryUtils.DeleteADObject(userPath); } - catch(Exception ex) + catch (Exception ex) { HostedSolutionLog.LogError(ex); - } + } + + return Errors.AD_OBJECT_ALREADY_EXISTS; } HostedSolutionLog.LogEnd("CreateUserInternal"); @@ -492,10 +501,10 @@ namespace WebsitePanel.Providers.HostedSolution DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); OrganizationUser retUser = new OrganizationUser(); - + retUser.FirstName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.FirstName); retUser.LastName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.LastName); - retUser.DisplayName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.DisplayName); + retUser.DisplayName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.DisplayName); retUser.Initials = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Initials); retUser.JobTitle = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.JobTitle); retUser.Company = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Company); @@ -513,10 +522,11 @@ namespace WebsitePanel.Providers.HostedSolution retUser.Zip = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Zip); retUser.Country = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Country); retUser.Notes = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Notes); - retUser.ExternalEmail = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.ExternalEmail); - retUser.Disabled = (bool)entry.InvokeGet(ADAttributes.AccountDisabled); + retUser.ExternalEmail = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.ExternalEmail); + retUser.Disabled = (bool)entry.InvokeGet(ADAttributes.AccountDisabled); retUser.Manager = GetManager(entry); - retUser.DomainUserName = GetDomainName(loginName); + retUser.SamAccountName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName); + retUser.DomainUserName = GetDomainName(ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName)); retUser.DistinguishedName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.DistinguishedName); retUser.Locked = (bool)entry.InvokeGet(ADAttributes.AccountLocked); @@ -578,7 +588,7 @@ namespace WebsitePanel.Providers.HostedSolution ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.FirstName, firstName); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.LastName, lastName); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.DisplayName, displayName); - + ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Initials, initials); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.JobTitle, jobTitle); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Company, company); @@ -596,7 +606,7 @@ namespace WebsitePanel.Providers.HostedSolution ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Zip, zip); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Country, country); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Notes, notes); - ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.ExternalEmail, externalEmail); + ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.ExternalEmail, externalEmail); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.CustomAttribute2, (disabled ? "disabled" : null)); @@ -626,6 +636,48 @@ namespace WebsitePanel.Providers.HostedSolution } + public string GetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName) + { + return GetSamAccountNameByUserPrincipalNameInternal(organizationId, userPrincipalName); + } + + private string GetSamAccountNameByUserPrincipalNameInternal(string organizationId, string userPrincipalName) + { + HostedSolutionLog.LogStart("GetSamAccountNameByUserPrincipalNameInternal"); + HostedSolutionLog.DebugInfo("userPrincipalName : {0}", userPrincipalName); + HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); + + string accountName = string.Empty; + + try + { + + string path = GetOrganizationPath(organizationId); + DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); + + DirectorySearcher searcher = new DirectorySearcher(entry); + searcher.PropertiesToLoad.Add("userPrincipalName"); + searcher.PropertiesToLoad.Add("sAMAccountName"); + searcher.Filter = "(userPrincipalName=" + userPrincipalName + ")"; + searcher.SearchScope = SearchScope.Subtree; + + SearchResult resCollection = searcher.FindOne(); + if (resCollection != null) + { + accountName = resCollection.Properties["samaccountname"][0].ToString(); + } + + HostedSolutionLog.LogEnd("GetSamAccountNameByUserPrincipalNameInternal"); + } + catch (Exception e) + { + HostedSolutionLog.DebugInfo("Failed : {0}", e.Message); + } + + return accountName; + } + + #endregion #region Domains diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj index 7d5b2014..20a414bf 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj @@ -106,6 +106,15 @@ False ..\..\Lib\References\Microsoft\Microsoft.Exchange.Net.dll + + ..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.Core.dll + + + ..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.Hosted.dll + + + ..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.WritableConfig.dll + ..\..\Lib\References\Microsoft\Microsoft.SharePoint.dll False @@ -131,7 +140,10 @@ + + + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs index 001401da..b80bc76c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs @@ -325,6 +325,7 @@ namespace WebsitePanel.Providers.Web public class WebManagementServiceSettings { public string Port { get; set; } + public string NETBIOS { get; set; } public string ServiceUrl { get; set; } public int RequiresWindowsCredentials { get; set; } } @@ -3500,7 +3501,7 @@ namespace WebsitePanel.Providers.Web bool adEnabled = ServerSettings.ADEnabled; // !!! Bypass AD for WMSVC as it requires full-qualified username to authenticate user // against the web server - ServerSettings.ADEnabled = false; + //ServerSettings.ADEnabled = false; if (IdentityCredentialsMode == "IISMNGR") { @@ -3521,7 +3522,7 @@ namespace WebsitePanel.Providers.Web bool adEnabled = ServerSettings.ADEnabled; // !!! Bypass AD for WMSVC as it requires full-qualified username to authenticate user // against the web server - ServerSettings.ADEnabled = false; + //ServerSettings.ADEnabled = false; // ResultObject result = new ResultObject { IsSuccess = true }; @@ -3556,7 +3557,7 @@ namespace WebsitePanel.Providers.Web bool adEnabled = ServerSettings.ADEnabled; // !!! Bypass AD for WMSVC as it requires full-qualified username to authenticate user // against the web server - ServerSettings.ADEnabled = false; + //ServerSettings.ADEnabled = false; // string fqWebPath = String.Format("/{0}", siteName); @@ -3565,6 +3566,32 @@ namespace WebsitePanel.Providers.Web Log.WriteInfo("Site Name: {0}; Account Name: {1}; Account Password: {2}; FqWebPath: {3};", siteName, accountName, accountPassword, fqWebPath); + + string contentPath = string.Empty; + using (ServerManager srvman = webObjectsSvc.GetServerManager()) + { + WebSite site = webObjectsSvc.GetWebSiteFromIIS(srvman, siteName); + // + contentPath = webObjectsSvc.GetPhysicalPath(srvman, site); + // + Log.WriteInfo("Site Content Path: {0};", contentPath); + } + + string FTPRoot = string.Empty; + string FTPDir = string.Empty; + + + if (contentPath.IndexOf("\\\\") != -1) + { + string[] Tmp = contentPath.Split('\\'); + FTPRoot = "\\\\" + Tmp[2] + "\\" + Tmp[3]; + FTPDir = contentPath.Replace(FTPRoot, ""); + } + + // + string accountNameSid = string.Empty; + + // if (IdentityCredentialsMode == "IISMNGR") { @@ -3583,40 +3610,33 @@ namespace WebsitePanel.Providers.Web PasswordNeverExpires = true, AccountDisabled = false, Password = accountPassword, - System = true + System = true, + MsIIS_FTPDir = FTPDir, + MsIIS_FTPRoot = FTPRoot }, ServerSettings, - String.Empty, - String.Empty); + UsersOU, + GroupsOU); // Convert account name to the full-qualified one - accountName = GetFullQualifiedAccountName(accountName); + accountName = GetFullQualifiedAccountName(accountName); + accountNameSid = GetFullQualifiedAccountNameSid(accountName); // Log.WriteInfo("FQ Account Name: {0};", accountName); } - using (ServerManager srvman = webObjectsSvc.GetServerManager()) + + ManagementAuthorization.Grant(accountName, fqWebPath, false); + // + + if (IdentityCredentialsMode == "IISMNGR") { - // - ManagementAuthorization.Grant(accountName, fqWebPath, false); - // - WebSite site = webObjectsSvc.GetWebSiteFromIIS(srvman, siteName); - // - string contentPath = webObjectsSvc.GetPhysicalPath(srvman, site); - // - Log.WriteInfo("Site Content Path: {0};", contentPath); - // - if (IdentityCredentialsMode == "IISMNGR") - { - SecurityUtils.GrantNtfsPermissionsBySid(contentPath, SystemSID.LOCAL_SERVICE, permissions, true, true); - } - else - { - SecurityUtils.GrantNtfsPermissions(contentPath, accountName, permissions, true, true, ServerSettings, String.Empty, String.Empty); - } - // Restore setting back - ServerSettings.ADEnabled = adEnabled; + SecurityUtils.GrantNtfsPermissionsBySid(contentPath, SystemSID.LOCAL_SERVICE, permissions, true, true); } - } + else + { + SecurityUtils.GrantNtfsPermissions(contentPath, accountNameSid, NTFSPermission.Modify, true, true, ServerSettings, UsersOU, GroupsOU); + } + } public override void ChangeWebManagementAccessPassword(string accountName, string accountPassword) @@ -3625,7 +3645,7 @@ namespace WebsitePanel.Providers.Web bool adEnabled = ServerSettings.ADEnabled; // !!! Bypass AD for WMSVC as it requires full-qualified username to authenticate user // against the web server - ServerSettings.ADEnabled = false; + //ServerSettings.ADEnabled = false; // Trace input parameters Log.WriteInfo("Account Name: {0}; Account Password: {1};", accountName, accountPassword); @@ -3653,7 +3673,7 @@ namespace WebsitePanel.Providers.Web bool adEnabled = ServerSettings.ADEnabled; // !!! Bypass AD for WMSVC as it requires full-qualified username to authenticate user // against the web server - ServerSettings.ADEnabled = false; + //ServerSettings.ADEnabled = false; // string fqWebPath = String.Format("/{0}", siteName); // Trace input parameters @@ -3677,9 +3697,18 @@ namespace WebsitePanel.Providers.Web } else { - ManagementAuthorization.Revoke(GetFullQualifiedAccountName(accountName), fqWebPath); - SecurityUtils.RemoveNtfsPermissions(contentPath, accountName, ServerSettings, String.Empty, String.Empty); - SecurityUtils.DeleteUser(accountName, ServerSettings, String.Empty); + if (adEnabled) + { + ManagementAuthorization.Revoke(GetFullQualifiedAccountName(accountName), fqWebPath); + SecurityUtils.RemoveNtfsPermissions(contentPath, accountName, ServerSettings, UsersOU, GroupsOU); + SecurityUtils.DeleteUser(accountName, ServerSettings, UsersOU); + } + else + { + ManagementAuthorization.Revoke(GetFullQualifiedAccountName(accountName), fqWebPath); + SecurityUtils.RemoveNtfsPermissions(contentPath, accountName, ServerSettings, String.Empty, String.Empty); + SecurityUtils.DeleteUser(accountName, ServerSettings, String.Empty); + } } // Restore setting back ServerSettings.ADEnabled = adEnabled; @@ -3749,10 +3778,14 @@ namespace WebsitePanel.Providers.Web // Retrieve account name if (scopeCollection.Count > 0) { - iisObject.SetValue( + /* + iisObject.SetValue( WebSite.WmSvcAccountName, GetNonQualifiedAccountName((String)scopeCollection[0]["name"])); - // + */ + iisObject.SetValue( + WebSite.WmSvcAccountName, (String)scopeCollection[0]["name"]); + // iisObject.SetValue( WebSite.WmSvcServiceUrl, ProviderSettings["WmSvc.ServiceUrl"]); // @@ -3906,6 +3939,31 @@ namespace WebsitePanel.Providers.Web return domainName != null ? domainName + "\\" + accountName : accountName; } + + protected string GetFullQualifiedAccountNameSid(string accountName) + { + // + if (!ServerSettings.ADEnabled) + return String.Format(@"{0}\{1}", Environment.MachineName, accountName); + + if (accountName.IndexOf("\\") != -1) + return accountName; // already has domain information + + // DO IT FOR ACTIVE DIRECTORY MODE ONLY + string domainName = null; + try + { + DirectoryContext objContext = new DirectoryContext(DirectoryContextType.Domain, ServerSettings.ADRootDomain); + Domain objDomain = Domain.GetDomain(objContext); + domainName = objDomain.Name; + } + catch (Exception ex) + { + Log.WriteError("Get domain name error", ex); + } + + return domainName != null ? domainName + "\\" + accountName : accountName; + } #endregion #region SSL diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/ExchangeServerHostedEditionProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/ExchangeServerHostedEditionProxy.cs deleted file mode 100644 index 54257b39..00000000 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/ExchangeServerHostedEditionProxy.cs +++ /dev/null @@ -1,574 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.4952 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -// -// This source code was auto-generated by wsdl, Version=2.0.50727.42. -// -namespace WebsitePanel.Providers.ExchangeHostedEdition { - using System.Xml.Serialization; - using System.Web.Services; - using System.ComponentModel; - using System.Web.Services.Protocols; - using System; - using System.Diagnostics; - - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name="ExchangeServerHostedEditionSoap", Namespace="http://smbsaas/websitepanel/server/")] - [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] - public partial class ExchangeServerHostedEdition : Microsoft.Web.Services3.WebServicesClientProtocol { - - public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; - - private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted; - - private System.Threading.SendOrPostCallback GetOrganizationDomainsOperationCompleted; - - private System.Threading.SendOrPostCallback AddOrganizationDomainOperationCompleted; - - private System.Threading.SendOrPostCallback DeleteOrganizationDomainOperationCompleted; - - private System.Threading.SendOrPostCallback GetOrganizationDetailsOperationCompleted; - - private System.Threading.SendOrPostCallback UpdateOrganizationQuotasOperationCompleted; - - private System.Threading.SendOrPostCallback UpdateOrganizationCatchAllAddressOperationCompleted; - - private System.Threading.SendOrPostCallback UpdateOrganizationServicePlanOperationCompleted; - - private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted; - - /// - public ExchangeServerHostedEdition() { - this.Url = "http://localhost:9003/ExchangeServerHostedEdition.asmx"; - } - - /// - public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted; - - /// - public event GetOrganizationDomainsCompletedEventHandler GetOrganizationDomainsCompleted; - - /// - public event AddOrganizationDomainCompletedEventHandler AddOrganizationDomainCompleted; - - /// - public event DeleteOrganizationDomainCompletedEventHandler DeleteOrganizationDomainCompleted; - - /// - public event GetOrganizationDetailsCompletedEventHandler GetOrganizationDetailsCompleted; - - /// - public event UpdateOrganizationQuotasCompletedEventHandler UpdateOrganizationQuotasCompleted; - - /// - public event UpdateOrganizationCatchAllAddressCompletedEventHandler UpdateOrganizationCatchAllAddressCompleted; - - /// - public event UpdateOrganizationServicePlanCompletedEventHandler UpdateOrganizationServicePlanCompleted; - - /// - public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted; - - /// - [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateOrganization", 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 CreateOrganization(string organizationId, string programId, string offerId, string domain, string adminName, string adminEmail, string adminPassword) { - this.Invoke("CreateOrganization", new object[] { - organizationId, - programId, - offerId, - domain, - adminName, - adminEmail, - adminPassword}); - } - - /// - public System.IAsyncResult BeginCreateOrganization(string organizationId, string programId, string offerId, string domain, string adminName, string adminEmail, string adminPassword, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("CreateOrganization", new object[] { - organizationId, - programId, - offerId, - domain, - adminName, - adminEmail, - adminPassword}, callback, asyncState); - } - - /// - public void EndCreateOrganization(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void CreateOrganizationAsync(string organizationId, string programId, string offerId, string domain, string adminName, string adminEmail, string adminPassword) { - this.CreateOrganizationAsync(organizationId, programId, offerId, domain, adminName, adminEmail, adminPassword, null); - } - - /// - public void CreateOrganizationAsync(string organizationId, string programId, string offerId, string domain, string adminName, string adminEmail, string adminPassword, object userState) { - if ((this.CreateOrganizationOperationCompleted == null)) { - this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted); - } - this.InvokeAsync("CreateOrganization", new object[] { - organizationId, - programId, - offerId, - domain, - adminName, - adminEmail, - adminPassword}, this.CreateOrganizationOperationCompleted, userState); - } - - private void OnCreateOrganizationOperationCompleted(object arg) { - if ((this.CreateOrganizationCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.CreateOrganizationCompleted(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/GetOrganizationDomains", 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 ExchangeOrganizationDomain[] GetOrganizationDomains(string organizationId) { - object[] results = this.Invoke("GetOrganizationDomains", new object[] { - organizationId}); - return ((ExchangeOrganizationDomain[])(results[0])); - } - - /// - public System.IAsyncResult BeginGetOrganizationDomains(string organizationId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetOrganizationDomains", new object[] { - organizationId}, callback, asyncState); - } - - /// - public ExchangeOrganizationDomain[] EndGetOrganizationDomains(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeOrganizationDomain[])(results[0])); - } - - /// - public void GetOrganizationDomainsAsync(string organizationId) { - this.GetOrganizationDomainsAsync(organizationId, null); - } - - /// - public void GetOrganizationDomainsAsync(string organizationId, object userState) { - if ((this.GetOrganizationDomainsOperationCompleted == null)) { - this.GetOrganizationDomainsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationDomainsOperationCompleted); - } - this.InvokeAsync("GetOrganizationDomains", new object[] { - organizationId}, this.GetOrganizationDomainsOperationCompleted, userState); - } - - private void OnGetOrganizationDomainsOperationCompleted(object arg) { - if ((this.GetOrganizationDomainsCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetOrganizationDomainsCompleted(this, new GetOrganizationDomainsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddOrganizationDomain", 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 AddOrganizationDomain(string organizationId, string domain) { - this.Invoke("AddOrganizationDomain", new object[] { - organizationId, - domain}); - } - - /// - public System.IAsyncResult BeginAddOrganizationDomain(string organizationId, string domain, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("AddOrganizationDomain", new object[] { - organizationId, - domain}, callback, asyncState); - } - - /// - public void EndAddOrganizationDomain(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void AddOrganizationDomainAsync(string organizationId, string domain) { - this.AddOrganizationDomainAsync(organizationId, domain, null); - } - - /// - public void AddOrganizationDomainAsync(string organizationId, string domain, object userState) { - if ((this.AddOrganizationDomainOperationCompleted == null)) { - this.AddOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddOrganizationDomainOperationCompleted); - } - this.InvokeAsync("AddOrganizationDomain", new object[] { - organizationId, - domain}, this.AddOrganizationDomainOperationCompleted, userState); - } - - private void OnAddOrganizationDomainOperationCompleted(object arg) { - if ((this.AddOrganizationDomainCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.AddOrganizationDomainCompleted(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/DeleteOrganizationDomain", 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 DeleteOrganizationDomain(string organizationId, string domain) { - this.Invoke("DeleteOrganizationDomain", new object[] { - organizationId, - domain}); - } - - /// - public System.IAsyncResult BeginDeleteOrganizationDomain(string organizationId, string domain, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("DeleteOrganizationDomain", new object[] { - organizationId, - domain}, callback, asyncState); - } - - /// - public void EndDeleteOrganizationDomain(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void DeleteOrganizationDomainAsync(string organizationId, string domain) { - this.DeleteOrganizationDomainAsync(organizationId, domain, null); - } - - /// - public void DeleteOrganizationDomainAsync(string organizationId, string domain, object userState) { - if ((this.DeleteOrganizationDomainOperationCompleted == null)) { - this.DeleteOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationDomainOperationCompleted); - } - this.InvokeAsync("DeleteOrganizationDomain", new object[] { - organizationId, - domain}, this.DeleteOrganizationDomainOperationCompleted, userState); - } - - private void OnDeleteOrganizationDomainOperationCompleted(object arg) { - if ((this.DeleteOrganizationDomainCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.DeleteOrganizationDomainCompleted(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/GetOrganizationDetails", 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 ExchangeOrganization GetOrganizationDetails(string organizationId) { - object[] results = this.Invoke("GetOrganizationDetails", new object[] { - organizationId}); - return ((ExchangeOrganization)(results[0])); - } - - /// - public System.IAsyncResult BeginGetOrganizationDetails(string organizationId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetOrganizationDetails", new object[] { - organizationId}, callback, asyncState); - } - - /// - public ExchangeOrganization EndGetOrganizationDetails(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeOrganization)(results[0])); - } - - /// - public void GetOrganizationDetailsAsync(string organizationId) { - this.GetOrganizationDetailsAsync(organizationId, null); - } - - /// - public void GetOrganizationDetailsAsync(string organizationId, object userState) { - if ((this.GetOrganizationDetailsOperationCompleted == null)) { - this.GetOrganizationDetailsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationDetailsOperationCompleted); - } - this.InvokeAsync("GetOrganizationDetails", new object[] { - organizationId}, this.GetOrganizationDetailsOperationCompleted, userState); - } - - private void OnGetOrganizationDetailsOperationCompleted(object arg) { - if ((this.GetOrganizationDetailsCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetOrganizationDetailsCompleted(this, new GetOrganizationDetailsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/UpdateOrganizationQuotas", 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 UpdateOrganizationQuotas(string organizationId, int mailboxesNumber, int contactsNumber, int distributionListsNumber) { - this.Invoke("UpdateOrganizationQuotas", new object[] { - organizationId, - mailboxesNumber, - contactsNumber, - distributionListsNumber}); - } - - /// - public System.IAsyncResult BeginUpdateOrganizationQuotas(string organizationId, int mailboxesNumber, int contactsNumber, int distributionListsNumber, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("UpdateOrganizationQuotas", new object[] { - organizationId, - mailboxesNumber, - contactsNumber, - distributionListsNumber}, callback, asyncState); - } - - /// - public void EndUpdateOrganizationQuotas(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void UpdateOrganizationQuotasAsync(string organizationId, int mailboxesNumber, int contactsNumber, int distributionListsNumber) { - this.UpdateOrganizationQuotasAsync(organizationId, mailboxesNumber, contactsNumber, distributionListsNumber, null); - } - - /// - public void UpdateOrganizationQuotasAsync(string organizationId, int mailboxesNumber, int contactsNumber, int distributionListsNumber, object userState) { - if ((this.UpdateOrganizationQuotasOperationCompleted == null)) { - this.UpdateOrganizationQuotasOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateOrganizationQuotasOperationCompleted); - } - this.InvokeAsync("UpdateOrganizationQuotas", new object[] { - organizationId, - mailboxesNumber, - contactsNumber, - distributionListsNumber}, this.UpdateOrganizationQuotasOperationCompleted, userState); - } - - private void OnUpdateOrganizationQuotasOperationCompleted(object arg) { - if ((this.UpdateOrganizationQuotasCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.UpdateOrganizationQuotasCompleted(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/UpdateOrganizationCatchAllAddress", 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 UpdateOrganizationCatchAllAddress(string organizationId, string catchAllEmail) { - this.Invoke("UpdateOrganizationCatchAllAddress", new object[] { - organizationId, - catchAllEmail}); - } - - /// - public System.IAsyncResult BeginUpdateOrganizationCatchAllAddress(string organizationId, string catchAllEmail, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("UpdateOrganizationCatchAllAddress", new object[] { - organizationId, - catchAllEmail}, callback, asyncState); - } - - /// - public void EndUpdateOrganizationCatchAllAddress(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void UpdateOrganizationCatchAllAddressAsync(string organizationId, string catchAllEmail) { - this.UpdateOrganizationCatchAllAddressAsync(organizationId, catchAllEmail, null); - } - - /// - public void UpdateOrganizationCatchAllAddressAsync(string organizationId, string catchAllEmail, object userState) { - if ((this.UpdateOrganizationCatchAllAddressOperationCompleted == null)) { - this.UpdateOrganizationCatchAllAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateOrganizationCatchAllAddressOperationCompleted); - } - this.InvokeAsync("UpdateOrganizationCatchAllAddress", new object[] { - organizationId, - catchAllEmail}, this.UpdateOrganizationCatchAllAddressOperationCompleted, userState); - } - - private void OnUpdateOrganizationCatchAllAddressOperationCompleted(object arg) { - if ((this.UpdateOrganizationCatchAllAddressCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.UpdateOrganizationCatchAllAddressCompleted(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/UpdateOrganizationServicePlan", 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 UpdateOrganizationServicePlan(string organizationId, string programId, string offerId) { - this.Invoke("UpdateOrganizationServicePlan", new object[] { - organizationId, - programId, - offerId}); - } - - /// - public System.IAsyncResult BeginUpdateOrganizationServicePlan(string organizationId, string programId, string offerId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("UpdateOrganizationServicePlan", new object[] { - organizationId, - programId, - offerId}, callback, asyncState); - } - - /// - public void EndUpdateOrganizationServicePlan(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void UpdateOrganizationServicePlanAsync(string organizationId, string programId, string offerId) { - this.UpdateOrganizationServicePlanAsync(organizationId, programId, offerId, null); - } - - /// - public void UpdateOrganizationServicePlanAsync(string organizationId, string programId, string offerId, object userState) { - if ((this.UpdateOrganizationServicePlanOperationCompleted == null)) { - this.UpdateOrganizationServicePlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateOrganizationServicePlanOperationCompleted); - } - this.InvokeAsync("UpdateOrganizationServicePlan", new object[] { - organizationId, - programId, - offerId}, this.UpdateOrganizationServicePlanOperationCompleted, userState); - } - - private void OnUpdateOrganizationServicePlanOperationCompleted(object arg) { - if ((this.UpdateOrganizationServicePlanCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.UpdateOrganizationServicePlanCompleted(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/DeleteOrganization", 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 DeleteOrganization(string organizationId) { - this.Invoke("DeleteOrganization", new object[] { - organizationId}); - } - - /// - public System.IAsyncResult BeginDeleteOrganization(string organizationId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("DeleteOrganization", new object[] { - organizationId}, callback, asyncState); - } - - /// - public void EndDeleteOrganization(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void DeleteOrganizationAsync(string organizationId) { - this.DeleteOrganizationAsync(organizationId, null); - } - - /// - public void DeleteOrganizationAsync(string organizationId, object userState) { - if ((this.DeleteOrganizationOperationCompleted == null)) { - this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted); - } - this.InvokeAsync("DeleteOrganization", new object[] { - organizationId}, this.DeleteOrganizationOperationCompleted, userState); - } - - private void OnDeleteOrganizationOperationCompleted(object arg) { - if ((this.DeleteOrganizationCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.DeleteOrganizationCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - public new void CancelAsync(object userState) { - base.CancelAsync(userState); - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void CreateOrganizationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetOrganizationDomainsCompletedEventHandler(object sender, GetOrganizationDomainsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetOrganizationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeOrganizationDomain[] Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeOrganizationDomain[])(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void AddOrganizationDomainCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void DeleteOrganizationDomainCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetOrganizationDetailsCompletedEventHandler(object sender, GetOrganizationDetailsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationDetailsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetOrganizationDetailsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeOrganization Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeOrganization)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void UpdateOrganizationQuotasCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void UpdateOrganizationCatchAllAddressCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void UpdateOrganizationServicePlanCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void DeleteOrganizationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); -} diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/ExchangeServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/ExchangeServerProxy.cs index 7514cfdf..e9fa92c9 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/ExchangeServerProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/ExchangeServerProxy.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -39,9 +11,10 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.42. // + using WebsitePanel.Providers.HostedSolution; -namespace WebsitePanel.Providers.Exchange -{ + +namespace WebsitePanel.Providers.Exchange { using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; @@ -61,12 +34,6 @@ namespace WebsitePanel.Providers.Exchange public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; - private System.Threading.SendOrPostCallback WipeDataFromDeviceOperationCompleted; - - private System.Threading.SendOrPostCallback CancelRemoteWipeRequestOperationCompleted; - - private System.Threading.SendOrPostCallback RemoveDeviceOperationCompleted; - private System.Threading.SendOrPostCallback CheckAccountCredentialsOperationCompleted; private System.Threading.SendOrPostCallback ExtendToExchangeOrganizationOperationCompleted; @@ -79,6 +46,8 @@ namespace WebsitePanel.Providers.Exchange private System.Threading.SendOrPostCallback GetOABVirtualDirectoryOperationCompleted; + private System.Threading.SendOrPostCallback CreateOrganizationAddressBookPolicyOperationCompleted; + private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted; private System.Threading.SendOrPostCallback SetOrganizationStorageLimitsOperationCompleted; @@ -91,8 +60,6 @@ namespace WebsitePanel.Providers.Exchange private System.Threading.SendOrPostCallback DeleteAuthoritativeDomainOperationCompleted; - private System.Threading.SendOrPostCallback CreateMailboxOperationCompleted; - private System.Threading.SendOrPostCallback DeleteMailboxOperationCompleted; private System.Threading.SendOrPostCallback DisableMailboxOperationCompleted; @@ -193,20 +160,17 @@ namespace WebsitePanel.Providers.Exchange private System.Threading.SendOrPostCallback GetMobileDeviceOperationCompleted; + private System.Threading.SendOrPostCallback WipeDataFromDeviceOperationCompleted; + + private System.Threading.SendOrPostCallback CancelRemoteWipeRequestOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveDeviceOperationCompleted; + /// public ExchangeServer() { - this.Url = "http://localhost:9004/ExchangeServer.asmx"; + this.Url = "http://localhost:9006/ExchangeServer.asmx"; } - /// - public event WipeDataFromDeviceCompletedEventHandler WipeDataFromDeviceCompleted; - - /// - public event CancelRemoteWipeRequestCompletedEventHandler CancelRemoteWipeRequestCompleted; - - /// - public event RemoveDeviceCompletedEventHandler RemoveDeviceCompleted; - /// public event CheckAccountCredentialsCompletedEventHandler CheckAccountCredentialsCompleted; @@ -225,6 +189,9 @@ namespace WebsitePanel.Providers.Exchange /// public event GetOABVirtualDirectoryCompletedEventHandler GetOABVirtualDirectoryCompleted; + /// + public event CreateOrganizationAddressBookPolicyCompletedEventHandler CreateOrganizationAddressBookPolicyCompleted; + /// public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted; @@ -243,9 +210,6 @@ namespace WebsitePanel.Providers.Exchange /// public event DeleteAuthoritativeDomainCompletedEventHandler DeleteAuthoritativeDomainCompleted; - /// - public event CreateMailboxCompletedEventHandler CreateMailboxCompleted; - /// public event DeleteMailboxCompletedEventHandler DeleteMailboxCompleted; @@ -397,124 +361,13 @@ namespace WebsitePanel.Providers.Exchange public event GetMobileDeviceCompletedEventHandler GetMobileDeviceCompleted; /// - [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/WipeDataFromDevice", 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 WipeDataFromDevice(string id) { - this.Invoke("WipeDataFromDevice", new object[] { - id}); - } + public event WipeDataFromDeviceCompletedEventHandler WipeDataFromDeviceCompleted; /// - public System.IAsyncResult BeginWipeDataFromDevice(string id, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("WipeDataFromDevice", new object[] { - id}, callback, asyncState); - } + public event CancelRemoteWipeRequestCompletedEventHandler CancelRemoteWipeRequestCompleted; /// - public void EndWipeDataFromDevice(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void WipeDataFromDeviceAsync(string id) { - this.WipeDataFromDeviceAsync(id, null); - } - - /// - public void WipeDataFromDeviceAsync(string id, object userState) { - if ((this.WipeDataFromDeviceOperationCompleted == null)) { - this.WipeDataFromDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWipeDataFromDeviceOperationCompleted); - } - this.InvokeAsync("WipeDataFromDevice", new object[] { - id}, this.WipeDataFromDeviceOperationCompleted, userState); - } - - private void OnWipeDataFromDeviceOperationCompleted(object arg) { - if ((this.WipeDataFromDeviceCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.WipeDataFromDeviceCompleted(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/CancelRemoteWipeRequest", 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 CancelRemoteWipeRequest(string id) { - this.Invoke("CancelRemoteWipeRequest", new object[] { - id}); - } - - /// - public System.IAsyncResult BeginCancelRemoteWipeRequest(string id, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("CancelRemoteWipeRequest", new object[] { - id}, callback, asyncState); - } - - /// - public void EndCancelRemoteWipeRequest(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void CancelRemoteWipeRequestAsync(string id) { - this.CancelRemoteWipeRequestAsync(id, null); - } - - /// - public void CancelRemoteWipeRequestAsync(string id, object userState) { - if ((this.CancelRemoteWipeRequestOperationCompleted == null)) { - this.CancelRemoteWipeRequestOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCancelRemoteWipeRequestOperationCompleted); - } - this.InvokeAsync("CancelRemoteWipeRequest", new object[] { - id}, this.CancelRemoteWipeRequestOperationCompleted, userState); - } - - private void OnCancelRemoteWipeRequestOperationCompleted(object arg) { - if ((this.CancelRemoteWipeRequestCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.CancelRemoteWipeRequestCompleted(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/RemoveDevice", 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 RemoveDevice(string id) { - this.Invoke("RemoveDevice", new object[] { - id}); - } - - /// - public System.IAsyncResult BeginRemoveDevice(string id, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("RemoveDevice", new object[] { - id}, callback, asyncState); - } - - /// - public void EndRemoveDevice(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void RemoveDeviceAsync(string id) { - this.RemoveDeviceAsync(id, null); - } - - /// - public void RemoveDeviceAsync(string id, object userState) { - if ((this.RemoveDeviceOperationCompleted == null)) { - this.RemoveDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveDeviceOperationCompleted); - } - this.InvokeAsync("RemoveDevice", new object[] { - id}, this.RemoveDeviceOperationCompleted, userState); - } - - private void OnRemoveDeviceOperationCompleted(object arg) { - if ((this.RemoveDeviceCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.RemoveDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } + public event RemoveDeviceCompletedEventHandler RemoveDeviceCompleted; /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] @@ -564,18 +417,20 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ExtendToExchangeOrganization", 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 Organization ExtendToExchangeOrganization(string organizationId, string securityGroup) { + public Organization ExtendToExchangeOrganization(string organizationId, string securityGroup, bool IsConsumer) { object[] results = this.Invoke("ExtendToExchangeOrganization", new object[] { organizationId, - securityGroup}); + securityGroup, + IsConsumer}); return ((Organization)(results[0])); } /// - public System.IAsyncResult BeginExtendToExchangeOrganization(string organizationId, string securityGroup, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginExtendToExchangeOrganization(string organizationId, string securityGroup, bool IsConsumer, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ExtendToExchangeOrganization", new object[] { organizationId, - securityGroup}, callback, asyncState); + securityGroup, + IsConsumer}, callback, asyncState); } /// @@ -585,18 +440,19 @@ namespace WebsitePanel.Providers.Exchange } /// - public void ExtendToExchangeOrganizationAsync(string organizationId, string securityGroup) { - this.ExtendToExchangeOrganizationAsync(organizationId, securityGroup, null); + public void ExtendToExchangeOrganizationAsync(string organizationId, string securityGroup, bool IsConsumer) { + this.ExtendToExchangeOrganizationAsync(organizationId, securityGroup, IsConsumer, null); } /// - public void ExtendToExchangeOrganizationAsync(string organizationId, string securityGroup, object userState) { + public void ExtendToExchangeOrganizationAsync(string organizationId, string securityGroup, bool IsConsumer, object userState) { if ((this.ExtendToExchangeOrganizationOperationCompleted == null)) { this.ExtendToExchangeOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnExtendToExchangeOrganizationOperationCompleted); } this.InvokeAsync("ExtendToExchangeOrganization", new object[] { organizationId, - securityGroup}, this.ExtendToExchangeOrganizationOperationCompleted, userState); + securityGroup, + IsConsumer}, this.ExtendToExchangeOrganizationOperationCompleted, userState); } private void OnExtendToExchangeOrganizationOperationCompleted(object arg) { @@ -616,6 +472,7 @@ namespace WebsitePanel.Providers.Exchange ExchangeAccountType accountType, string mailboxDatabase, string offlineAddressBook, + string addressBookPolicy, string accountName, bool enablePOP, bool enableIMAP, @@ -625,7 +482,12 @@ namespace WebsitePanel.Providers.Exchange int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, - int keepDeletedItemsDays) { + int keepDeletedItemsDays, + int maxRecipients, + int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB, + bool hideFromAddressBook, + bool isConsumer) { object[] results = this.Invoke("CreateMailEnableUser", new object[] { upn, organizationId, @@ -633,6 +495,7 @@ namespace WebsitePanel.Providers.Exchange accountType, mailboxDatabase, offlineAddressBook, + addressBookPolicy, accountName, enablePOP, enableIMAP, @@ -642,7 +505,12 @@ namespace WebsitePanel.Providers.Exchange issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays}); + keepDeletedItemsDays, + maxRecipients, + maxSendMessageSizeKB, + maxReceiveMessageSizeKB, + hideFromAddressBook, + isConsumer}); return ((string)(results[0])); } @@ -654,6 +522,7 @@ namespace WebsitePanel.Providers.Exchange ExchangeAccountType accountType, string mailboxDatabase, string offlineAddressBook, + string addressBookPolicy, string accountName, bool enablePOP, bool enableIMAP, @@ -664,6 +533,11 @@ namespace WebsitePanel.Providers.Exchange int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, + int maxRecipients, + int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB, + bool hideFromAddressBook, + bool isConsumer, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateMailEnableUser", new object[] { @@ -673,6 +547,7 @@ namespace WebsitePanel.Providers.Exchange accountType, mailboxDatabase, offlineAddressBook, + addressBookPolicy, accountName, enablePOP, enableIMAP, @@ -682,7 +557,12 @@ namespace WebsitePanel.Providers.Exchange issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays}, callback, asyncState); + keepDeletedItemsDays, + maxRecipients, + maxSendMessageSizeKB, + maxReceiveMessageSizeKB, + hideFromAddressBook, + isConsumer}, callback, asyncState); } /// @@ -699,27 +579,7 @@ namespace WebsitePanel.Providers.Exchange ExchangeAccountType accountType, string mailboxDatabase, string offlineAddressBook, - string accountName, - bool enablePOP, - bool enableIMAP, - bool enableOWA, - bool enableMAPI, - bool enableActiveSync, - int issueWarningKB, - int prohibitSendKB, - int prohibitSendReceiveKB, - int keepDeletedItemsDays) { - this.CreateMailEnableUserAsync(upn, organizationId, organizationDistinguishedName, accountType, mailboxDatabase, offlineAddressBook, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, null); - } - - /// - public void CreateMailEnableUserAsync( - string upn, - string organizationId, - string organizationDistinguishedName, - ExchangeAccountType accountType, - string mailboxDatabase, - string offlineAddressBook, + string addressBookPolicy, string accountName, bool enablePOP, bool enableIMAP, @@ -730,6 +590,38 @@ namespace WebsitePanel.Providers.Exchange int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, + int maxRecipients, + int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB, + bool hideFromAddressBook, + bool isConsumer) { + this.CreateMailEnableUserAsync(upn, organizationId, organizationDistinguishedName, accountType, mailboxDatabase, offlineAddressBook, addressBookPolicy, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, hideFromAddressBook, isConsumer, null); + } + + /// + public void CreateMailEnableUserAsync( + string upn, + string organizationId, + string organizationDistinguishedName, + ExchangeAccountType accountType, + string mailboxDatabase, + string offlineAddressBook, + string addressBookPolicy, + string accountName, + bool enablePOP, + bool enableIMAP, + bool enableOWA, + bool enableMAPI, + bool enableActiveSync, + int issueWarningKB, + int prohibitSendKB, + int prohibitSendReceiveKB, + int keepDeletedItemsDays, + int maxRecipients, + int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB, + bool hideFromAddressBook, + bool isConsumer, object userState) { if ((this.CreateMailEnableUserOperationCompleted == null)) { this.CreateMailEnableUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateMailEnableUserOperationCompleted); @@ -741,6 +633,7 @@ namespace WebsitePanel.Providers.Exchange accountType, mailboxDatabase, offlineAddressBook, + addressBookPolicy, accountName, enablePOP, enableIMAP, @@ -750,7 +643,12 @@ namespace WebsitePanel.Providers.Exchange issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays}, this.CreateMailEnableUserOperationCompleted, userState); + keepDeletedItemsDays, + maxRecipients, + maxSendMessageSizeKB, + maxReceiveMessageSizeKB, + hideFromAddressBook, + isConsumer}, this.CreateMailEnableUserOperationCompleted, userState); } private void OnCreateMailEnableUserOperationCompleted(object arg) { @@ -887,31 +785,87 @@ namespace WebsitePanel.Providers.Exchange } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateOrganizationAddressBookPolicy", 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 Organization CreateOrganizationAddressBookPolicy(string organizationId, string gal, string addressBook, string roomList, string oab) { + object[] results = this.Invoke("CreateOrganizationAddressBookPolicy", new object[] { + organizationId, + gal, + addressBook, + roomList, + oab}); + return ((Organization)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateOrganizationAddressBookPolicy(string organizationId, string gal, string addressBook, string roomList, string oab, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CreateOrganizationAddressBookPolicy", new object[] { + organizationId, + gal, + addressBook, + roomList, + oab}, callback, asyncState); + } + + /// + public Organization EndCreateOrganizationAddressBookPolicy(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((Organization)(results[0])); + } + + /// + public void CreateOrganizationAddressBookPolicyAsync(string organizationId, string gal, string addressBook, string roomList, string oab) { + this.CreateOrganizationAddressBookPolicyAsync(organizationId, gal, addressBook, roomList, oab, null); + } + + /// + public void CreateOrganizationAddressBookPolicyAsync(string organizationId, string gal, string addressBook, string roomList, string oab, object userState) { + if ((this.CreateOrganizationAddressBookPolicyOperationCompleted == null)) { + this.CreateOrganizationAddressBookPolicyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationAddressBookPolicyOperationCompleted); + } + this.InvokeAsync("CreateOrganizationAddressBookPolicy", new object[] { + organizationId, + gal, + addressBook, + roomList, + oab}, this.CreateOrganizationAddressBookPolicyOperationCompleted, userState); + } + + private void OnCreateOrganizationAddressBookPolicyOperationCompleted(object arg) { + if ((this.CreateOrganizationAddressBookPolicyCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateOrganizationAddressBookPolicyCompleted(this, new CreateOrganizationAddressBookPolicyCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteOrganization", 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 DeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup) { + public bool DeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy) { object[] results = this.Invoke("DeleteOrganization", new object[] { organizationId, distinguishedName, globalAddressList, addressList, - roomsAddressList, + roomList, offlineAddressBook, - securityGroup}); + securityGroup, + addressBookPolicy}); return ((bool)(results[0])); } /// - public System.IAsyncResult BeginDeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteOrganization", new object[] { organizationId, distinguishedName, globalAddressList, addressList, - roomsAddressList, + roomList, offlineAddressBook, - securityGroup}, callback, asyncState); + securityGroup, + addressBookPolicy}, callback, asyncState); } /// @@ -921,12 +875,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void DeleteOrganizationAsync(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup) { - this.DeleteOrganizationAsync(organizationId, distinguishedName, globalAddressList, addressList, roomsAddressList, offlineAddressBook, securityGroup, null); + public void DeleteOrganizationAsync(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy) { + this.DeleteOrganizationAsync(organizationId, distinguishedName, globalAddressList, addressList, roomList, offlineAddressBook, securityGroup, addressBookPolicy, null); } /// - public void DeleteOrganizationAsync(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup, object userState) { + public void DeleteOrganizationAsync(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy, object userState) { if ((this.DeleteOrganizationOperationCompleted == null)) { this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted); } @@ -935,9 +889,10 @@ namespace WebsitePanel.Providers.Exchange distinguishedName, globalAddressList, addressList, - roomsAddressList, + roomList, offlineAddressBook, - securityGroup}, this.DeleteOrganizationOperationCompleted, userState); + securityGroup, + addressBookPolicy}, this.DeleteOrganizationOperationCompleted, userState); } private void OnDeleteOrganizationOperationCompleted(object arg) { @@ -1160,188 +1115,6 @@ namespace WebsitePanel.Providers.Exchange } } - /// - [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateMailbox", 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 string CreateMailbox( - string organizationId, - string organizationDistinguishedName, - string mailboxDatabase, - string securityGroup, - string offlineAddressBook, - ExchangeAccountType accountType, - string displayName, - string accountName, - string name, - string domain, - string password, - bool enablePOP, - bool enableIMAP, - bool enableOWA, - bool enableMAPI, - bool enableActiveSync, - int issueWarningKB, - int prohibitSendKB, - int prohibitSendReceiveKB, - int keepDeletedItemsDays) { - object[] results = this.Invoke("CreateMailbox", new object[] { - organizationId, - organizationDistinguishedName, - mailboxDatabase, - securityGroup, - offlineAddressBook, - accountType, - displayName, - accountName, - name, - domain, - password, - enablePOP, - enableIMAP, - enableOWA, - enableMAPI, - enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays}); - return ((string)(results[0])); - } - - /// - public System.IAsyncResult BeginCreateMailbox( - string organizationId, - string organizationDistinguishedName, - string mailboxDatabase, - string securityGroup, - string offlineAddressBook, - ExchangeAccountType accountType, - string displayName, - string accountName, - string name, - string domain, - string password, - bool enablePOP, - bool enableIMAP, - bool enableOWA, - bool enableMAPI, - bool enableActiveSync, - int issueWarningKB, - int prohibitSendKB, - int prohibitSendReceiveKB, - int keepDeletedItemsDays, - System.AsyncCallback callback, - object asyncState) { - return this.BeginInvoke("CreateMailbox", new object[] { - organizationId, - organizationDistinguishedName, - mailboxDatabase, - securityGroup, - offlineAddressBook, - accountType, - displayName, - accountName, - name, - domain, - password, - enablePOP, - enableIMAP, - enableOWA, - enableMAPI, - enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays}, callback, asyncState); - } - - /// - public string EndCreateMailbox(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((string)(results[0])); - } - - /// - public void CreateMailboxAsync( - string organizationId, - string organizationDistinguishedName, - string mailboxDatabase, - string securityGroup, - string offlineAddressBook, - ExchangeAccountType accountType, - string displayName, - string accountName, - string name, - string domain, - string password, - bool enablePOP, - bool enableIMAP, - bool enableOWA, - bool enableMAPI, - bool enableActiveSync, - int issueWarningKB, - int prohibitSendKB, - int prohibitSendReceiveKB, - int keepDeletedItemsDays) { - this.CreateMailboxAsync(organizationId, organizationDistinguishedName, mailboxDatabase, securityGroup, offlineAddressBook, accountType, displayName, accountName, name, domain, password, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, null); - } - - /// - public void CreateMailboxAsync( - string organizationId, - string organizationDistinguishedName, - string mailboxDatabase, - string securityGroup, - string offlineAddressBook, - ExchangeAccountType accountType, - string displayName, - string accountName, - string name, - string domain, - string password, - bool enablePOP, - bool enableIMAP, - bool enableOWA, - bool enableMAPI, - bool enableActiveSync, - int issueWarningKB, - int prohibitSendKB, - int prohibitSendReceiveKB, - int keepDeletedItemsDays, - object userState) { - if ((this.CreateMailboxOperationCompleted == null)) { - this.CreateMailboxOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateMailboxOperationCompleted); - } - this.InvokeAsync("CreateMailbox", new object[] { - organizationId, - organizationDistinguishedName, - mailboxDatabase, - securityGroup, - offlineAddressBook, - accountType, - displayName, - accountName, - name, - domain, - password, - enablePOP, - enableIMAP, - enableOWA, - enableMAPI, - enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays}, this.CreateMailboxOperationCompleted, userState); - } - - private void OnCreateMailboxOperationCompleted(object arg) { - if ((this.CreateMailboxCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.CreateMailboxCompleted(this, new CreateMailboxCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteMailbox", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -1467,115 +1240,19 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetMailboxGeneralSettings", 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 SetMailboxGeneralSettings( - string accountName, - string displayName, - string password, - bool hideFromAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes) { + public void SetMailboxGeneralSettings(string accountName, bool hideFromAddressBook, bool disabled) { this.Invoke("SetMailboxGeneralSettings", new object[] { accountName, - displayName, - password, hideFromAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes}); + disabled}); } /// - public System.IAsyncResult BeginSetMailboxGeneralSettings( - string accountName, - string displayName, - string password, - bool hideFromAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - System.AsyncCallback callback, - object asyncState) { + public System.IAsyncResult BeginSetMailboxGeneralSettings(string accountName, bool hideFromAddressBook, bool disabled, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetMailboxGeneralSettings", new object[] { accountName, - displayName, - password, hideFromAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes}, callback, asyncState); + disabled}, callback, asyncState); } /// @@ -1584,92 +1261,19 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetMailboxGeneralSettingsAsync( - string accountName, - string displayName, - string password, - bool hideFromAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes) { - this.SetMailboxGeneralSettingsAsync(accountName, displayName, password, hideFromAddressBook, disabled, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, null); + public void SetMailboxGeneralSettingsAsync(string accountName, bool hideFromAddressBook, bool disabled) { + this.SetMailboxGeneralSettingsAsync(accountName, hideFromAddressBook, disabled, null); } /// - public void SetMailboxGeneralSettingsAsync( - string accountName, - string displayName, - string password, - bool hideFromAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - object userState) { + public void SetMailboxGeneralSettingsAsync(string accountName, bool hideFromAddressBook, bool disabled, object userState) { if ((this.SetMailboxGeneralSettingsOperationCompleted == null)) { this.SetMailboxGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMailboxGeneralSettingsOperationCompleted); } this.InvokeAsync("SetMailboxGeneralSettings", new object[] { accountName, - displayName, - password, hideFromAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes}, this.SetMailboxGeneralSettingsOperationCompleted, userState); + disabled}, this.SetMailboxGeneralSettingsOperationCompleted, userState); } private void OnSetMailboxGeneralSettingsOperationCompleted(object arg) { @@ -1724,7 +1328,7 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetMailboxMailFlowSettings", 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 SetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication) { + public void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { this.Invoke("SetMailboxMailFlowSettings", new object[] { accountName, enableForwarding, @@ -1733,14 +1337,11 @@ namespace WebsitePanel.Providers.Exchange sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, requireSenderAuthentication}); } /// - public System.IAsyncResult BeginSetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetMailboxMailFlowSettings", new object[] { accountName, enableForwarding, @@ -1749,9 +1350,6 @@ namespace WebsitePanel.Providers.Exchange sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, requireSenderAuthentication}, callback, asyncState); } @@ -1761,12 +1359,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetMailboxMailFlowSettingsAsync(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication) { - this.SetMailboxMailFlowSettingsAsync(accountName, enableForwarding, forwardingAccountName, forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, requireSenderAuthentication, null); + public void SetMailboxMailFlowSettingsAsync(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { + this.SetMailboxMailFlowSettingsAsync(accountName, enableForwarding, forwardingAccountName, forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, requireSenderAuthentication, null); } /// - public void SetMailboxMailFlowSettingsAsync(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication, object userState) { + public void SetMailboxMailFlowSettingsAsync(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, object userState) { if ((this.SetMailboxMailFlowSettingsOperationCompleted == null)) { this.SetMailboxMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMailboxMailFlowSettingsOperationCompleted); } @@ -1778,9 +1376,6 @@ namespace WebsitePanel.Providers.Exchange sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, requireSenderAuthentication}, this.SetMailboxMailFlowSettingsOperationCompleted, userState); } @@ -1836,7 +1431,7 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetMailboxAdvancedSettings", 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 SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) { + public void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB) { this.Invoke("SetMailboxAdvancedSettings", new object[] { organizationId, accountName, @@ -1848,11 +1443,30 @@ namespace WebsitePanel.Providers.Exchange issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays}); + keepDeletedItemsDays, + maxRecipients, + maxSendMessageSizeKB, + maxReceiveMessageSizeKB}); } /// - public System.IAsyncResult BeginSetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetMailboxAdvancedSettings( + string organizationId, + string accountName, + bool enablePOP, + bool enableIMAP, + bool enableOWA, + bool enableMAPI, + bool enableActiveSync, + int issueWarningKB, + int prohibitSendKB, + int prohibitSendReceiveKB, + int keepDeletedItemsDays, + int maxRecipients, + int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB, + System.AsyncCallback callback, + object asyncState) { return this.BeginInvoke("SetMailboxAdvancedSettings", new object[] { organizationId, accountName, @@ -1864,7 +1478,10 @@ namespace WebsitePanel.Providers.Exchange issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays}, callback, asyncState); + keepDeletedItemsDays, + maxRecipients, + maxSendMessageSizeKB, + maxReceiveMessageSizeKB}, callback, asyncState); } /// @@ -1873,12 +1490,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetMailboxAdvancedSettingsAsync(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) { - this.SetMailboxAdvancedSettingsAsync(organizationId, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, null); + public void SetMailboxAdvancedSettingsAsync(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB) { + this.SetMailboxAdvancedSettingsAsync(organizationId, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, null); } /// - public void SetMailboxAdvancedSettingsAsync(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, object userState) { + public void SetMailboxAdvancedSettingsAsync(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, object userState) { if ((this.SetMailboxAdvancedSettingsOperationCompleted == null)) { this.SetMailboxAdvancedSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMailboxAdvancedSettingsOperationCompleted); } @@ -1893,7 +1510,10 @@ namespace WebsitePanel.Providers.Exchange issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays}, this.SetMailboxAdvancedSettingsOperationCompleted, userState); + keepDeletedItemsDays, + maxRecipients, + maxSendMessageSizeKB, + maxReceiveMessageSizeKB}, this.SetMailboxAdvancedSettingsOperationCompleted, userState); } private void OnSetMailboxAdvancedSettingsOperationCompleted(object arg) { @@ -2620,7 +2240,7 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateDistributionList", 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 CreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy) { + public void CreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists) { this.Invoke("CreateDistributionList", new object[] { organizationId, organizationDistinguishedName, @@ -2628,11 +2248,12 @@ namespace WebsitePanel.Providers.Exchange accountName, name, domain, - managedBy}); + managedBy, + addressLists}); } /// - public System.IAsyncResult BeginCreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateDistributionList", new object[] { organizationId, organizationDistinguishedName, @@ -2640,7 +2261,8 @@ namespace WebsitePanel.Providers.Exchange accountName, name, domain, - managedBy}, callback, asyncState); + managedBy, + addressLists}, callback, asyncState); } /// @@ -2649,12 +2271,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void CreateDistributionListAsync(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy) { - this.CreateDistributionListAsync(organizationId, organizationDistinguishedName, displayName, accountName, name, domain, managedBy, null); + public void CreateDistributionListAsync(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists) { + this.CreateDistributionListAsync(organizationId, organizationDistinguishedName, displayName, accountName, name, domain, managedBy, addressLists, null); } /// - public void CreateDistributionListAsync(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, object userState) { + public void CreateDistributionListAsync(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists, object userState) { if ((this.CreateDistributionListOperationCompleted == null)) { this.CreateDistributionListOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateDistributionListOperationCompleted); } @@ -2665,7 +2287,8 @@ namespace WebsitePanel.Providers.Exchange accountName, name, domain, - managedBy}, this.CreateDistributionListOperationCompleted, userState); + managedBy, + addressLists}, this.CreateDistributionListOperationCompleted, userState); } private void OnCreateDistributionListOperationCompleted(object arg) { @@ -2760,25 +2383,27 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetDistributionListGeneralSettings", 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 SetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes) { + public void SetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, string[] addressLists) { this.Invoke("SetDistributionListGeneralSettings", new object[] { accountName, displayName, hideFromAddressBook, managedBy, members, - notes}); + notes, + addressLists}); } /// - public System.IAsyncResult BeginSetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, string[] addressLists, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetDistributionListGeneralSettings", new object[] { accountName, displayName, hideFromAddressBook, managedBy, members, - notes}, callback, asyncState); + notes, + addressLists}, callback, asyncState); } /// @@ -2787,12 +2412,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetDistributionListGeneralSettingsAsync(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes) { - this.SetDistributionListGeneralSettingsAsync(accountName, displayName, hideFromAddressBook, managedBy, members, notes, null); + public void SetDistributionListGeneralSettingsAsync(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, string[] addressLists) { + this.SetDistributionListGeneralSettingsAsync(accountName, displayName, hideFromAddressBook, managedBy, members, notes, addressLists, null); } /// - public void SetDistributionListGeneralSettingsAsync(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, object userState) { + public void SetDistributionListGeneralSettingsAsync(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, string[] addressLists, object userState) { if ((this.SetDistributionListGeneralSettingsOperationCompleted == null)) { this.SetDistributionListGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetDistributionListGeneralSettingsOperationCompleted); } @@ -2802,7 +2427,8 @@ namespace WebsitePanel.Providers.Exchange hideFromAddressBook, managedBy, members, - notes}, this.SetDistributionListGeneralSettingsOperationCompleted, userState); + notes, + addressLists}, this.SetDistributionListGeneralSettingsOperationCompleted, userState); } private void OnSetDistributionListGeneralSettingsOperationCompleted(object arg) { @@ -2857,21 +2483,23 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetDistributionListMailFlowSettings", 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 SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { + public void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists) { this.Invoke("SetDistributionListMailFlowSettings", new object[] { accountName, acceptAccounts, rejectAccounts, - requireSenderAuthentication}); + requireSenderAuthentication, + addressLists}); } /// - public System.IAsyncResult BeginSetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetDistributionListMailFlowSettings", new object[] { accountName, acceptAccounts, rejectAccounts, - requireSenderAuthentication}, callback, asyncState); + requireSenderAuthentication, + addressLists}, callback, asyncState); } /// @@ -2880,12 +2508,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetDistributionListMailFlowSettingsAsync(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { - this.SetDistributionListMailFlowSettingsAsync(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication, null); + public void SetDistributionListMailFlowSettingsAsync(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists) { + this.SetDistributionListMailFlowSettingsAsync(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication, addressLists, null); } /// - public void SetDistributionListMailFlowSettingsAsync(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, object userState) { + public void SetDistributionListMailFlowSettingsAsync(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists, object userState) { if ((this.SetDistributionListMailFlowSettingsOperationCompleted == null)) { this.SetDistributionListMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetDistributionListMailFlowSettingsOperationCompleted); } @@ -2893,7 +2521,8 @@ namespace WebsitePanel.Providers.Exchange accountName, acceptAccounts, rejectAccounts, - requireSenderAuthentication}, this.SetDistributionListMailFlowSettingsOperationCompleted, userState); + requireSenderAuthentication, + addressLists}, this.SetDistributionListMailFlowSettingsOperationCompleted, userState); } private void OnSetDistributionListMailFlowSettingsOperationCompleted(object arg) { @@ -2948,17 +2577,19 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetDistributionListEmailAddresses", 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 SetDistributionListEmailAddresses(string accountName, string[] emailAddresses) { + public void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses, string[] addressLists) { this.Invoke("SetDistributionListEmailAddresses", new object[] { accountName, - emailAddresses}); + emailAddresses, + addressLists}); } /// - public System.IAsyncResult BeginSetDistributionListEmailAddresses(string accountName, string[] emailAddresses, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetDistributionListEmailAddresses(string accountName, string[] emailAddresses, string[] addressLists, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetDistributionListEmailAddresses", new object[] { accountName, - emailAddresses}, callback, asyncState); + emailAddresses, + addressLists}, callback, asyncState); } /// @@ -2967,18 +2598,19 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetDistributionListEmailAddressesAsync(string accountName, string[] emailAddresses) { - this.SetDistributionListEmailAddressesAsync(accountName, emailAddresses, null); + public void SetDistributionListEmailAddressesAsync(string accountName, string[] emailAddresses, string[] addressLists) { + this.SetDistributionListEmailAddressesAsync(accountName, emailAddresses, addressLists, null); } /// - public void SetDistributionListEmailAddressesAsync(string accountName, string[] emailAddresses, object userState) { + public void SetDistributionListEmailAddressesAsync(string accountName, string[] emailAddresses, string[] addressLists, object userState) { if ((this.SetDistributionListEmailAddressesOperationCompleted == null)) { this.SetDistributionListEmailAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetDistributionListEmailAddressesOperationCompleted); } this.InvokeAsync("SetDistributionListEmailAddresses", new object[] { accountName, - emailAddresses}, this.SetDistributionListEmailAddressesOperationCompleted, userState); + emailAddresses, + addressLists}, this.SetDistributionListEmailAddressesOperationCompleted, userState); } private void OnSetDistributionListEmailAddressesOperationCompleted(object arg) { @@ -2991,17 +2623,19 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetDistributionListPrimaryEmailAddress", 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 SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress) { + public void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress, string[] addressLists) { this.Invoke("SetDistributionListPrimaryEmailAddress", new object[] { accountName, - emailAddress}); + emailAddress, + addressLists}); } /// - public System.IAsyncResult BeginSetDistributionListPrimaryEmailAddress(string accountName, string emailAddress, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetDistributionListPrimaryEmailAddress(string accountName, string emailAddress, string[] addressLists, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetDistributionListPrimaryEmailAddress", new object[] { accountName, - emailAddress}, callback, asyncState); + emailAddress, + addressLists}, callback, asyncState); } /// @@ -3010,18 +2644,19 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetDistributionListPrimaryEmailAddressAsync(string accountName, string emailAddress) { - this.SetDistributionListPrimaryEmailAddressAsync(accountName, emailAddress, null); + public void SetDistributionListPrimaryEmailAddressAsync(string accountName, string emailAddress, string[] addressLists) { + this.SetDistributionListPrimaryEmailAddressAsync(accountName, emailAddress, addressLists, null); } /// - public void SetDistributionListPrimaryEmailAddressAsync(string accountName, string emailAddress, object userState) { + public void SetDistributionListPrimaryEmailAddressAsync(string accountName, string emailAddress, string[] addressLists, object userState) { if ((this.SetDistributionListPrimaryEmailAddressOperationCompleted == null)) { this.SetDistributionListPrimaryEmailAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetDistributionListPrimaryEmailAddressOperationCompleted); } this.InvokeAsync("SetDistributionListPrimaryEmailAddress", new object[] { accountName, - emailAddress}, this.SetDistributionListPrimaryEmailAddressOperationCompleted, userState); + emailAddress, + addressLists}, this.SetDistributionListPrimaryEmailAddressOperationCompleted, userState); } private void OnSetDistributionListPrimaryEmailAddressOperationCompleted(object arg) { @@ -3034,21 +2669,23 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetDistributionListPermissions", 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 SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts) { + public void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists) { this.Invoke("SetDistributionListPermissions", new object[] { organizationId, accountName, sendAsAccounts, - sendOnBehalfAccounts}); + sendOnBehalfAccounts, + addressLists}); } /// - public System.IAsyncResult BeginSetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetDistributionListPermissions", new object[] { organizationId, accountName, sendAsAccounts, - sendOnBehalfAccounts}, callback, asyncState); + sendOnBehalfAccounts, + addressLists}, callback, asyncState); } /// @@ -3057,12 +2694,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetDistributionListPermissionsAsync(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts) { - this.SetDistributionListPermissionsAsync(organizationId, accountName, sendAsAccounts, sendOnBehalfAccounts, null); + public void SetDistributionListPermissionsAsync(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists) { + this.SetDistributionListPermissionsAsync(organizationId, accountName, sendAsAccounts, sendOnBehalfAccounts, addressLists, null); } /// - public void SetDistributionListPermissionsAsync(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, object userState) { + public void SetDistributionListPermissionsAsync(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists, object userState) { if ((this.SetDistributionListPermissionsOperationCompleted == null)) { this.SetDistributionListPermissionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetDistributionListPermissionsOperationCompleted); } @@ -3070,7 +2707,8 @@ namespace WebsitePanel.Providers.Exchange organizationId, accountName, sendAsAccounts, - sendOnBehalfAccounts}, this.SetDistributionListPermissionsOperationCompleted, userState); + sendOnBehalfAccounts, + addressLists}, this.SetDistributionListPermissionsOperationCompleted, userState); } private void OnSetDistributionListPermissionsOperationCompleted(object arg) { @@ -4079,24 +3717,132 @@ namespace WebsitePanel.Providers.Exchange } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/WipeDataFromDevice", 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 WipeDataFromDevice(string id) { + this.Invoke("WipeDataFromDevice", new object[] { + id}); + } + + /// + public System.IAsyncResult BeginWipeDataFromDevice(string id, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("WipeDataFromDevice", new object[] { + id}, callback, asyncState); + } + + /// + public void EndWipeDataFromDevice(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void WipeDataFromDeviceAsync(string id) { + this.WipeDataFromDeviceAsync(id, null); + } + + /// + public void WipeDataFromDeviceAsync(string id, object userState) { + if ((this.WipeDataFromDeviceOperationCompleted == null)) { + this.WipeDataFromDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWipeDataFromDeviceOperationCompleted); + } + this.InvokeAsync("WipeDataFromDevice", new object[] { + id}, this.WipeDataFromDeviceOperationCompleted, userState); + } + + private void OnWipeDataFromDeviceOperationCompleted(object arg) { + if ((this.WipeDataFromDeviceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.WipeDataFromDeviceCompleted(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/CancelRemoteWipeRequest", 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 CancelRemoteWipeRequest(string id) { + this.Invoke("CancelRemoteWipeRequest", new object[] { + id}); + } + + /// + public System.IAsyncResult BeginCancelRemoteWipeRequest(string id, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CancelRemoteWipeRequest", new object[] { + id}, callback, asyncState); + } + + /// + public void EndCancelRemoteWipeRequest(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void CancelRemoteWipeRequestAsync(string id) { + this.CancelRemoteWipeRequestAsync(id, null); + } + + /// + public void CancelRemoteWipeRequestAsync(string id, object userState) { + if ((this.CancelRemoteWipeRequestOperationCompleted == null)) { + this.CancelRemoteWipeRequestOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCancelRemoteWipeRequestOperationCompleted); + } + this.InvokeAsync("CancelRemoteWipeRequest", new object[] { + id}, this.CancelRemoteWipeRequestOperationCompleted, userState); + } + + private void OnCancelRemoteWipeRequestOperationCompleted(object arg) { + if ((this.CancelRemoteWipeRequestCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CancelRemoteWipeRequestCompleted(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/RemoveDevice", 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 RemoveDevice(string id) { + this.Invoke("RemoveDevice", new object[] { + id}); + } + + /// + public System.IAsyncResult BeginRemoveDevice(string id, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("RemoveDevice", new object[] { + id}, callback, asyncState); + } + + /// + public void EndRemoveDevice(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void RemoveDeviceAsync(string id) { + this.RemoveDeviceAsync(id, null); + } + + /// + public void RemoveDeviceAsync(string id, object userState) { + if ((this.RemoveDeviceOperationCompleted == null)) { + this.RemoveDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveDeviceOperationCompleted); + } + this.InvokeAsync("RemoveDevice", new object[] { + id}, this.RemoveDeviceOperationCompleted, userState); + } + + private void OnRemoveDeviceOperationCompleted(object arg) { + if ((this.RemoveDeviceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); } } - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void WipeDataFromDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void CancelRemoteWipeRequestCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void RemoveDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void CheckAccountCredentialsCompletedEventHandler(object sender, CheckAccountCredentialsCompletedEventArgs e); @@ -4231,6 +3977,32 @@ namespace WebsitePanel.Providers.Exchange } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CreateOrganizationAddressBookPolicyCompletedEventHandler(object sender, CreateOrganizationAddressBookPolicyCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateOrganizationAddressBookPolicyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateOrganizationAddressBookPolicyCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public Organization Result { + get { + this.RaiseExceptionIfNecessary(); + return ((Organization)(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void DeleteOrganizationCompletedEventHandler(object sender, DeleteOrganizationCompletedEventArgs e); @@ -4321,32 +4093,6 @@ namespace WebsitePanel.Providers.Exchange [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void DeleteAuthoritativeDomainCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void CreateMailboxCompletedEventHandler(object sender, CreateMailboxCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateMailboxCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal CreateMailboxCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public string Result { - get { - this.RaiseExceptionIfNecessary(); - return ((string)(this.results[0])); - } - } - } - /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void DeleteMailboxCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); @@ -5008,4 +4754,16 @@ namespace WebsitePanel.Providers.Exchange } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void WipeDataFromDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CancelRemoteWipeRequestCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void RemoveDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs new file mode 100644 index 00000000..49a11f35 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs @@ -0,0 +1,912 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.5456 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by wsdl, Version=2.0.50727.42. +// +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Providers.Lync +{ + using System.Xml.Serialization; + using System.Web.Services; + using System.ComponentModel; + using System.Web.Services.Protocols; + using System; + using System.Diagnostics; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name = "LyncServerSoap", Namespace = "http://smbsaas/websitepanel/server/")] + public partial class LyncServer : Microsoft.Web.Services3.WebServicesClientProtocol + { + + public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; + + private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted; + + private System.Threading.SendOrPostCallback CreateUserOperationCompleted; + + private System.Threading.SendOrPostCallback GetLyncUserGeneralSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback SetLyncUserPlanOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteUserOperationCompleted; + + private System.Threading.SendOrPostCallback GetFederationDomainsOperationCompleted; + + private System.Threading.SendOrPostCallback AddFederationDomainOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveFederationDomainOperationCompleted; + + private System.Threading.SendOrPostCallback ReloadConfigurationOperationCompleted; + + /// + public LyncServer() + { + this.Url = "http://localhost:9003/LyncServer.asmx"; + } + + /// + public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted; + + /// + public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted; + + /// + public event CreateUserCompletedEventHandler CreateUserCompleted; + + /// + public event GetLyncUserGeneralSettingsCompletedEventHandler GetLyncUserGeneralSettingsCompleted; + + /// + public event SetLyncUserPlanCompletedEventHandler SetLyncUserPlanCompleted; + + /// + public event DeleteUserCompletedEventHandler DeleteUserCompleted; + + /// + public event GetFederationDomainsCompletedEventHandler GetFederationDomainsCompleted; + + /// + public event AddFederationDomainCompletedEventHandler AddFederationDomainCompleted; + + /// + public event RemoveFederationDomainCompletedEventHandler RemoveFederationDomainCompleted; + + /// + public event ReloadConfigurationCompletedEventHandler ReloadConfigurationCompleted; + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateOrganization", 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 string CreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) + { + object[] results = this.Invoke("CreateOrganization", new object[] { + organizationId, + sipDomain, + enableConferencing, + enableConferencingVideo, + maxConferenceSize, + enabledFederation, + enabledEnterpriseVoice}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("CreateOrganization", new object[] { + organizationId, + sipDomain, + enableConferencing, + enableConferencingVideo, + maxConferenceSize, + enabledFederation, + enabledEnterpriseVoice}, callback, asyncState); + } + + /// + public string EndCreateOrganization(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void CreateOrganizationAsync(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) + { + this.CreateOrganizationAsync(organizationId, sipDomain, enableConferencing, enableConferencingVideo, maxConferenceSize, enabledFederation, enabledEnterpriseVoice, null); + } + + /// + public void CreateOrganizationAsync(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice, object userState) + { + if ((this.CreateOrganizationOperationCompleted == null)) + { + this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted); + } + this.InvokeAsync("CreateOrganization", new object[] { + organizationId, + sipDomain, + enableConferencing, + enableConferencingVideo, + maxConferenceSize, + enabledFederation, + enabledEnterpriseVoice}, this.CreateOrganizationOperationCompleted, userState); + } + + private void OnCreateOrganizationOperationCompleted(object arg) + { + if ((this.CreateOrganizationCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateOrganizationCompleted(this, new CreateOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteOrganization", 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 DeleteOrganization(string organizationId, string sipDomain) + { + object[] results = this.Invoke("DeleteOrganization", new object[] { + organizationId, + sipDomain}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteOrganization(string organizationId, string sipDomain, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("DeleteOrganization", new object[] { + organizationId, + sipDomain}, callback, asyncState); + } + + /// + public bool EndDeleteOrganization(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void DeleteOrganizationAsync(string organizationId, string sipDomain) + { + this.DeleteOrganizationAsync(organizationId, sipDomain, null); + } + + /// + public void DeleteOrganizationAsync(string organizationId, string sipDomain, object userState) + { + if ((this.DeleteOrganizationOperationCompleted == null)) + { + this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted); + } + this.InvokeAsync("DeleteOrganization", new object[] { + organizationId, + sipDomain}, this.DeleteOrganizationOperationCompleted, userState); + } + + private void OnDeleteOrganizationOperationCompleted(object arg) + { + if ((this.DeleteOrganizationCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteOrganizationCompleted(this, new DeleteOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateUser", 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 CreateUser(string organizationId, string userUpn, LyncUserPlan plan) + { + object[] results = this.Invoke("CreateUser", new object[] { + organizationId, + userUpn, + plan}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateUser(string organizationId, string userUpn, LyncUserPlan plan, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("CreateUser", new object[] { + organizationId, + userUpn, + plan}, callback, asyncState); + } + + /// + public bool EndCreateUser(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void CreateUserAsync(string organizationId, string userUpn, LyncUserPlan plan) + { + this.CreateUserAsync(organizationId, userUpn, plan, null); + } + + /// + public void CreateUserAsync(string organizationId, string userUpn, LyncUserPlan plan, object userState) + { + if ((this.CreateUserOperationCompleted == null)) + { + this.CreateUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateUserOperationCompleted); + } + this.InvokeAsync("CreateUser", new object[] { + organizationId, + userUpn, + plan}, this.CreateUserOperationCompleted, userState); + } + + private void OnCreateUserOperationCompleted(object arg) + { + if ((this.CreateUserCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateUserCompleted(this, new CreateUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetLyncUserGeneralSettings", 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 LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn) + { + object[] results = this.Invoke("GetLyncUserGeneralSettings", new object[] { + organizationId, + userUpn}); + return ((LyncUser)(results[0])); + } + + /// + public System.IAsyncResult BeginGetLyncUserGeneralSettings(string organizationId, string userUpn, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetLyncUserGeneralSettings", new object[] { + organizationId, + userUpn}, callback, asyncState); + } + + /// + public LyncUser EndGetLyncUserGeneralSettings(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUser)(results[0])); + } + + /// + public void GetLyncUserGeneralSettingsAsync(string organizationId, string userUpn) + { + this.GetLyncUserGeneralSettingsAsync(organizationId, userUpn, null); + } + + /// + public void GetLyncUserGeneralSettingsAsync(string organizationId, string userUpn, object userState) + { + if ((this.GetLyncUserGeneralSettingsOperationCompleted == null)) + { + this.GetLyncUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUserGeneralSettingsOperationCompleted); + } + this.InvokeAsync("GetLyncUserGeneralSettings", new object[] { + organizationId, + userUpn}, this.GetLyncUserGeneralSettingsOperationCompleted, userState); + } + + private void OnGetLyncUserGeneralSettingsOperationCompleted(object arg) + { + if ((this.GetLyncUserGeneralSettingsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetLyncUserGeneralSettingsCompleted(this, new GetLyncUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetLyncUserPlan", 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 SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) + { + object[] results = this.Invoke("SetLyncUserPlan", new object[] { + organizationId, + userUpn, + plan}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginSetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SetLyncUserPlan", new object[] { + organizationId, + userUpn, + plan}, callback, asyncState); + } + + /// + public bool EndSetLyncUserPlan(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void SetLyncUserPlanAsync(string organizationId, string userUpn, LyncUserPlan plan) + { + this.SetLyncUserPlanAsync(organizationId, userUpn, plan, null); + } + + /// + public void SetLyncUserPlanAsync(string organizationId, string userUpn, LyncUserPlan plan, object userState) + { + if ((this.SetLyncUserPlanOperationCompleted == null)) + { + this.SetLyncUserPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetLyncUserPlanOperationCompleted); + } + this.InvokeAsync("SetLyncUserPlan", new object[] { + organizationId, + userUpn, + plan}, this.SetLyncUserPlanOperationCompleted, userState); + } + + private void OnSetLyncUserPlanOperationCompleted(object arg) + { + if ((this.SetLyncUserPlanCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetLyncUserPlanCompleted(this, new SetLyncUserPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteUser", 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 DeleteUser(string userUpn) + { + object[] results = this.Invoke("DeleteUser", new object[] { + userUpn}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteUser(string userUpn, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("DeleteUser", new object[] { + userUpn}, callback, asyncState); + } + + /// + public bool EndDeleteUser(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void DeleteUserAsync(string userUpn) + { + this.DeleteUserAsync(userUpn, null); + } + + /// + public void DeleteUserAsync(string userUpn, object userState) + { + if ((this.DeleteUserOperationCompleted == null)) + { + this.DeleteUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteUserOperationCompleted); + } + this.InvokeAsync("DeleteUser", new object[] { + userUpn}, this.DeleteUserOperationCompleted, userState); + } + + private void OnDeleteUserOperationCompleted(object arg) + { + if ((this.DeleteUserCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteUserCompleted(this, new DeleteUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFederationDomains", 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 LyncFederationDomain[] GetFederationDomains(string organizationId) + { + object[] results = this.Invoke("GetFederationDomains", new object[] { + organizationId}); + return ((LyncFederationDomain[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetFederationDomains(string organizationId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetFederationDomains", new object[] { + organizationId}, callback, asyncState); + } + + /// + public LyncFederationDomain[] EndGetFederationDomains(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((LyncFederationDomain[])(results[0])); + } + + /// + public void GetFederationDomainsAsync(string organizationId) + { + this.GetFederationDomainsAsync(organizationId, null); + } + + /// + public void GetFederationDomainsAsync(string organizationId, object userState) + { + if ((this.GetFederationDomainsOperationCompleted == null)) + { + this.GetFederationDomainsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFederationDomainsOperationCompleted); + } + this.InvokeAsync("GetFederationDomains", new object[] { + organizationId}, this.GetFederationDomainsOperationCompleted, userState); + } + + private void OnGetFederationDomainsOperationCompleted(object arg) + { + if ((this.GetFederationDomainsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetFederationDomainsCompleted(this, new GetFederationDomainsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddFederationDomain", 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 AddFederationDomain(string organizationId, string domainName, string proxyFqdn) + { + object[] results = this.Invoke("AddFederationDomain", new object[] { + organizationId, + domainName, + proxyFqdn}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginAddFederationDomain(string organizationId, string domainName, string proxyFqdn, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddFederationDomain", new object[] { + organizationId, + domainName, + proxyFqdn}, callback, asyncState); + } + + /// + public bool EndAddFederationDomain(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void AddFederationDomainAsync(string organizationId, string domainName, string proxyFqdn) + { + this.AddFederationDomainAsync(organizationId, domainName, proxyFqdn, null); + } + + /// + public void AddFederationDomainAsync(string organizationId, string domainName, string proxyFqdn, object userState) + { + if ((this.AddFederationDomainOperationCompleted == null)) + { + this.AddFederationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddFederationDomainOperationCompleted); + } + this.InvokeAsync("AddFederationDomain", new object[] { + organizationId, + domainName, + proxyFqdn}, this.AddFederationDomainOperationCompleted, userState); + } + + private void OnAddFederationDomainOperationCompleted(object arg) + { + if ((this.AddFederationDomainCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddFederationDomainCompleted(this, new AddFederationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveFederationDomain", 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 RemoveFederationDomain(string organizationId, string domainName) + { + object[] results = this.Invoke("RemoveFederationDomain", new object[] { + organizationId, + domainName}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginRemoveFederationDomain(string organizationId, string domainName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("RemoveFederationDomain", new object[] { + organizationId, + domainName}, callback, asyncState); + } + + /// + public bool EndRemoveFederationDomain(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void RemoveFederationDomainAsync(string organizationId, string domainName) + { + this.RemoveFederationDomainAsync(organizationId, domainName, null); + } + + /// + public void RemoveFederationDomainAsync(string organizationId, string domainName, object userState) + { + if ((this.RemoveFederationDomainOperationCompleted == null)) + { + this.RemoveFederationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveFederationDomainOperationCompleted); + } + this.InvokeAsync("RemoveFederationDomain", new object[] { + organizationId, + domainName}, this.RemoveFederationDomainOperationCompleted, userState); + } + + private void OnRemoveFederationDomainOperationCompleted(object arg) + { + if ((this.RemoveFederationDomainCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveFederationDomainCompleted(this, new RemoveFederationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ReloadConfiguration", 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 ReloadConfiguration() + { + this.Invoke("ReloadConfiguration", new object[0]); + } + + /// + public System.IAsyncResult BeginReloadConfiguration(System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("ReloadConfiguration", new object[0], callback, asyncState); + } + + /// + public void EndReloadConfiguration(System.IAsyncResult asyncResult) + { + this.EndInvoke(asyncResult); + } + + /// + public void ReloadConfigurationAsync() + { + this.ReloadConfigurationAsync(null); + } + + /// + public void ReloadConfigurationAsync(object userState) + { + if ((this.ReloadConfigurationOperationCompleted == null)) + { + this.ReloadConfigurationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnReloadConfigurationOperationCompleted); + } + this.InvokeAsync("ReloadConfiguration", new object[0], this.ReloadConfigurationOperationCompleted, userState); + } + + private void OnReloadConfigurationOperationCompleted(object arg) + { + if ((this.ReloadConfigurationCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ReloadConfigurationCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) + { + base.CancelAsync(userState); + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public string Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteOrganizationCompletedEventHandler(object sender, DeleteOrganizationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal DeleteOrganizationCompletedEventArgs(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.42")] + public delegate void CreateUserCompletedEventHandler(object sender, CreateUserCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal CreateUserCompletedEventArgs(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.42")] + public delegate void GetLyncUserGeneralSettingsCompletedEventHandler(object sender, GetLyncUserGeneralSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetLyncUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetLyncUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public LyncUser Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((LyncUser)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetLyncUserPlanCompletedEventHandler(object sender, SetLyncUserPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SetLyncUserPlanCompletedEventArgs(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.42")] + public delegate void DeleteUserCompletedEventHandler(object sender, DeleteUserCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal DeleteUserCompletedEventArgs(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.42")] + public delegate void GetFederationDomainsCompletedEventHandler(object sender, GetFederationDomainsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetFederationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetFederationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public LyncFederationDomain[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((LyncFederationDomain[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddFederationDomainCompletedEventHandler(object sender, AddFederationDomainCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddFederationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal AddFederationDomainCompletedEventArgs(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.42")] + public delegate void RemoveFederationDomainCompletedEventHandler(object sender, RemoveFederationDomainCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class RemoveFederationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal RemoveFederationDomainCompletedEventArgs(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.42")] + public delegate void ReloadConfigurationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); +} diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs index ed96ad4f..8121e66d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs @@ -1,35 +1,7 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 +// Runtime Version:2.0.50727.5456 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -39,17 +11,17 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.42. // -using WebsitePanel.Providers.Common; -using WebsitePanel.Providers.ResultObjects; - namespace WebsitePanel.Providers.HostedSolution { - using System.Diagnostics; + using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; - using System.Xml.Serialization; - + using System.Diagnostics; + + using WebsitePanel.Providers.Common; + using WebsitePanel.Providers.ResultObjects; + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] @@ -72,7 +44,7 @@ namespace WebsitePanel.Providers.HostedSolution { private System.Threading.SendOrPostCallback DeleteUserOperationCompleted; - private System.Threading.SendOrPostCallback GeUserGeneralSettingsOperationCompleted; + private System.Threading.SendOrPostCallback GetUserGeneralSettingsOperationCompleted; private System.Threading.SendOrPostCallback SetUserGeneralSettingsOperationCompleted; @@ -82,9 +54,11 @@ namespace WebsitePanel.Providers.HostedSolution { private System.Threading.SendOrPostCallback GetPasswordPolicyOperationCompleted; + private System.Threading.SendOrPostCallback GetSamAccountNameByUserPrincipalNameOperationCompleted; + /// public Organizations() { - this.Url = "http://exchange-dev:9003/Organizations.asmx"; + this.Url = "http://localhost:9006/Organizations.asmx"; } /// @@ -103,7 +77,7 @@ namespace WebsitePanel.Providers.HostedSolution { public event DeleteUserCompletedEventHandler DeleteUserCompleted; /// - public event GeUserGeneralSettingsCompletedEventHandler GeUserGeneralSettingsCompleted; + public event GetUserGeneralSettingsCompletedEventHandler GetUserGeneralSettingsCompleted; /// public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted; @@ -117,6 +91,9 @@ namespace WebsitePanel.Providers.HostedSolution { /// public event GetPasswordPolicyCompletedEventHandler GetPasswordPolicyCompleted; + /// + public event GetSamAccountNameByUserPrincipalNameCompletedEventHandler GetSamAccountNameByUserPrincipalNameCompleted; + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/OrganizationExists", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -244,14 +221,15 @@ namespace WebsitePanel.Providers.HostedSolution { /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) { - this.Invoke("CreateUser", new object[] { + public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) { + object[] results = this.Invoke("CreateUser", new object[] { organizationId, loginName, displayName, upn, password, enabled}); + return ((int)(results[0])); } /// @@ -266,8 +244,9 @@ namespace WebsitePanel.Providers.HostedSolution { } /// - public void EndCreateUser(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); + public int EndCreateUser(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); } /// @@ -292,7 +271,7 @@ namespace WebsitePanel.Providers.HostedSolution { private void OnCreateUserOperationCompleted(object arg) { if ((this.CreateUserCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.CreateUserCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + this.CreateUserCompleted(this, new CreateUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } @@ -341,46 +320,46 @@ namespace WebsitePanel.Providers.HostedSolution { /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GeUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationUser GeUserGeneralSettings(string loginName, string organizationId) { - object[] results = this.Invoke("GeUserGeneralSettings", new object[] { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUser GetUserGeneralSettings(string loginName, string organizationId) { + object[] results = this.Invoke("GetUserGeneralSettings", new object[] { loginName, organizationId}); return ((OrganizationUser)(results[0])); } /// - public System.IAsyncResult BeginGeUserGeneralSettings(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GeUserGeneralSettings", new object[] { + public System.IAsyncResult BeginGetUserGeneralSettings(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetUserGeneralSettings", new object[] { loginName, organizationId}, callback, asyncState); } /// - public OrganizationUser EndGeUserGeneralSettings(System.IAsyncResult asyncResult) { + public OrganizationUser EndGetUserGeneralSettings(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((OrganizationUser)(results[0])); } /// - public void GeUserGeneralSettingsAsync(string loginName, string organizationId) { - this.GeUserGeneralSettingsAsync(loginName, organizationId, null); + public void GetUserGeneralSettingsAsync(string loginName, string organizationId) { + this.GetUserGeneralSettingsAsync(loginName, organizationId, null); } /// - public void GeUserGeneralSettingsAsync(string loginName, string organizationId, object userState) { - if ((this.GeUserGeneralSettingsOperationCompleted == null)) { - this.GeUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGeUserGeneralSettingsOperationCompleted); + public void GetUserGeneralSettingsAsync(string loginName, string organizationId, object userState) { + if ((this.GetUserGeneralSettingsOperationCompleted == null)) { + this.GetUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUserGeneralSettingsOperationCompleted); } - this.InvokeAsync("GeUserGeneralSettings", new object[] { + this.InvokeAsync("GetUserGeneralSettings", new object[] { loginName, - organizationId}, this.GeUserGeneralSettingsOperationCompleted, userState); + organizationId}, this.GetUserGeneralSettingsOperationCompleted, userState); } - private void OnGeUserGeneralSettingsOperationCompleted(object arg) { - if ((this.GeUserGeneralSettingsCompleted != null)) { + private void OnGetUserGeneralSettingsOperationCompleted(object arg) { + if ((this.GetUserGeneralSettingsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GeUserGeneralSettingsCompleted(this, new GeUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + this.GetUserGeneralSettingsCompleted(this, new GetUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } @@ -745,21 +724,57 @@ namespace WebsitePanel.Providers.HostedSolution { } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetSamAccountNameByUserPrincipalName", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName) { + object[] results = this.Invoke("GetSamAccountNameByUserPrincipalName", new object[] { + organizationId, + userPrincipalName}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginGetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetSamAccountNameByUserPrincipalName", new object[] { + organizationId, + userPrincipalName}, callback, asyncState); + } + + /// + public string EndGetSamAccountNameByUserPrincipalName(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void GetSamAccountNameByUserPrincipalNameAsync(string organizationId, string userPrincipalName) { + this.GetSamAccountNameByUserPrincipalNameAsync(organizationId, userPrincipalName, null); + } + + /// + public void GetSamAccountNameByUserPrincipalNameAsync(string organizationId, string userPrincipalName, object userState) { + if ((this.GetSamAccountNameByUserPrincipalNameOperationCompleted == null)) { + this.GetSamAccountNameByUserPrincipalNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSamAccountNameByUserPrincipalNameOperationCompleted); + } + this.InvokeAsync("GetSamAccountNameByUserPrincipalName", new object[] { + organizationId, + userPrincipalName}, this.GetSamAccountNameByUserPrincipalNameOperationCompleted, userState); + } + + private void OnGetSamAccountNameByUserPrincipalNameOperationCompleted(object arg) { + if ((this.GetSamAccountNameByUserPrincipalNameCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetSamAccountNameByUserPrincipalNameCompleted(this, new GetSamAccountNameByUserPrincipalNameCompletedEventArgs(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.42")] public delegate void OrganizationExistsCompletedEventHandler(object sender, OrganizationExistsCompletedEventArgs e); @@ -818,7 +833,29 @@ namespace WebsitePanel.Providers.HostedSolution { /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void CreateUserCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + public delegate void CreateUserCompletedEventHandler(object sender, CreateUserCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateUserCompletedEventArgs(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])); + } + } + } /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] @@ -826,17 +863,17 @@ namespace WebsitePanel.Providers.HostedSolution { /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GeUserGeneralSettingsCompletedEventHandler(object sender, GeUserGeneralSettingsCompletedEventArgs e); + public delegate void GetUserGeneralSettingsCompletedEventHandler(object sender, GetUserGeneralSettingsCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GeUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - internal GeUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + internal GetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } @@ -887,4 +924,30 @@ namespace WebsitePanel.Providers.HostedSolution { } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetSamAccountNameByUserPrincipalNameCompletedEventHandler(object sender, GetSamAccountNameByUserPrincipalNameCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetSamAccountNameByUserPrincipalNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetSamAccountNameByUserPrincipalNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj index 37f746e8..44b375f0 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj @@ -78,10 +78,10 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Utils/Log.cs b/WebsitePanel/Sources/WebsitePanel.Server.Utils/Log.cs index be3ea63f..e645d9f5 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Utils/Log.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Utils/Log.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2011, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -31,125 +31,125 @@ using System.Diagnostics; namespace WebsitePanel.Server.Utils { - /// - /// Application log. - /// - public sealed class Log - { + /// + /// Application log. + /// + public sealed class Log + { private static TraceSwitch logSeverity = new TraceSwitch("Log", "General trace switch"); - - private Log() - { - } - /// - /// Write error to the log. - /// - /// Error message. - /// Exception. - public static void WriteError(string message, Exception ex) - { - try - { - if (logSeverity.TraceError) - { - string line = string.Format("[{0:G}] ERROR: {1}\n{2}\n", DateTime.Now, message, ex); - Trace.TraceError(line); - } - } - catch { } - } + private Log() + { + } - /// - /// Write error to the log. - /// - /// Exception. - public static void WriteError(Exception ex) - { + /// + /// Write error to the log. + /// + /// Error message. + /// Exception. + public static void WriteError(string message, Exception ex) + { + try + { + if (logSeverity.TraceError) + { + string line = string.Format("[{0:G}] ERROR: {1}\n{2}\n", DateTime.Now, message, ex); + Trace.TraceError(line); + } + } + catch { } + } - try - { - if (ex != null) - { - WriteError(ex.Message, ex); - } - } - catch { } - } + /// + /// Write error to the log. + /// + /// Exception. + public static void WriteError(Exception ex) + { - /// - /// Write info message to log - /// - /// - public static void WriteInfo(string message, params object[] args) - { - try - { - if (logSeverity.TraceInfo) - { - Trace.TraceInformation(FormatIncomingMessage(message, args)); - } - } - catch { } - } + try + { + if (ex != null) + { + WriteError(ex.Message, ex); + } + } + catch { } + } - /// - /// Write info message to log - /// - /// - public static void WriteWarning(string message, params object[] args) - { - try - { - if (logSeverity.TraceWarning) - { - Trace.TraceWarning(FormatIncomingMessage(message, args)); - } - } - catch { } - } + /// + /// Write info message to log + /// + /// + public static void WriteInfo(string message, params object[] args) + { + try + { + if (logSeverity.TraceInfo) + { + Trace.TraceInformation(FormatIncomingMessage(message, "INFO", args)); + } + } + catch { } + } - /// - /// Write start message to log - /// - /// + /// + /// Write info message to log + /// + /// + public static void WriteWarning(string message, params object[] args) + { + try + { + if (logSeverity.TraceWarning) + { + Trace.TraceWarning(FormatIncomingMessage(message, "WARNING", args)); + } + } + catch { } + } + + /// + /// Write start message to log + /// + /// public static void WriteStart(string message, params object[] args) - { - try - { - if (logSeverity.TraceInfo) - { - Trace.TraceInformation(FormatIncomingMessage(message, args)); - } - } - catch { } - } - - /// - /// Write end message to log - /// - /// - public static void WriteEnd(string message, params object[] args) - { - try - { - if (logSeverity.TraceInfo) - { - Trace.TraceInformation(FormatIncomingMessage(message, args)); - } - } - catch { } - } + { + try + { + if (logSeverity.TraceInfo) + { + Trace.TraceInformation(FormatIncomingMessage(message, "START", args)); + } + } + catch { } + } - private static string FormatIncomingMessage(string message, params object[] args) - { - // - if (args.Length > 0) - { - message = String.Format(message, args); - } - // - return String.Concat(String.Format("[{0:G}] END: ", DateTime.Now), message); - } - } + /// + /// Write end message to log + /// + /// + public static void WriteEnd(string message, params object[] args) + { + try + { + if (logSeverity.TraceInfo) + { + Trace.TraceInformation(FormatIncomingMessage(message, "END", args)); + } + } + catch { } + } + + private static string FormatIncomingMessage(string message, string tag, params object[] args) + { + // + if (args.Length > 0) + { + message = String.Format(message, args); + } + // + return String.Concat(String.Format("[{0:G}] {1}: ", DateTime.Now, tag), message); + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Utils/SecurityUtils.cs b/WebsitePanel/Sources/WebsitePanel.Server.Utils/SecurityUtils.cs index 5e87756b..7a3f5d77 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Utils/SecurityUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Utils/SecurityUtils.cs @@ -507,6 +507,11 @@ namespace WebsitePanel.Providers.Utils { if (serverSettings.ADEnabled) { + if (user.Name.IndexOf("\\") != -1) + { + string[] tmpStr = user.Name.Split('\\'); + user.Name = tmpStr[1]; + } //check is user name less than 20 symbols if (user.Name.Length > 20) @@ -538,6 +543,13 @@ namespace WebsitePanel.Providers.Utils SetObjectProperty(objUser, "UserPrincipalName", user.Name); SetObjectProperty(objUser, "sAMAccountName", user.Name); SetObjectProperty(objUser, "UserPassword", user.Password); + + if (user.MsIIS_FTPDir != string.Empty) + { + SetObjectProperty(objUser, "msIIS-FTPDir", user.MsIIS_FTPDir); + SetObjectProperty(objUser, "msIIS-FTPRoot", user.MsIIS_FTPRoot); + } + objUser.Properties["userAccountControl"].Value = ADAccountOptions.UF_NORMAL_ACCOUNT | ADAccountOptions.UF_PASSWD_NOTREQD; objUser.CommitChanges(); diff --git a/WebsitePanel/Sources/WebsitePanel.Server.sln b/WebsitePanel/Sources/WebsitePanel.Server.sln index 715e7c13..c4b625b2 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.sln +++ b/WebsitePanel/Sources/WebsitePanel.Server.sln @@ -93,8 +93,6 @@ Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WebsitePanel.Providers.Mail EndProject Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "WebsitePanel.Providers.Mail.hMailServer5", "WebsitePanel.Providers.Mail.hMail5\WebsitePanel.Providers.Mail.hMailServer5.vbproj", "{8F644D50-D602-4AD3-8EB0-CA3C3676B18D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.ExchangeHostedEdition", "WebsitePanel.Providers.ExchangeHostedEdition\WebsitePanel.Providers.ExchangeHostedEdition.csproj", "{5D30E0E3-7AAD-4BE1-8043-3F3E9994D321}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Mail.SmarterMail7", "WebsitePanel.Providers.Mail.SmarterMail7\WebsitePanel.Providers.Mail.SmarterMail7.csproj", "{FB773A2C-1CD3-4D76-9C4F-B6B7EB9E479C}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.VirtualizationForPC.HyperVForPC", "WebsitePanel.Providers.Virtualization.HyperVForPC\WebsitePanel.Providers.VirtualizationForPC.HyperVForPC.csproj", "{64BEEB10-7F9F-4860-B2FF-84CDA02766B3}" @@ -267,10 +265,6 @@ Global {8F644D50-D602-4AD3-8EB0-CA3C3676B18D}.Debug|Any CPU.Build.0 = Debug|Any CPU {8F644D50-D602-4AD3-8EB0-CA3C3676B18D}.Release|Any CPU.ActiveCfg = Release|Any CPU {8F644D50-D602-4AD3-8EB0-CA3C3676B18D}.Release|Any CPU.Build.0 = Release|Any CPU - {5D30E0E3-7AAD-4BE1-8043-3F3E9994D321}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5D30E0E3-7AAD-4BE1-8043-3F3E9994D321}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5D30E0E3-7AAD-4BE1-8043-3F3E9994D321}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5D30E0E3-7AAD-4BE1-8043-3F3E9994D321}.Release|Any CPU.Build.0 = Release|Any CPU {FB773A2C-1CD3-4D76-9C4F-B6B7EB9E479C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {FB773A2C-1CD3-4D76-9C4F-B6B7EB9E479C}.Debug|Any CPU.Build.0 = Debug|Any CPU {FB773A2C-1CD3-4D76-9C4F-B6B7EB9E479C}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServer.asmx.cs index 04617336..c7f05931 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServer.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServer.asmx.cs @@ -68,41 +68,43 @@ namespace WebsitePanel.Server } } - #region Organizations - - [WebMethod, SoapHeader("settings")] - public Organization ExtendToExchangeOrganization(string organizationId, string securityGroup) - { - try - { - LogStart("ExtendToExchangeOrganization"); - Organization ret = ES.ExtendToExchangeOrganization(organizationId, securityGroup); - LogEnd("ExtendToExchangeOrganization"); - return ret; - } - catch (Exception ex) - { - LogError("ExtendToExchangeOrganization", ex); - throw; - } - } + #region Organizations [WebMethod, SoapHeader("settings")] - public string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, - string mailboxDatabase, string offlineAddressBook, + public Organization ExtendToExchangeOrganization(string organizationId, string securityGroup, bool IsConsumer) + { + try + { + LogStart("ExtendToExchangeOrganization"); + Organization ret = ES.ExtendToExchangeOrganization(organizationId, securityGroup, IsConsumer); + LogEnd("ExtendToExchangeOrganization"); + return ret; + } + catch (Exception ex) + { + LogError("ExtendToExchangeOrganization", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, + string mailboxDatabase, string offlineAddressBook, string addressBookPolicy, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, + int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook, bool isConsumer) { try { LogStart("CreateMailEnableUser"); - string ret = ES.CreateMailEnableUser(upn, organizationId, organizationDistinguishedName,accountType, - mailboxDatabase, offlineAddressBook, + string ret = ES.CreateMailEnableUser(upn, organizationId, organizationDistinguishedName, accountType, + mailboxDatabase, offlineAddressBook, addressBookPolicy, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays); + keepDeletedItemsDays, + maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, hideFromAddressBook, isConsumer); LogEnd("CreateMailEnableUser"); return ret; } @@ -113,137 +115,155 @@ namespace WebsitePanel.Server } } - /// - /// Creates organization OAB - /// - /// - /// - /// - /// - [WebMethod, SoapHeader("settings")] - public Organization CreateOrganizationOfflineAddressBook(string organizationId, string securityGroup, string oabVirtualDir) - { - try - { - LogStart("CreateOrganizationOfflineAddressBook"); - Organization ret = ES.CreateOrganizationOfflineAddressBook(organizationId, securityGroup, oabVirtualDir); - LogEnd("CreateOrganizationOfflineAddressBook"); - return ret; - } - catch (Exception ex) - { - LogError("CreateOrganizationOfflineAddressBook", ex); - throw; - } - } + /// + /// Creates organization OAB + /// + /// + /// + /// + /// + [WebMethod, SoapHeader("settings")] + public Organization CreateOrganizationOfflineAddressBook(string organizationId, string securityGroup, string oabVirtualDir) + { + try + { + LogStart("CreateOrganizationOfflineAddressBook"); + Organization ret = ES.CreateOrganizationOfflineAddressBook(organizationId, securityGroup, oabVirtualDir); + LogEnd("CreateOrganizationOfflineAddressBook"); + return ret; + } + catch (Exception ex) + { + LogError("CreateOrganizationOfflineAddressBook", ex); + throw; + } + } - /// - /// Updates organization OAB - /// - /// - [WebMethod, SoapHeader("settings")] - public void UpdateOrganizationOfflineAddressBook(string id) - { - try - { - LogStart("UpdateOrganizationOfflineAddressBook"); - ES.UpdateOrganizationOfflineAddressBook(id); - LogEnd("UpdateOrganizationOfflineAddressBook"); - } - catch (Exception ex) - { - LogError("UpdateOrganizationOfflineAddressBook", ex); - throw; - } - } + /// + /// Updates organization OAB + /// + /// + [WebMethod, SoapHeader("settings")] + public void UpdateOrganizationOfflineAddressBook(string id) + { + try + { + LogStart("UpdateOrganizationOfflineAddressBook"); + ES.UpdateOrganizationOfflineAddressBook(id); + LogEnd("UpdateOrganizationOfflineAddressBook"); + } + catch (Exception ex) + { + LogError("UpdateOrganizationOfflineAddressBook", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public string GetOABVirtualDirectory() - { - try - { - LogStart("GetOABVirtualDirectory"); - string ret = ES.GetOABVirtualDirectory(); - LogEnd("GetOABVirtualDirectory"); - return ret; - } - catch (Exception ex) - { - LogError("GetOABVirtualDirectory", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public string GetOABVirtualDirectory() + { + try + { + LogStart("GetOABVirtualDirectory"); + string ret = ES.GetOABVirtualDirectory(); + LogEnd("GetOABVirtualDirectory"); + return ret; + } + catch (Exception ex) + { + LogError("GetOABVirtualDirectory", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public bool DeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup) - { - try - { - LogStart("DeleteOrganization"); - bool ret = ES.DeleteOrganization(organizationId, distinguishedName, globalAddressList, addressList, roomsAddressList, offlineAddressBook, securityGroup); - LogEnd("DeleteOrganization"); - return ret; - } - catch (Exception ex) - { - LogError("DeleteOrganization", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public Organization CreateOrganizationAddressBookPolicy(string organizationId, string gal, string addressBook, string roomList, string oab) + { + try + { + LogStart("CCreateOrganizationAddressBookPolicy"); + Organization ret = ES.CreateOrganizationAddressBookPolicy(organizationId, gal, addressBook, roomList, oab); + LogEnd("CreateOrganizationAddressBookPolicy"); + return ret; + } + catch (Exception ex) + { + LogError("CreateOrganizationAddressBookPolicy", ex); + throw; + } + } + + + [WebMethod, SoapHeader("settings")] + public bool DeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy) + { + try + { + LogStart("DeleteOrganization"); + bool ret = ES.DeleteOrganization(organizationId, distinguishedName, globalAddressList, addressList, roomList, offlineAddressBook, securityGroup, addressBookPolicy); + LogEnd("DeleteOrganization"); + return ret; + } + catch (Exception ex) + { + LogError("DeleteOrganization", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetOrganizationStorageLimits(string organizationDistinguishedName, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) - { - try - { - LogStart("SetOrganizationStorageLimits"); - ES.SetOrganizationStorageLimits(organizationDistinguishedName, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); - LogEnd("SetOrganizationStorageLimits"); - } - catch (Exception ex) - { - LogError("SetOrganizationStorageLimits", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void SetOrganizationStorageLimits(string organizationDistinguishedName, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) + { + try + { + LogStart("SetOrganizationStorageLimits"); + ES.SetOrganizationStorageLimits(organizationDistinguishedName, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); + LogEnd("SetOrganizationStorageLimits"); + } + catch (Exception ex) + { + LogError("SetOrganizationStorageLimits", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public ExchangeItemStatistics[] GetMailboxesStatistics(string organizationDistinguishedName) - { - try - { - LogStart("GetMailboxesStatistics"); - ExchangeItemStatistics[] ret = ES.GetMailboxesStatistics(organizationDistinguishedName); - LogEnd("GetMailboxesStatistics"); - return ret; - } - catch (Exception ex) - { - LogError("GetMailboxesStatistics", ex); - throw; - } - } - #endregion + [WebMethod, SoapHeader("settings")] + public ExchangeItemStatistics[] GetMailboxesStatistics(string organizationDistinguishedName) + { + try + { + LogStart("GetMailboxesStatistics"); + ExchangeItemStatistics[] ret = ES.GetMailboxesStatistics(organizationDistinguishedName); + LogEnd("GetMailboxesStatistics"); + return ret; + } + catch (Exception ex) + { + LogError("GetMailboxesStatistics", ex); + throw; + } + } + #endregion - #region Domains - [WebMethod, SoapHeader("settings")] + #region Domains + [WebMethod, SoapHeader("settings")] public void AddAuthoritativeDomain(string domain) - { - try - { + { + try + { LogStart("AddAuthoritativeDomain"); ES.AddAuthoritativeDomain(domain); LogEnd("AddAuthoritativeDomain"); - } - catch (Exception ex) - { + } + catch (Exception ex) + { LogError("AddAuthoritativeDomain", ex); - throw; - } - } + throw; + } + } [WebMethod, SoapHeader("settings")] @@ -252,7 +272,7 @@ namespace WebsitePanel.Server try { LogStart("GetAuthoritativeDomains"); - string []ret = ES.GetAuthoritativeDomains(); + string[] ret = ES.GetAuthoritativeDomains(); LogEnd("GetAuthoritativeDomains"); return ret; } @@ -263,39 +283,41 @@ namespace WebsitePanel.Server } } - [WebMethod, SoapHeader("settings")] + [WebMethod, SoapHeader("settings")] public void DeleteAuthoritativeDomain(string domain) - { - try - { + { + try + { LogStart("DeleteAuthoritativeDomain"); ES.DeleteAuthoritativeDomain(domain); LogEnd("DeleteAuthoritativeDomain"); - } - catch (Exception ex) - { + } + catch (Exception ex) + { LogError("DeleteAuthoritativeDomain", ex); - throw; - } - } - #endregion + throw; + } + } + #endregion - #region Mailboxes + #region Mailboxes + /* [WebMethod, SoapHeader("settings")] public string CreateMailbox(string organizationId, string organizationDistinguishedName, string mailboxDatabase, - string securityGroup, string offlineAddressBook, ExchangeAccountType accountType, + string securityGroup, string offlineAddressBook, string addressBookPolicy, ExchangeAccountType accountType, string displayName, string accountName, string name, string domain, string password, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook) { try { LogStart("CreateMailbox"); string ret = ES.CreateMailbox(organizationId, organizationDistinguishedName, mailboxDatabase, securityGroup, - offlineAddressBook, accountType, + offlineAddressBook, addressBookPolicy, accountType, displayName, accountName, name, domain, password, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, - issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); + issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, + maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, hideFromAddressBook); LogEnd("CreateMailbox"); return ret; } @@ -305,22 +327,22 @@ namespace WebsitePanel.Server throw; } } - - [WebMethod, SoapHeader("settings")] - public void DeleteMailbox(string accountName) - { - try - { - LogStart("DeleteMailbox"); - ES.DeleteMailbox(accountName); - LogEnd("DeleteMailbox"); - } - catch (Exception ex) - { - LogError("DeleteMailbox", ex); - throw; - } - } +*/ + [WebMethod, SoapHeader("settings")] + public void DeleteMailbox(string accountName) + { + try + { + LogStart("DeleteMailbox"); + ES.DeleteMailbox(accountName); + LogEnd("DeleteMailbox"); + } + catch (Exception ex) + { + LogError("DeleteMailbox", ex); + throw; + } + } [WebMethod, SoapHeader("settings")] @@ -339,164 +361,164 @@ namespace WebsitePanel.Server } } - [WebMethod, SoapHeader("settings")] - public ExchangeMailbox GetMailboxGeneralSettings(string accountName) - { - try - { - LogStart("GetMailboxGeneralSettings"); - ExchangeMailbox ret = ES.GetMailboxGeneralSettings(accountName); - LogEnd("GetMailboxGeneralSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetMailboxGeneralSettings", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeMailbox GetMailboxGeneralSettings(string accountName) + { + try + { + LogStart("GetMailboxGeneralSettings"); + ExchangeMailbox ret = ES.GetMailboxGeneralSettings(accountName); + LogEnd("GetMailboxGeneralSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetMailboxGeneralSettings", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetMailboxGeneralSettings(string accountName, string displayName, string password, bool hideFromAddressBook, bool disabled, string firstName, string initials, string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes) - { - try - { - LogStart("SetMailboxGeneralSettings"); - ES.SetMailboxGeneralSettings(accountName, displayName, password, hideFromAddressBook, disabled, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes); - LogEnd("SetMailboxGeneralSettings"); - } - catch (Exception ex) - { - LogError("SetMailboxGeneralSettings", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void SetMailboxGeneralSettings(string accountName, bool hideFromAddressBook, bool disabled) + { + try + { + LogStart("SetMailboxGeneralSettings"); + ES.SetMailboxGeneralSettings(accountName, hideFromAddressBook, disabled); + LogEnd("SetMailboxGeneralSettings"); + } + catch (Exception ex) + { + LogError("SetMailboxGeneralSettings", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public ExchangeMailbox GetMailboxMailFlowSettings(string accountName) - { - try - { - LogStart("GetMailboxMailFlowSettings"); - ExchangeMailbox ret = ES.GetMailboxMailFlowSettings(accountName); - LogEnd("GetMailboxMailFlowSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetMailboxMailFlowSettings", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeMailbox GetMailboxMailFlowSettings(string accountName) + { + try + { + LogStart("GetMailboxMailFlowSettings"); + ExchangeMailbox ret = ES.GetMailboxMailFlowSettings(accountName); + LogEnd("GetMailboxMailFlowSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetMailboxMailFlowSettings", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication) - { - try - { - LogStart("SetMailboxMailFlowSettings"); - ES.SetMailboxMailFlowSettings(accountName, enableForwarding, forwardingAccountName, forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, requireSenderAuthentication); - LogEnd("SetMailboxMailFlowSettings"); - } - catch (Exception ex) - { - LogError("SetMailboxMailFlowSettings", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + try + { + LogStart("SetMailboxMailFlowSettings"); + ES.SetMailboxMailFlowSettings(accountName, enableForwarding, forwardingAccountName, forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, requireSenderAuthentication); + LogEnd("SetMailboxMailFlowSettings"); + } + catch (Exception ex) + { + LogError("SetMailboxMailFlowSettings", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public ExchangeMailbox GetMailboxAdvancedSettings(string accountName) - { - try - { - LogStart("GetMailboxAdvancedSettings"); - ExchangeMailbox ret = ES.GetMailboxAdvancedSettings(accountName); - LogEnd("GetMailboxAdvancedSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetMailboxAdvancedSettings", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeMailbox GetMailboxAdvancedSettings(string accountName) + { + try + { + LogStart("GetMailboxAdvancedSettings"); + ExchangeMailbox ret = ES.GetMailboxAdvancedSettings(accountName); + LogEnd("GetMailboxAdvancedSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetMailboxAdvancedSettings", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) - { - try - { - LogStart("SetMailboxAdvancedSettings"); - ES.SetMailboxAdvancedSettings(organizationId, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, - issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); - LogEnd("SetMailboxAdvancedSettings"); - } - catch (Exception ex) - { - LogError("SetMailboxAdvancedSettings", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB) + { + try + { + LogStart("SetMailboxAdvancedSettings"); + ES.SetMailboxAdvancedSettings(organizationId, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, + issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB); + LogEnd("SetMailboxAdvancedSettings"); + } + catch (Exception ex) + { + LogError("SetMailboxAdvancedSettings", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public ExchangeEmailAddress[] GetMailboxEmailAddresses(string accountName) - { - try - { - LogStart("GetMailboxEmailAddresses"); - ExchangeEmailAddress[] ret = ES.GetMailboxEmailAddresses(accountName); - LogEnd("GetMailboxEmailAddresses"); - return ret; - } - catch (Exception ex) - { - LogError("GetMailboxEmailAddresses", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeEmailAddress[] GetMailboxEmailAddresses(string accountName) + { + try + { + LogStart("GetMailboxEmailAddresses"); + ExchangeEmailAddress[] ret = ES.GetMailboxEmailAddresses(accountName); + LogEnd("GetMailboxEmailAddresses"); + return ret; + } + catch (Exception ex) + { + LogError("GetMailboxEmailAddresses", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetMailboxEmailAddresses(string accountName, string[] emailAddresses) - { - try - { - LogStart("SetMailboxEmailAddresses"); - ES.SetMailboxEmailAddresses(accountName, emailAddresses); - LogEnd("SetMailboxEmailAddresses"); - } - catch (Exception ex) - { - LogError("SetMailboxEmailAddresses", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void SetMailboxEmailAddresses(string accountName, string[] emailAddresses) + { + try + { + LogStart("SetMailboxEmailAddresses"); + ES.SetMailboxEmailAddresses(accountName, emailAddresses); + LogEnd("SetMailboxEmailAddresses"); + } + catch (Exception ex) + { + LogError("SetMailboxEmailAddresses", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetMailboxPrimaryEmailAddress(string accountName, string emailAddress) - { - try - { - LogStart("SetMailboxPrimaryEmailAddress"); - ES.SetMailboxPrimaryEmailAddress(accountName, emailAddress); - LogEnd("SetMailboxPrimaryEmailAddress"); - } - catch (Exception ex) - { - LogError("SetMailboxPrimaryEmailAddress", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void SetMailboxPrimaryEmailAddress(string accountName, string emailAddress) + { + try + { + LogStart("SetMailboxPrimaryEmailAddress"); + ES.SetMailboxPrimaryEmailAddress(accountName, emailAddress); + LogEnd("SetMailboxPrimaryEmailAddress"); + } + catch (Exception ex) + { + LogError("SetMailboxPrimaryEmailAddress", ex); + throw; + } + } [WebMethod, SoapHeader("settings")] - public void SetMailboxPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] fullAccessAccounts) + public void SetMailboxPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] fullAccessAccounts) { try { LogStart("SetMailboxPermissions"); - ES.SetMailboxPermissions(organizationId, accountName, sendAsAccounts, fullAccessAccounts); + ES.SetMailboxPermissions(organizationId, accountName, sendAsAccounts, fullAccessAccounts); LogEnd("SetMailboxPermissions"); } catch (Exception ex) @@ -505,16 +527,16 @@ namespace WebsitePanel.Server throw; } } - - + + [WebMethod, SoapHeader("settings")] - public ExchangeMailbox GetMailboxPermissions(string organizationId, string accountName) + public ExchangeMailbox GetMailboxPermissions(string organizationId, string accountName) { try { LogStart("GetMailboxPermissions"); - ExchangeMailbox ret = ES.GetMailboxPermissions(organizationId, accountName); + ExchangeMailbox ret = ES.GetMailboxPermissions(organizationId, accountName); LogEnd("GetMailboxPermissions"); return ret; } @@ -525,285 +547,285 @@ namespace WebsitePanel.Server } } - [WebMethod, SoapHeader("settings")] - public ExchangeMailboxStatistics GetMailboxStatistics(string accountName) - { - try - { - LogStart("GetMailboxStatistics"); - ExchangeMailboxStatistics ret = ES.GetMailboxStatistics(accountName); - LogEnd("GetMailboxStatistics"); - return ret; - } - catch (Exception ex) - { - Log.WriteError("GetMailboxStatistics", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeMailboxStatistics GetMailboxStatistics(string accountName) + { + try + { + LogStart("GetMailboxStatistics"); + ExchangeMailboxStatistics ret = ES.GetMailboxStatistics(accountName); + LogEnd("GetMailboxStatistics"); + return ret; + } + catch (Exception ex) + { + Log.WriteError("GetMailboxStatistics", ex); + throw; + } + } #endregion - #region Contacts - [WebMethod, SoapHeader("settings")] + #region Contacts + [WebMethod, SoapHeader("settings")] public void CreateContact(string organizationId, string organizationDistinguishedName, string contactDisplayName, string contactAccountName, string contactEmail, string defaultOrganizationDomain) - { - try - { - LogStart("CreateContact"); + { + try + { + LogStart("CreateContact"); ES.CreateContact(organizationId, organizationDistinguishedName, contactDisplayName, contactAccountName, contactEmail, defaultOrganizationDomain); - LogEnd("CreateContact"); - } - catch (Exception ex) - { - LogError("CreateContact", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void DeleteContact(string accountName) - { - try - { - LogStart("DeleteContact"); - ES.DeleteContact(accountName); - LogEnd("DeleteContact"); - } - catch (Exception ex) - { - LogError("DeleteContact", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public ExchangeContact GetContactGeneralSettings(string accountName) - { - try - { - LogStart("GetContactGeneralSettings"); - ExchangeContact ret = ES.GetContactGeneralSettings(accountName); - LogEnd("GetContactGeneralSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetContactGeneralSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void SetContactGeneralSettings(string accountName, string displayName, string email, bool hideFromAddressBook, string firstName, string initials, string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes, int useMapiRichTextFormat, string defaultDomain) - { - try - { - LogStart("SetContactGeneralSettings"); - ES.SetContactGeneralSettings(accountName, displayName, email, hideFromAddressBook, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, useMapiRichTextFormat, defaultDomain); - LogEnd("SetContactGeneralSettings"); - } - catch (Exception ex) - { - LogError("SetContactGeneralSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public ExchangeContact GetContactMailFlowSettings(string accountName) - { - try - { - LogStart("GetContactMailFlowSettings"); - ExchangeContact ret = ES.GetContactMailFlowSettings(accountName); - LogEnd("GetContactMailFlowSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetContactMailFlowSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void SetContactMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - try - { - LogStart("SetContactMailFlowSettings"); - ES.SetContactMailFlowSettings(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication); - LogEnd("SetContactMailFlowSettings"); - } - catch (Exception ex) - { - LogError("SetContactMailFlowSettings", ex); - throw; - } - } - #endregion - - #region Distribution Lists - [WebMethod, SoapHeader("settings")] - public void CreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy) - { - try - { - LogStart("CreateDistributionList"); - ES.CreateDistributionList(organizationId, organizationDistinguishedName, displayName, accountName, name, domain, managedBy); - LogEnd("CreateDistributionList"); - } - catch (Exception ex) - { - LogError("CreateDistributionList", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void DeleteDistributionList(string accountName) - { - try - { - LogStart("DeleteDistributionList"); - ES.DeleteDistributionList(accountName); - LogEnd("DeleteDistributionList"); - } - catch (Exception ex) - { - LogError("DeleteDistributionList", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public ExchangeDistributionList GetDistributionListGeneralSettings(string accountName) - { - try - { - LogStart("GetDistributionListGeneralSettings"); - ExchangeDistributionList ret = ES.GetDistributionListGeneralSettings(accountName); - LogEnd("GetDistributionListGeneralSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetDistributionListGeneralSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void SetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes) - { - try - { - LogStart("SetDistributionListGeneralSettings"); - ES.SetDistributionListGeneralSettings(accountName, displayName, hideFromAddressBook, managedBy, members, notes); - LogEnd("SetDistributionListGeneralSettings"); - } - catch (Exception ex) - { - LogError("SetDistributionListGeneralSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public ExchangeDistributionList GetDistributionListMailFlowSettings(string accountName) - { - try - { - LogStart("GetDistributionListMailFlowSettings"); - ExchangeDistributionList ret = ES.GetDistributionListMailFlowSettings(accountName); - LogEnd("GetDistributionListMailFlowSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetDistributionListMailFlowSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - try - { - LogStart("SetDistributionListMailFlowSettings"); - ES.SetDistributionListMailFlowSettings(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication); - LogEnd("SetDistributionListMailFlowSettings"); - } - catch (Exception ex) - { - LogError("SetDistributionListMailFlowSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public ExchangeEmailAddress[] GetDistributionListEmailAddresses(string accountName) - { - try - { - LogStart("GetDistributionListEmailAddresses"); - ExchangeEmailAddress[] ret = ES.GetDistributionListEmailAddresses(accountName); - LogEnd("GetDistributionListEmailAddresses"); - return ret; - } - catch (Exception ex) - { - LogError("GetDistributionListEmailAddresses", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses) - { - try - { - LogStart("SetDistributionListEmailAddresses"); - ES.SetDistributionListEmailAddresses(accountName, emailAddresses); - LogEnd("SetDistributionListEmailAddresses"); - } - catch (Exception ex) - { - LogError("SetDistributionListEmailAddresses", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress) - { - try - { - LogStart("SetDistributionListPrimaryEmailAddress"); - ES.SetDistributionListPrimaryEmailAddress(accountName, emailAddress); - LogEnd("SetDistributionListPrimaryEmailAddress"); - } - catch (Exception ex) - { - LogError("SetDistributionListPrimaryEmailAddress", ex); - throw; - } - } + LogEnd("CreateContact"); + } + catch (Exception ex) + { + LogError("CreateContact", ex); + throw; + } + } [WebMethod, SoapHeader("settings")] - public void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts) + public void DeleteContact(string accountName) { - ES.SetDistributionListPermissions(organizationId, accountName, sendAsAccounts, sendOnBehalfAccounts); + try + { + LogStart("DeleteContact"); + ES.DeleteContact(accountName); + LogEnd("DeleteContact"); + } + catch (Exception ex) + { + LogError("DeleteContact", ex); + throw; + } } - + + [WebMethod, SoapHeader("settings")] + public ExchangeContact GetContactGeneralSettings(string accountName) + { + try + { + LogStart("GetContactGeneralSettings"); + ExchangeContact ret = ES.GetContactGeneralSettings(accountName); + LogEnd("GetContactGeneralSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetContactGeneralSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetContactGeneralSettings(string accountName, string displayName, string email, bool hideFromAddressBook, string firstName, string initials, string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes, int useMapiRichTextFormat, string defaultDomain) + { + try + { + LogStart("SetContactGeneralSettings"); + ES.SetContactGeneralSettings(accountName, displayName, email, hideFromAddressBook, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, useMapiRichTextFormat, defaultDomain); + LogEnd("SetContactGeneralSettings"); + } + catch (Exception ex) + { + LogError("SetContactGeneralSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public ExchangeContact GetContactMailFlowSettings(string accountName) + { + try + { + LogStart("GetContactMailFlowSettings"); + ExchangeContact ret = ES.GetContactMailFlowSettings(accountName); + LogEnd("GetContactMailFlowSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetContactMailFlowSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetContactMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + try + { + LogStart("SetContactMailFlowSettings"); + ES.SetContactMailFlowSettings(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication); + LogEnd("SetContactMailFlowSettings"); + } + catch (Exception ex) + { + LogError("SetContactMailFlowSettings", ex); + throw; + } + } + #endregion + + #region Distribution Lists + [WebMethod, SoapHeader("settings")] + public void CreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists) + { + try + { + LogStart("CreateDistributionList"); + ES.CreateDistributionList(organizationId, organizationDistinguishedName, displayName, accountName, name, domain, managedBy, addressLists); + LogEnd("CreateDistributionList"); + } + catch (Exception ex) + { + LogError("CreateDistributionList", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void DeleteDistributionList(string accountName) + { + try + { + LogStart("DeleteDistributionList"); + ES.DeleteDistributionList(accountName); + LogEnd("DeleteDistributionList"); + } + catch (Exception ex) + { + LogError("DeleteDistributionList", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public ExchangeDistributionList GetDistributionListGeneralSettings(string accountName) + { + try + { + LogStart("GetDistributionListGeneralSettings"); + ExchangeDistributionList ret = ES.GetDistributionListGeneralSettings(accountName); + LogEnd("GetDistributionListGeneralSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetDistributionListGeneralSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, string[] addressLists) + { + try + { + LogStart("SetDistributionListGeneralSettings"); + ES.SetDistributionListGeneralSettings(accountName, displayName, hideFromAddressBook, managedBy, members, notes, addressLists); + LogEnd("SetDistributionListGeneralSettings"); + } + catch (Exception ex) + { + LogError("SetDistributionListGeneralSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public ExchangeDistributionList GetDistributionListMailFlowSettings(string accountName) + { + try + { + LogStart("GetDistributionListMailFlowSettings"); + ExchangeDistributionList ret = ES.GetDistributionListMailFlowSettings(accountName); + LogEnd("GetDistributionListMailFlowSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetDistributionListMailFlowSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists) + { + try + { + LogStart("SetDistributionListMailFlowSettings"); + ES.SetDistributionListMailFlowSettings(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication, addressLists); + LogEnd("SetDistributionListMailFlowSettings"); + } + catch (Exception ex) + { + LogError("SetDistributionListMailFlowSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public ExchangeEmailAddress[] GetDistributionListEmailAddresses(string accountName) + { + try + { + LogStart("GetDistributionListEmailAddresses"); + ExchangeEmailAddress[] ret = ES.GetDistributionListEmailAddresses(accountName); + LogEnd("GetDistributionListEmailAddresses"); + return ret; + } + catch (Exception ex) + { + LogError("GetDistributionListEmailAddresses", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses, string[] addressLists) + { + try + { + LogStart("SetDistributionListEmailAddresses"); + ES.SetDistributionListEmailAddresses(accountName, emailAddresses, addressLists); + LogEnd("SetDistributionListEmailAddresses"); + } + catch (Exception ex) + { + LogError("SetDistributionListEmailAddresses", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress, string[] addressLists) + { + try + { + LogStart("SetDistributionListPrimaryEmailAddress"); + ES.SetDistributionListPrimaryEmailAddress(accountName, emailAddress, addressLists); + LogEnd("SetDistributionListPrimaryEmailAddress"); + } + catch (Exception ex) + { + LogError("SetDistributionListPrimaryEmailAddress", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists) + { + ES.SetDistributionListPermissions(organizationId, accountName, sendAsAccounts, sendOnBehalfAccounts, addressLists); + } + [WebMethod, SoapHeader("settings")] public ExchangeDistributionList GetDistributionListPermissions(string organizationId, string accountName) { return ES.GetDistributionListPermissions(organizationId, accountName); } - + #endregion @@ -1048,148 +1070,148 @@ namespace WebsitePanel.Server #endregion - #region ActiveSync - [WebMethod, SoapHeader("settings")] - public void CreateOrganizationActiveSyncPolicy(string organizationId) - { - try - { - LogStart("CreateOrganizationActiveSyncPolicy"); - ES.CreateOrganizationActiveSyncPolicy(organizationId); - LogEnd("CreateOrganizationActiveSyncPolicy"); - } - catch (Exception ex) - { - LogError("CreateOrganizationActiveSyncPolicy", ex); - throw; - } - } + #region ActiveSync + [WebMethod, SoapHeader("settings")] + public void CreateOrganizationActiveSyncPolicy(string organizationId) + { + try + { + LogStart("CreateOrganizationActiveSyncPolicy"); + ES.CreateOrganizationActiveSyncPolicy(organizationId); + LogEnd("CreateOrganizationActiveSyncPolicy"); + } + catch (Exception ex) + { + LogError("CreateOrganizationActiveSyncPolicy", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public ExchangeActiveSyncPolicy GetActiveSyncPolicy(string organizationId) - { - try - { - LogStart("GetActiveSyncPolicy"); - ExchangeActiveSyncPolicy ret = ES.GetActiveSyncPolicy(organizationId); - LogEnd("GetActiveSyncPolicy"); - return ret; - } - catch (Exception ex) - { - LogError("GetActiveSyncPolicy", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeActiveSyncPolicy GetActiveSyncPolicy(string organizationId) + { + try + { + LogStart("GetActiveSyncPolicy"); + ExchangeActiveSyncPolicy ret = ES.GetActiveSyncPolicy(organizationId); + LogEnd("GetActiveSyncPolicy"); + return ret; + } + catch (Exception ex) + { + LogError("GetActiveSyncPolicy", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetActiveSyncPolicy(string id, bool allowNonProvisionableDevices, bool attachmentsEnabled, - int maxAttachmentSizeKB, bool uncAccessEnabled, bool wssAccessEnabled, bool devicePasswordEnabled, - bool alphanumericPasswordRequired, bool passwordRecoveryEnabled, bool deviceEncryptionEnabled, - bool allowSimplePassword, int maxPasswordFailedAttempts, int minPasswordLength, int inactivityLockMin, - int passwordExpirationDays, int passwordHistory, int refreshInterval) - { - try - { - LogStart("SetActiveSyncPolicy"); - ES.SetActiveSyncPolicy(id, allowNonProvisionableDevices, attachmentsEnabled, - maxAttachmentSizeKB, uncAccessEnabled, wssAccessEnabled, devicePasswordEnabled, alphanumericPasswordRequired, passwordRecoveryEnabled, - deviceEncryptionEnabled, allowSimplePassword, maxPasswordFailedAttempts, - minPasswordLength, inactivityLockMin, passwordExpirationDays, passwordHistory, refreshInterval); - LogEnd("SetActiveSyncPolicy"); - } - catch (Exception ex) - { - LogError("SetActiveSyncPolicy", ex); - throw; - } - } - #endregion + [WebMethod, SoapHeader("settings")] + public void SetActiveSyncPolicy(string id, bool allowNonProvisionableDevices, bool attachmentsEnabled, + int maxAttachmentSizeKB, bool uncAccessEnabled, bool wssAccessEnabled, bool devicePasswordEnabled, + bool alphanumericPasswordRequired, bool passwordRecoveryEnabled, bool deviceEncryptionEnabled, + bool allowSimplePassword, int maxPasswordFailedAttempts, int minPasswordLength, int inactivityLockMin, + int passwordExpirationDays, int passwordHistory, int refreshInterval) + { + try + { + LogStart("SetActiveSyncPolicy"); + ES.SetActiveSyncPolicy(id, allowNonProvisionableDevices, attachmentsEnabled, + maxAttachmentSizeKB, uncAccessEnabled, wssAccessEnabled, devicePasswordEnabled, alphanumericPasswordRequired, passwordRecoveryEnabled, + deviceEncryptionEnabled, allowSimplePassword, maxPasswordFailedAttempts, + minPasswordLength, inactivityLockMin, passwordExpirationDays, passwordHistory, refreshInterval); + LogEnd("SetActiveSyncPolicy"); + } + catch (Exception ex) + { + LogError("SetActiveSyncPolicy", ex); + throw; + } + } + #endregion - #region Mobile devices - [WebMethod, SoapHeader("settings")] - public ExchangeMobileDevice[] GetMobileDevices(string accountName) - { - try - { - LogStart("GetMobileDevices"); - ExchangeMobileDevice[] ret = ES.GetMobileDevices(accountName); - LogEnd("GetMobileDevices"); - return ret; - } - catch (Exception ex) - { - LogError("GetMobileDevices", ex); - throw; - } - } + #region Mobile devices + [WebMethod, SoapHeader("settings")] + public ExchangeMobileDevice[] GetMobileDevices(string accountName) + { + try + { + LogStart("GetMobileDevices"); + ExchangeMobileDevice[] ret = ES.GetMobileDevices(accountName); + LogEnd("GetMobileDevices"); + return ret; + } + catch (Exception ex) + { + LogError("GetMobileDevices", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public ExchangeMobileDevice GetMobileDevice(string id) - { - try - { - LogStart("GetMobileDevice"); - ExchangeMobileDevice ret = ES.GetMobileDevice(id); - LogEnd("GetMobileDevice"); - return ret; - } - catch (Exception ex) - { - LogError("GetMobileDevice", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void WipeDataFromDevice(string id) - { - try - { - LogStart("WipeDataFromDevice"); - ES.WipeDataFromDevice(id); - LogEnd("WipeDataFromDevice"); - } - catch (Exception ex) - { - LogError("WipeDataFromDevice", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeMobileDevice GetMobileDevice(string id) + { + try + { + LogStart("GetMobileDevice"); + ExchangeMobileDevice ret = ES.GetMobileDevice(id); + LogEnd("GetMobileDevice"); + return ret; + } + catch (Exception ex) + { + LogError("GetMobileDevice", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void CancelRemoteWipeRequest(string id) - { - try - { - LogStart("CancelRemoteWipeRequest"); - ES.CancelRemoteWipeRequest(id); - LogEnd("CancelRemoteWipeRequest"); - } - catch (Exception ex) - { - LogError("CancelRemoteWipeRequest", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void WipeDataFromDevice(string id) + { + try + { + LogStart("WipeDataFromDevice"); + ES.WipeDataFromDevice(id); + LogEnd("WipeDataFromDevice"); + } + catch (Exception ex) + { + LogError("WipeDataFromDevice", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void CancelRemoteWipeRequest(string id) + { + try + { + LogStart("CancelRemoteWipeRequest"); + ES.CancelRemoteWipeRequest(id); + LogEnd("CancelRemoteWipeRequest"); + } + catch (Exception ex) + { + LogError("CancelRemoteWipeRequest", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void RemoveDevice(string id) - { - try - { - LogStart("RemoveDevice"); - ES.RemoveDevice(id); - LogEnd("RemoveDevice"); - } - catch (Exception ex) - { - LogError("RemoveDevice", ex); - throw; - } - } - #endregion + [WebMethod, SoapHeader("settings")] + public void RemoveDevice(string id) + { + try + { + LogStart("RemoveDevice"); + ES.RemoveDevice(id); + LogEnd("RemoveDevice"); + } + catch (Exception ex) + { + LogError("RemoveDevice", ex); + throw; + } + } + #endregion protected void LogStart(string func) { diff --git a/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServerHostedEdition.asmx b/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServerHostedEdition.asmx deleted file mode 100644 index fbecb5cd..00000000 --- a/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServerHostedEdition.asmx +++ /dev/null @@ -1 +0,0 @@ -<%@ WebService Language="C#" CodeBehind="ExchangeServerHostedEdition.asmx.cs" Class="WebsitePanel.Server.ExchangeServerHostedEdition" %> diff --git a/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServerHostedEdition.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServerHostedEdition.asmx.cs deleted file mode 100644 index 8d03a17a..00000000 --- a/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServerHostedEdition.asmx.cs +++ /dev/null @@ -1,201 +0,0 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.Services; -using WebsitePanel.Providers; -using WebsitePanel.Providers.ExchangeHostedEdition; -using Microsoft.Web.Services3; -using System.Web.Services.Protocols; -using WebsitePanel.Server.Utils; - -namespace WebsitePanel.Server -{ - /// - /// Summary description for ExchangeHostedEdition - /// - [WebService(Namespace = "http://smbsaas/websitepanel/server/")] - [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] - [Policy("ServerPolicy")] - public class ExchangeServerHostedEdition : HostingServiceProviderWebService, IExchangeHostedEdition - { - private IExchangeHostedEdition ExchangeServer - { - get { return (IExchangeHostedEdition)Provider; } - } - - [WebMethod, SoapHeader("settings")] - public void CreateOrganization(string organizationId, string programId, string offerId, string domain, - string adminName, string adminEmail, string adminPassword) - { - try - { - Log.WriteStart("'{0}' CreateOrganization", ProviderSettings.ProviderName); - ExchangeServer.CreateOrganization(organizationId, programId, offerId, domain, adminName, adminEmail, adminPassword); - Log.WriteEnd("'{0}' CreateOrganization", ProviderSettings.ProviderName); - } - catch (Exception ex) - { - Log.WriteError(String.Format("'{0}' CreateOrganization", ProviderSettings.ProviderName), ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public List GetOrganizationDomains(string organizationId) - { - try - { - Log.WriteStart("'{0}' GetOrganizationDomains", ProviderSettings.ProviderName); - List result = ExchangeServer.GetOrganizationDomains(organizationId); - Log.WriteEnd("'{0}' GetOrganizationDomains", ProviderSettings.ProviderName); - return result; - } - catch (Exception ex) - { - Log.WriteError(String.Format("'{0}' GetOrganizationDomains", ProviderSettings.ProviderName), ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void AddOrganizationDomain(string organizationId, string domain) - { - try - { - Log.WriteStart("'{0}' AddOrganizationDomain", ProviderSettings.ProviderName); - ExchangeServer.AddOrganizationDomain(organizationId, domain); - Log.WriteEnd("'{0}' AddOrganizationDomain", ProviderSettings.ProviderName); - } - catch (Exception ex) - { - Log.WriteError(String.Format("'{0}' AddOrganizationDomain", ProviderSettings.ProviderName), ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void DeleteOrganizationDomain(string organizationId, string domain) - { - try - { - Log.WriteStart("'{0}' DeleteOrganizationDomain", ProviderSettings.ProviderName); - ExchangeServer.DeleteOrganizationDomain(organizationId, domain); - Log.WriteEnd("'{0}' DeleteOrganizationDomain", ProviderSettings.ProviderName); - } - catch (Exception ex) - { - Log.WriteError(String.Format("'{0}' DeleteOrganizationDomain", ProviderSettings.ProviderName), ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public ExchangeOrganization GetOrganizationDetails(string organizationId) - { - try - { - Log.WriteStart("'{0}' GetOrganizationDetails", ProviderSettings.ProviderName); - ExchangeOrganization result = ExchangeServer.GetOrganizationDetails(organizationId); - Log.WriteEnd("'{0}' GetOrganizationDetails", ProviderSettings.ProviderName); - return result; - } - catch (Exception ex) - { - Log.WriteError(String.Format("'{0}' GetOrganizationDetails", ProviderSettings.ProviderName), ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void UpdateOrganizationQuotas(string organizationId, int mailboxesNumber, int contactsNumber, int distributionListsNumber) - { - try - { - Log.WriteStart("'{0}' UpdateOrganizationQuotas", ProviderSettings.ProviderName); - ExchangeServer.UpdateOrganizationQuotas(organizationId, mailboxesNumber, contactsNumber, distributionListsNumber); - Log.WriteEnd("'{0}' UpdateOrganizationQuotas", ProviderSettings.ProviderName); - } - catch (Exception ex) - { - Log.WriteError(String.Format("'{0}' UpdateOrganizationQuotas", ProviderSettings.ProviderName), ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void UpdateOrganizationCatchAllAddress(string organizationId, string catchAllEmail) - { - try - { - Log.WriteStart("'{0}' UpdateOrganizationCatchAllAddress", ProviderSettings.ProviderName); - ExchangeServer.UpdateOrganizationCatchAllAddress(organizationId, catchAllEmail); - Log.WriteEnd("'{0}' UpdateOrganizationCatchAllAddress", ProviderSettings.ProviderName); - } - catch (Exception ex) - { - Log.WriteError(String.Format("'{0}' UpdateOrganizationCatchAllAddress", ProviderSettings.ProviderName), ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void UpdateOrganizationServicePlan(string organizationId, string programId, string offerId) - { - try - { - Log.WriteStart("'{0}' UpdateOeganizationServicePlan", ProviderSettings.ProviderName); - ExchangeServer.UpdateOrganizationServicePlan(organizationId, programId, offerId); - Log.WriteEnd("'{0}' UpdateOeganizationServicePlan", ProviderSettings.ProviderName); - } - catch (Exception ex) - { - Log.WriteError(String.Format("'{0}' UpdateOeganizationServicePlan", ProviderSettings.ProviderName), ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void DeleteOrganization(string organizationId) - { - try - { - Log.WriteStart("'{0}' DeleteOrganization", ProviderSettings.ProviderName); - ExchangeServer.DeleteOrganization(organizationId); - Log.WriteEnd("'{0}' DeleteOrganization", ProviderSettings.ProviderName); - } - catch (Exception ex) - { - Log.WriteError(String.Format("'{0}' DeleteOrganization", ProviderSettings.ProviderName), ex); - throw; - } - } - } -} diff --git a/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx new file mode 100644 index 00000000..8233e3df --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="LyncServer.asmx.cs" Class="WebsitePanel.Server.LyncServer" %> diff --git a/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs new file mode 100644 index 00000000..8f04045d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs @@ -0,0 +1,236 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.ComponentModel; +using System.Web.Services; +using System.Web.Services.Protocols; +using WebsitePanel.Providers; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Server.Utils; +using Microsoft.Web.Services3; + +namespace WebsitePanel.Server +{ + /// + /// OCS Web Service + /// + [WebService(Namespace = "http://smbsaas/websitepanel/server/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [Policy("ServerPolicy")] + [ToolboxItem(false)] + public class LyncServer : HostingServiceProviderWebService + { + private ILyncServer Lync + { + get { return (ILyncServer)Provider; } + } + + + #region Organization + [WebMethod, SoapHeader("settings")] + public string CreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) + { + try + { + Log.WriteStart("{0}.CreateOrganization", ProviderSettings.ProviderName); + string ret = Lync.CreateOrganization(organizationId, sipDomain, enableConferencing, enableConferencingVideo, maxConferenceSize, enabledFederation, enabledEnterpriseVoice); + Log.WriteEnd("{0}.CreateOrganization", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.CreateOrganization", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool DeleteOrganization(string organizationId, string sipDomain) + { + try + { + Log.WriteStart("{0}.DeleteOrganization", ProviderSettings.ProviderName); + bool ret = Lync.DeleteOrganization(organizationId, sipDomain); + Log.WriteEnd("{0}.DeleteOrganization", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.DeleteOrganization", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + #region Users + + [WebMethod, SoapHeader("settings")] + public bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan) + { + try + { + Log.WriteStart("{0}.CreateUser", ProviderSettings.ProviderName); + bool ret = Lync.CreateUser(organizationId, userUpn, plan); + Log.WriteEnd("{0}.CreateUser", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.CreateUser", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn) + { + try + { + Log.WriteStart("{0}.GetLyncUserGeneralSettings", ProviderSettings.ProviderName); + LyncUser ret = Lync.GetLyncUserGeneralSettings(organizationId, userUpn); + Log.WriteEnd("{0}.GetLyncUserGeneralSettings", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.GetLyncUserGeneralSettings", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) + { + try + { + Log.WriteStart("{0}.SetLyncUserPlan", ProviderSettings.ProviderName); + bool ret = Lync.SetLyncUserPlan(organizationId, userUpn, plan); + Log.WriteEnd("{0}.SetLyncUserPlan", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.SetLyncUserPlan", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool DeleteUser(string userUpn) + { + try + { + Log.WriteStart("{0}.DeleteUser", ProviderSettings.ProviderName); + bool ret = Lync.DeleteUser(userUpn); + Log.WriteEnd("{0}.DeleteUser", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.DeleteUser", ProviderSettings.ProviderName), ex); + throw; + } + } + + #endregion + + #region Federation + [WebMethod, SoapHeader("settings")] + public LyncFederationDomain[] GetFederationDomains(string organizationId) + { + try + { + Log.WriteStart("{0}.GetFederationDomains", ProviderSettings.ProviderName); + LyncFederationDomain[] ret = Lync.GetFederationDomains(organizationId); + Log.WriteEnd("{0}.GetFederationDomains", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.GetFederationDomains", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool AddFederationDomain(string organizationId, string domainName, string proxyFqdn) + { + try + { + Log.WriteStart("{0}.AddFederationDomain", ProviderSettings.ProviderName); + bool ret = Lync.AddFederationDomain(organizationId, domainName, proxyFqdn); + Log.WriteEnd("{0}.AddFederationDomain", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.AddFederationDomain", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool RemoveFederationDomain(string organizationId, string domainName) + { + try + { + Log.WriteStart("{0}.RemoveFederationDomain", ProviderSettings.ProviderName); + bool ret = Lync.RemoveFederationDomain(organizationId, domainName); + Log.WriteEnd("{0}.RemoveFederationDomain", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.RemoveFederationDomain", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + [WebMethod, SoapHeader("settings")] + public void ReloadConfiguration() + { + try + { + Log.WriteStart("{0}.ReloadConfiguration", ProviderSettings.ProviderName); + Lync.ReloadConfiguration(); + Log.WriteEnd("{0}.ReloadConfiguration", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.ReloadConfiguration", ProviderSettings.ProviderName), ex); + throw; + } + } + + + + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs index f057ec76..775058d8 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs @@ -67,14 +67,14 @@ namespace WebsitePanel.Server throw; } } - - + + [WebMethod, SoapHeader("settings")] public Organization CreateOrganization(string organizationId) { try { - Log.WriteStart("'{0}' CreateOrganization", ProviderSettings.ProviderName); + Log.WriteStart("'{0}' CreateOrganization", ProviderSettings.ProviderName); Organization ret = Organization.CreateOrganization(organizationId); Log.WriteEnd("'{0}' CreateOrganization", ProviderSettings.ProviderName); return ret; @@ -85,21 +85,17 @@ namespace WebsitePanel.Server throw; } } - + [WebMethod, SoapHeader("settings")] public void DeleteOrganization(string organizationId) { - Organization.DeleteOrganization(organizationId); + Organization.DeleteOrganization(organizationId); } [WebMethod, SoapHeader("settings")] - public void CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) + public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) { - Log.WriteStart("'{0} CreateUser", ProviderSettings.ProviderName); - - Organization.CreateUser(organizationId, loginName, displayName, upn, password, enabled); - - Log.WriteEnd("'{0}' CreateUser", ProviderSettings.ProviderName); + return Organization.CreateUser(organizationId, loginName, displayName, upn, password, enabled); } [WebMethod, SoapHeader("settings")] @@ -109,7 +105,7 @@ namespace WebsitePanel.Server } [WebMethod, SoapHeader("settings")] - public OrganizationUser GeUserGeneralSettings(string loginName, string organizationId) + public OrganizationUser GetUserGeneralSettings(string loginName, string organizationId) { return Organization.GetUserGeneralSettings(loginName, organizationId); } @@ -132,9 +128,9 @@ namespace WebsitePanel.Server [WebMethod, SoapHeader("settings")] public void DeleteOrganizationDomain(string organizationDistinguishedName, string domain) { - Organization.DeleteOrganizationDomain(organizationDistinguishedName, domain); + Organization.DeleteOrganizationDomain(organizationDistinguishedName, domain); } - + [WebMethod, SoapHeader("settings")] public void CreateOrganizationDomain(string organizationDistinguishedName, string domain) { @@ -147,5 +143,10 @@ namespace WebsitePanel.Server return Organization.GetPasswordPolicy(); } + [WebMethod, SoapHeader("settings")] + public string GetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName) + { + return Organization.GetSamAccountNameByUserPrincipalName(organizationId, userPrincipalName); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj index 71d04878..4ae2bf2d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj @@ -68,7 +68,7 @@ - + @@ -109,8 +109,8 @@ - - ExchangeServerHostedEdition.asmx + + LyncServer.asmx Component diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ModulesData.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ModulesData.config index ffd5eab9..65182013 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ModulesData.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ModulesData.config @@ -68,7 +68,6 @@ - @@ -121,7 +120,6 @@ - diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/SiteSettings.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/SiteSettings.config index 0a99be01..e40147a6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/SiteSettings.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/SiteSettings.config @@ -3,7 +3,7 @@ WebsitePanel - http://localhost:9002 + http://localhost:9005 UserCulture UserTheme diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index 616e6848..e15f3f0a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -486,7 +486,10 @@ - + + + + @@ -508,7 +511,15 @@ - + + + + + + + + + @@ -580,17 +591,4 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Pages.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Pages.config index 70ffb1a7..be8e97cf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Pages.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Pages.config @@ -9,25 +9,25 @@ -