Commit Changes from Robvde

This commit is contained in:
omara 2012-07-13 08:22:13 -04:00
commit 86570b141e
364 changed files with 24492 additions and 15730 deletions

View file

@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="installer" type="WebsitePanel.Installer.Configuration.InstallerSection, WebsitePanel.Installer.Core"/>
</configSections>
<installer>
<!-- Installed components -->
<components/>
<!-- Studio settings -->
<settings>
<add key="Log.FileName" value="WebsitePanel.Installer.log" />
<add key="Web.Service" value="" />
<add key="Web.AutoCheck" value="False" />
<add key="Web.Proxy.UseProxy" value="false" />
<add key="Web.Proxy.Address" value="" />
<add key="Web.Proxy.UserName" value="" />
<add key="Web.Proxy.Password" value="" />
</settings>
</installer>
</configuration>

View file

@ -247,10 +247,10 @@
<SubType>Designer</SubType>
<DependentUpon>ProgressIcon.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Updater.exe" />
</ItemGroup>
<ItemGroup>
<Content Include="application.ico" />
<Content Include="Updater.exe" />
<Content Include="websitepanel.ico" />
</ItemGroup>
<ItemGroup>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -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

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections/>
<appSettings>
<add key="routingDomain" value=".tmp"/>
<add key="logFile" value="C:\Temp\WSP.Log"/>
<add key="enableVerboseLogging" value="false"/>
<add key="blockInternalInterTenantOOF" value="true"/>
</appSettings>
</configuration>

View file

@ -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")]

View file

@ -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);
}
}
}
}

View file

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{D959F137-A56F-4F4E-BA80-599FBE3700E3}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WSPTransportAgent</RootNamespace>
<AssemblyName>WSPTransportAgent</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Exchange.Data.Common">
<HintPath>..\..\..\Lib\References\Microsoft\Microsoft.Exchange.Data.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Exchange.Data.Transport">
<HintPath>..\..\..\Lib\References\Microsoft\Microsoft.Exchange.Data.Transport.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.configuration" />
<Reference Include="System.DirectoryServices" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="WSPRoutingAgent.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="WSPTransportAgent.reg" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -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

View file

@ -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)

View file

@ -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);
}
}
}

View file

@ -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)

View file

@ -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; }
}
}
}

View file

@ -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";

View file

@ -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";
}
}

View file

@ -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,
}
}

View file

@ -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";
}
}

View file

@ -37,6 +37,10 @@ namespace WebsitePanel.EnterpriseServer
{
Administrator = 1,
Reseller = 2,
User = 3
User = 3,
ResellerCSR = 4,
PlatformCSR = 5,
ResellerHelpdesk = 6,
PlatformHelpdesk = 7
}
}

View file

@ -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";

View file

@ -1,950 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
//
// 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;
/// <remarks/>
[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;
/// <remarks/>
public esExchangeHostedEdition() {
this.Url = "http://localhost:9002/esExchangeHostedEdition.asmx";
}
/// <remarks/>
public event GetOrganizationsCompletedEventHandler GetOrganizationsCompleted;
/// <remarks/>
public event CreateExchangeOrganizationCompletedEventHandler CreateExchangeOrganizationCompleted;
/// <remarks/>
public event GetExchangeOrganizationDetailsCompletedEventHandler GetExchangeOrganizationDetailsCompleted;
/// <remarks/>
public event GetExchangeOrganizationDomainsCompletedEventHandler GetExchangeOrganizationDomainsCompleted;
/// <remarks/>
public event GetExchangeOrganizationSummaryCompletedEventHandler GetExchangeOrganizationSummaryCompleted;
/// <remarks/>
public event SendExchangeOrganizationSummaryCompletedEventHandler SendExchangeOrganizationSummaryCompleted;
/// <remarks/>
public event AddExchangeOrganizationDomainCompletedEventHandler AddExchangeOrganizationDomainCompleted;
/// <remarks/>
public event DeleteExchangeOrganizationDomainCompletedEventHandler DeleteExchangeOrganizationDomainCompleted;
/// <remarks/>
public event UpdateExchangeOrganizationQuotasCompletedEventHandler UpdateExchangeOrganizationQuotasCompleted;
/// <remarks/>
public event UpdateExchangeOrganizationCatchAllAddressCompletedEventHandler UpdateExchangeOrganizationCatchAllAddressCompleted;
/// <remarks/>
public event UpdateExchangeOrganizationServicePlanCompletedEventHandler UpdateExchangeOrganizationServicePlanCompleted;
/// <remarks/>
public event DeleteExchangeOrganizationCompletedEventHandler DeleteExchangeOrganizationCompleted;
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginGetOrganizations(int packageId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetOrganizations", new object[] {
packageId}, callback, asyncState);
}
/// <remarks/>
public ExchangeOrganization[] EndGetOrganizations(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ExchangeOrganization[])(results[0]));
}
/// <remarks/>
public void GetOrganizationsAsync(int packageId) {
this.GetOrganizationsAsync(packageId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
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);
}
/// <remarks/>
public IntResult EndCreateExchangeOrganization(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((IntResult)(results[0]));
}
/// <remarks/>
public void CreateExchangeOrganizationAsync(int packageId, string organizationId, string domain, string adminName, string adminEmail, string adminPassword) {
this.CreateExchangeOrganizationAsync(packageId, organizationId, domain, adminName, adminEmail, adminPassword, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginGetExchangeOrganizationDetails(int itemId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetExchangeOrganizationDetails", new object[] {
itemId}, callback, asyncState);
}
/// <remarks/>
public ExchangeOrganization EndGetExchangeOrganizationDetails(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ExchangeOrganization)(results[0]));
}
/// <remarks/>
public void GetExchangeOrganizationDetailsAsync(int itemId) {
this.GetExchangeOrganizationDetailsAsync(itemId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginGetExchangeOrganizationDomains(int itemId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetExchangeOrganizationDomains", new object[] {
itemId}, callback, asyncState);
}
/// <remarks/>
public ExchangeOrganizationDomain[] EndGetExchangeOrganizationDomains(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ExchangeOrganizationDomain[])(results[0]));
}
/// <remarks/>
public void GetExchangeOrganizationDomainsAsync(int itemId) {
this.GetExchangeOrganizationDomainsAsync(itemId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginGetExchangeOrganizationSummary(int itemId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetExchangeOrganizationSummary", new object[] {
itemId}, callback, asyncState);
}
/// <remarks/>
public string EndGetExchangeOrganizationSummary(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}
/// <remarks/>
public void GetExchangeOrganizationSummaryAsync(int itemId) {
this.GetExchangeOrganizationSummaryAsync(itemId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginSendExchangeOrganizationSummary(int itemId, string toEmail, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SendExchangeOrganizationSummary", new object[] {
itemId,
toEmail}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndSendExchangeOrganizationSummary(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void SendExchangeOrganizationSummaryAsync(int itemId, string toEmail) {
this.SendExchangeOrganizationSummaryAsync(itemId, toEmail, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginAddExchangeOrganizationDomain(int itemId, string domain, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("AddExchangeOrganizationDomain", new object[] {
itemId,
domain}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndAddExchangeOrganizationDomain(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void AddExchangeOrganizationDomainAsync(int itemId, string domain) {
this.AddExchangeOrganizationDomainAsync(itemId, domain, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginDeleteExchangeOrganizationDomain(int itemId, string domain, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("DeleteExchangeOrganizationDomain", new object[] {
itemId,
domain}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndDeleteExchangeOrganizationDomain(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void DeleteExchangeOrganizationDomainAsync(int itemId, string domain) {
this.DeleteExchangeOrganizationDomainAsync(itemId, domain, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
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);
}
/// <remarks/>
public ResultObject EndUpdateExchangeOrganizationQuotas(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void UpdateExchangeOrganizationQuotasAsync(int itemId, int mailboxesNumber, int contactsNumber, int distributionListsNumber) {
this.UpdateExchangeOrganizationQuotasAsync(itemId, mailboxesNumber, contactsNumber, distributionListsNumber, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginUpdateExchangeOrganizationCatchAllAddress(int itemId, string catchAllEmail, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("UpdateExchangeOrganizationCatchAllAddress", new object[] {
itemId,
catchAllEmail}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndUpdateExchangeOrganizationCatchAllAddress(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void UpdateExchangeOrganizationCatchAllAddressAsync(int itemId, string catchAllEmail) {
this.UpdateExchangeOrganizationCatchAllAddressAsync(itemId, catchAllEmail, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginUpdateExchangeOrganizationServicePlan(int itemId, int newServiceId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("UpdateExchangeOrganizationServicePlan", new object[] {
itemId,
newServiceId}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndUpdateExchangeOrganizationServicePlan(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void UpdateExchangeOrganizationServicePlanAsync(int itemId, int newServiceId) {
this.UpdateExchangeOrganizationServicePlanAsync(itemId, newServiceId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginDeleteExchangeOrganization(int itemId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("DeleteExchangeOrganization", new object[] {
itemId}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndDeleteExchangeOrganization(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void DeleteExchangeOrganizationAsync(int itemId) {
this.DeleteExchangeOrganizationAsync(itemId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetOrganizationsCompletedEventHandler(object sender, GetOrganizationsCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public ExchangeOrganization[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((ExchangeOrganization[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void CreateExchangeOrganizationCompletedEventHandler(object sender, CreateExchangeOrganizationCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public IntResult Result {
get {
this.RaiseExceptionIfNecessary();
return ((IntResult)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetExchangeOrganizationDetailsCompletedEventHandler(object sender, GetExchangeOrganizationDetailsCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public ExchangeOrganization Result {
get {
this.RaiseExceptionIfNecessary();
return ((ExchangeOrganization)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetExchangeOrganizationDomainsCompletedEventHandler(object sender, GetExchangeOrganizationDomainsCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public ExchangeOrganizationDomain[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((ExchangeOrganizationDomain[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetExchangeOrganizationSummaryCompletedEventHandler(object sender, GetExchangeOrganizationSummaryCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public string Result {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SendExchangeOrganizationSummaryCompletedEventHandler(object sender, SendExchangeOrganizationSummaryCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void AddExchangeOrganizationDomainCompletedEventHandler(object sender, AddExchangeOrganizationDomainCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void DeleteExchangeOrganizationDomainCompletedEventHandler(object sender, DeleteExchangeOrganizationDomainCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void UpdateExchangeOrganizationQuotasCompletedEventHandler(object sender, UpdateExchangeOrganizationQuotasCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void UpdateExchangeOrganizationCatchAllAddressCompletedEventHandler(object sender, UpdateExchangeOrganizationCatchAllAddressCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void UpdateExchangeOrganizationServicePlanCompletedEventHandler(object sender, UpdateExchangeOrganizationServicePlanCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void DeleteExchangeOrganizationCompletedEventHandler(object sender, DeleteExchangeOrganizationCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -87,13 +87,13 @@
<Compile Include="ExchangeServerProxy.cs">
<SubType>code</SubType>
</Compile>
<Compile Include="LyncProxy.cs" />
<Compile Include="VirtualizationServerProxyForPrivateCloud.cs" />
<Compile Include="CRMProxy.cs" />
<Compile Include="DatabaseServersProxy.cs" />
<Compile Include="ecServiceHandlerProxy.cs" />
<Compile Include="ecStorefrontProxy.cs" />
<Compile Include="ecStorehouseProxy.cs" />
<Compile Include="ExchangeHostedEditionProxy.cs" />
<Compile Include="FilesProxy.cs" />
<Compile Include="FtpServersProxy.cs" />
<Compile Include="HostedSharePointServersProxy.cs" />

View file

@ -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<string> roles = new List<string>();
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;
}

View file

@ -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
}
}

View file

@ -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<IntResult>(ExchangeServiceNotEnabledError);
#region Check Space and Account
// Check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0)
return Warning<IntResult>((-accountCheck).ToString());
// Check space
int packageCheck = SecurityContext.CheckPackage(packageId, DemandPackage.IsActive);
if (packageCheck < 0)
return Warning<IntResult>((-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<IntResult>(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<IntResult>(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<IntResult>(GeneralError, ex.Message);
}
finally
{
TaskManager.CompleteTask();
}
}
public static List<ExchangeOrganization> GetOrganizations(int packageId)
{
List<ServiceProviderItem> items = PackageController.GetPackageItemsByType(
packageId, typeof(ExchangeOrganization), false);
return items.ConvertAll<ExchangeOrganization>(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<ExchangeOrganizationDomain> 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<ExchangeOrganizationDomain> domains = new List<ExchangeOrganizationDomain>();
domains.AddRange(exchange.GetOrganizationDomains(item.Name));
return domains;
//return new List<ExchangeOrganizationDomain>
//{
// 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", "<br/>");
}
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<ResultObject>(OrganizationNotFoundError);
#region Check Space and Account
// Check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0)
return Warning<ResultObject>((-accountCheck).ToString());
// Check space
int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive);
if (packageCheck < 0)
return Warning<ResultObject>((-packageCheck).ToString());
#endregion
// load organization details
ExchangeOrganization org = GetOrganizationDetails(item.Id);
if(org == null)
return Error<ResultObject>(OrganizationNotFoundError);
// get evaluated summary information
MailTemplate msg = EvaluateOrganizationSummaryTemplate(org);
if (msg == null)
return Error<ResultObject>(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<ResultObject>((-sendResult).ToString());
return result;
}
catch (Exception ex)
{
// log error
TaskManager.WriteError(ex);
// exit with error code
return Error<ResultObject>(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<ResultObject>(OrganizationNotFoundError);
#region Check Space and Account
// Check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0)
return Warning<ResultObject>((-accountCheck).ToString());
// Check space
int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive);
if (packageCheck < 0)
return Warning<ResultObject>((-packageCheck).ToString());
#endregion
// get organization details
ExchangeOrganization org = GetOrganizationDetails(item.Id);
if (org == null)
return Error<ResultObject>(OrganizationNotFoundError);
// check domains quota
if(org.MaxDomainsCountQuota > -1 && org.Domains.Length >= org.MaxDomainsCountQuota)
return Error<IntResult>(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<ResultObject>((-checkResult).ToString());
if (domain.PackageId != org.PackageId)
return Error<ResultObject>((-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<ResultObject>(AddDomainAlreadyUsedError);
}
}
else if (checkResult == BusinessErrorCodes.ERROR_RESTRICTED_DOMAIN)
{
return Error<ResultObject>((-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<ResultObject>((-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<ResultObject>(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<ResultObject>(OrganizationNotFoundError);
#region Check Space and Account
// Check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0)
return Warning<ResultObject>((-accountCheck).ToString());
// Check space
int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive);
if (packageCheck < 0)
return Warning<ResultObject>((-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<ResultObject>(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<ResultObject>(OrganizationNotFoundError);
#region Check Space and Account
// Check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0)
return Warning<ResultObject>((-accountCheck).ToString());
// Check space
int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive);
if (packageCheck < 0)
return Warning<ResultObject>((-packageCheck).ToString());
#endregion
// check quotas
UpdateOrganizationQuotas(item);
if(item.MaxMailboxCountQuota > -1 && mailboxesNumber > item.MaxMailboxCountQuota)
return Error<ResultObject>(UpdateQuotasWrongQuotaError);
if (item.MaxContactCountQuota > -1 && contactsNumber > item.MaxContactCountQuota)
return Error<ResultObject>(UpdateQuotasWrongQuotaError);
if (item.MaxDistributionListCountQuota > -1 && distributionListsNumber > item.MaxDistributionListCountQuota)
return Error<ResultObject>(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<ResultObject>(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<ResultObject>(OrganizationNotFoundError);
#region Check Space and Account
// Check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0)
return Warning<ResultObject>((-accountCheck).ToString());
// Check space
int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive);
if (packageCheck < 0)
return Warning<ResultObject>((-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<ResultObject>(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<ResultObject>(OrganizationNotFoundError);
#region Check Space and Account
// Check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsAdmin | DemandAccount.IsActive);
if (accountCheck < 0)
return Warning<ResultObject>((-accountCheck).ToString());
// Check space
int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive);
if (packageCheck < 0)
return Warning<ResultObject>((-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<ResultObject>((-moveResult).ToString());
return result;
}
catch (Exception ex)
{
// log error
TaskManager.WriteError(ex);
// exit with error code
return Error<ResultObject>(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<ResultObject>(OrganizationNotFoundError);
#region Check Space and Account
// Check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0)
return Warning<ResultObject>((-accountCheck).ToString());
// Check space
int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive);
if (packageCheck < 0)
return Warning<ResultObject>((-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<ResultObject>(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<T>(params string[] messageParts)
{
return Warning<T>(null, messageParts);
}
private static T Warning<T>(ResultObject innerResult, params string[] messageParts)
{
return Result<T>(innerResult, false, messageParts);
}
private static T Error<T>(params string[] messageParts)
{
return Error<T>(null, messageParts);
}
private static T Error<T>(ResultObject innerResult, params string[] messageParts)
{
return Result<T>(innerResult, true, messageParts);
}
private static T Result<T>(ResultObject innerResult, bool isError, params string[] messageParts)
{
object obj = Activator.CreateInstance<T>();
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
}
}

View file

@ -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<string> resSettings = new List<string>(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<string> 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<LyncUserResult>("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<int> retIds = new List<int>();
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<LyncUserPlan>(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<LyncUserResult>("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<LyncUsersPagedResult>("LYNC", "GET_LYNC_USERS");
try
{
IDataReader reader =
DataProvider.GetLyncUsers(itemId, sortColumn, sortDirection, startRow, count);
List<LyncUser> accounts = new List<LyncUser>();
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<IntResult>("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<LyncUserResult>("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<LyncUserPlan> GetLyncUserPlans(int itemId)
{
// place log record
TaskManager.StartTask("LYNC", "GET_LYNC_LYNCUSERPLANS");
TaskManager.ItemId = itemId;
try
{
return ObjectUtils.CreateListFromDataReader<LyncUserPlan>(
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<LyncUserPlan>(
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<LyncUserResult>("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<LyncUserResult>("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
}
}

View file

@ -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;
}
}
}
}
}

View file

@ -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<OrganizationUser> Tmpaccounts = new List<OrganizationUser>();
ObjectUtils.FillCollectionFromDataView(Tmpaccounts, ds.Tables[1].DefaultView);
result.PageUsers = Tmpaccounts.ToArray();
List<OrganizationUser> accounts = new List<OrganizationUser>();
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<OrganizationUser>(
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<OrganizationUser>(
DataProvider.SearchOrganizationAccounts(SecurityContext.User.UserId, itemId,
filterColumn, filterValue, sortColumn, includeMailboxes));
List<OrganizationUser> Tmpaccounts = ObjectUtils.CreateListFromDataReader<OrganizationUser>(
DataProvider.SearchOrganizationAccounts(SecurityContext.User.UserId, itemId,
filterColumn, filterValue, sortColumn, includeMailboxes));
List<OrganizationUser> Accounts = new List<OrganizationUser>();
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<OrganizationDomainName> GetOrganizationDomains(int itemId)

View file

@ -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<PackageInfo> packages = new List<PackageInfo>();
@ -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<PackageAddonInfo> lstAddOns = ObjectUtils.CreateListFromDataSet<PackageAddonInfo>(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)

View file

@ -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))
{

View file

@ -78,6 +78,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="esLync.asmx" />
<Content Include="esVirtualizationServerForPrivateCloud.asmx" />
<Content Include="Default.aspx" />
<Content Include="ecStorefront.asmx" />
@ -89,7 +90,6 @@
<Content Include="esComments.asmx" />
<Content Include="esCRM.asmx" />
<Content Include="esDatabaseServers.asmx" />
<Content Include="esExchangeHostedEdition.asmx" />
<Content Include="esExchangeServer.asmx" />
<Content Include="esFiles.asmx" />
<Content Include="esFtpServers.asmx" />
@ -131,6 +131,8 @@
<Compile Include="Code\Common\ServiceUsernameTokenManager.cs" />
<Compile Include="Code\Common\UsernameAssertion.cs" />
<Compile Include="Code\Common\Utils.cs" />
<Compile Include="Code\HostedSolution\LyncController.cs" />
<Compile Include="Code\HostedSolution\LyncControllerAsync.cs" />
<Compile Include="Code\VirtualizationForPrivateCloud\CreateAsyncVMfromVM.cs" />
<Compile Include="Code\VirtualizationForPrivateCloud\CreateServerAsyncWorkerForPrivateCloud.cs" />
<Compile Include="Code\VirtualizationForPrivateCloud\VirtualizationServerControllerForPrivateCloud.cs" />
@ -164,7 +166,6 @@
<Compile Include="Code\Ecommerce\TaskEventHandlers\SystemTriggersAgent.cs" />
<Compile Include="Code\Ecommerce\TriggerSystem\CommonTrigger.cs" />
<Compile Include="Code\Ecommerce\TriggerSystem\TriggerController.cs" />
<Compile Include="Code\ExchangeHostedEdition\ExchangeHostedEditionController.cs" />
<Compile Include="Code\ExchangeServer\ExchangeServerController.cs" />
<Compile Include="Code\Files\FilesController.cs" />
<Compile Include="Code\FtpServers\FtpServerController.cs" />
@ -237,6 +238,10 @@
<Compile Include="Code\WebServers\WebServerController.cs" />
<Compile Include="Code\Wizards\UserCreationWizard.cs" />
<Compile Include="Code\Wizards\WebApplicationsInstaller.cs" />
<Compile Include="esLync.asmx.cs">
<DependentUpon>esLync.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="esVirtualizationServerForPrivateCloud.asmx.cs">
<DependentUpon>esVirtualizationServerForPrivateCloud.asmx</DependentUpon>
<SubType>Component</SubType>
@ -292,10 +297,6 @@
<DependentUpon>esDatabaseServers.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="esExchangeHostedEdition.asmx.cs">
<DependentUpon>esExchangeHostedEdition.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="esExchangeServer.asmx.cs">
<DependentUpon>esExchangeServer.asmx</DependentUpon>
<SubType>Component</SubType>

View file

@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="esExchangeHostedEdition.asmx.cs" Class="WebsitePanel.EnterpriseServer.esExchangeHostedEdition" %>

View file

@ -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>
/// Summary description for esExchangeHostedEdition
/// </summary>
[WebService(Namespace = "http://smbsaas/websitepanel/enterpriseserver")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[Policy("ServerPolicy")]
[ToolboxItem(false)]
public class esExchangeHostedEdition : WebService
{
[WebMethod]
public List<ExchangeOrganization> 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<ExchangeOrganizationDomain> 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);
}
}
}

View file

@ -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<Organization> GetExchangeOrganizations(int packageId, bool recursive)
{
return ExchangeServerController.GetExchangeOrganizations(packageId, recursive);
}
[WebMethod]
public List<Organization> 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<ExchangeAccount> GetAccounts(int itemId, ExchangeAccountType accountType)
{
return ExchangeServerController.GetAccounts(itemId, accountType);
}
[WebMethod]
public List<ExchangeAccount> GetAccounts(int itemId, ExchangeAccountType accountType)
{
return ExchangeServerController.GetAccounts(itemId, accountType);
}
[WebMethod]
public List<ExchangeAccount> SearchAccounts(int itemId,
bool includeMailboxes, bool includeContacts, bool includeDistributionLists,
[WebMethod]
public List<ExchangeAccount> GetExchangeAccountByMailboxPlanId(int itemId, int mailboxPlanId)
{
return ExchangeServerController.GetExchangeAccountByMailboxPlanId(itemId, mailboxPlanId);
}
[WebMethod]
public List<ExchangeAccount> 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<ExchangeMailboxPlan> 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
}
}

View file

@ -0,0 +1 @@
<%@ WebService Language="C#" CodeBehind="esLync.asmx.cs" Class="WebsitePanel.EnterpriseServer.esLync" %>

View file

@ -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>
/// Summary description for esLync
/// </summary>
[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<LyncUserPlan> 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
}
}

View file

@ -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<Organization> 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<OrganizationDomainName> 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<OrganizationUser> SearchAccounts(int itemId,
public List<OrganizationUser> 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);
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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<ExchangeOrganizationDomain> 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);
}
}

View file

@ -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)
{

View file

@ -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; }
}
}
}
}

View file

@ -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; }
}
}
}

View file

@ -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;
}
}
}

View file

@ -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; }
}
}
}

View file

@ -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);
}
}

View file

@ -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();
}
}

View file

@ -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);
}
}

View file

@ -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";
}
}

View file

@ -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";
}
}

View file

@ -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();
}
}
}
public bool MarkForMonitoring
{
get { return this.markForMonitoring; }
set { this.markForMonitoring = value; }
}
public string ProxyFqdn
{
get { return this.proxyFqdn; }
set { this.proxyFqdn = value; }
}
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}
}

View file

@ -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; }
}
}
}
}
}

View file

@ -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
}
}

View file

@ -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; }
}
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}
}

View file

@ -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
};
}
}

View file

@ -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; }
}
}
}

View file

@ -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<LyncUser>
{
}
}

View file

@ -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<LyncUsersPaged>
{
}
}

View file

@ -74,14 +74,21 @@
<Compile Include="Common\ByteOperations.cs" />
<Compile Include="Common\ErrorCodes.cs" />
<Compile Include="Common\PasswdHelper.cs" />
<Compile Include="ExchangeHostedEdition\ExchangeOrganization.cs" />
<Compile Include="ExchangeHostedEdition\ExchangeOrganizationDomain.cs" />
<Compile Include="ExchangeHostedEdition\IExchangeHostedEdition.cs" />
<Compile Include="HostedSolution\BaseReport.cs" />
<Compile Include="HostedSolution\BaseStatistics.cs" />
<Compile Include="HostedSolution\BlackBerryErrorsCodes.cs" />
<Compile Include="HostedSolution\BlackBerryStatsItem.cs" />
<Compile Include="HostedSolution\BlackBerryUserDeleteState.cs" />
<Compile Include="HostedSolution\ExchangeMailboxPlan.cs" />
<Compile Include="HostedSolution\ILyncServer.cs" />
<Compile Include="HostedSolution\LyncConstants.cs" />
<Compile Include="HostedSolution\LyncErrorCodes.cs" />
<Compile Include="HostedSolution\LyncFederationDomain.cs" />
<Compile Include="HostedSolution\LyncUser.cs" />
<Compile Include="HostedSolution\LyncUserPlan.cs" />
<Compile Include="HostedSolution\LyncUsersPaged.cs" />
<Compile Include="HostedSolution\LyncVoicePolicyType.cs" />
<Compile Include="HostedSolution\TransactionAction.cs" />
<Compile Include="ResultObjects\HeliconApe.cs" />
<Compile Include="HostedSolution\ExchangeMobileDevice.cs" />
<Compile Include="HostedSolution\IOCSEdgeServer.cs" />
@ -119,6 +126,8 @@
<Compile Include="ResultObjects\IntResult.cs" />
<Compile Include="ResultObjects\JobsValue.cs" />
<Compile Include="HostedSolution\OCSUsersPaged.cs" />
<Compile Include="ResultObjects\LyncUserResult.cs" />
<Compile Include="ResultObjects\LyncUsersPagedResult.cs" />
<Compile Include="ResultObjects\OCSUserResult.cs" />
<Compile Include="ResultObjects\OCSUsersPagedResult.cs" />
<Compile Include="ResultObjects\OrganizationResult.cs" />

View file

@ -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"))

View file

@ -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
/// <summary>
/// Creates organization on Mail Server
/// </summary>
/// <param name="organizationId"></param>
/// <returns></returns>
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<PSObject> 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<PSObject> 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<PSObject> 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<PSObject> 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<PSObject> 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<ADObjectId> servers = (ADMultiValuedProperty<ADObjectId>)GetPSObjectProperty(dags[0], "Servers");
if (servers != null)
{
System.Collections.Generic.List<string> lstDatabase = new System.Collections.Generic.List<string>();
foreach (object objServer in servers)
{
Collection<PSObject> 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;
}
}
}

View file

@ -33,71 +33,67 @@ using WebsitePanel.Server.Utils;
namespace WebsitePanel.Providers.HostedSolution
{
/// <summary>
/// Exchange Log Helper Methods
/// </summary>
internal class ExchangeLog
{
internal static string LogPrefix = "Exchange";
/// <summary>
/// Exchange Log Helper Methods
/// </summary>
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());
}
}
}

View file

@ -30,228 +30,180 @@ using System.Collections.Generic;
namespace WebsitePanel.Providers.HostedSolution
{
internal class ExchangeTransaction
{
List<TransactionAction> actions = null;
internal class ExchangeTransaction
{
List<TransactionAction> actions = null;
public ExchangeTransaction()
{
actions = new List<TransactionAction>();
}
public ExchangeTransaction()
{
actions = new List<TransactionAction>();
}
internal List<TransactionAction> Actions
{
get { return actions; }
}
internal List<TransactionAction> 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);
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -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<TransactionAction> actions = null;
public LyncTransaction()
{
actions = new List<TransactionAction>();
}
internal List<TransactionAction> 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);
}
}
}

View file

@ -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

View file

@ -106,6 +106,15 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Exchange.Net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Rtc.Management.Core">
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Rtc.Management.Hosted">
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.Hosted.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Rtc.Management.WritableConfig">
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.WritableConfig.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint">
<HintPath>..\..\Lib\References\Microsoft\Microsoft.SharePoint.dll</HintPath>
<Private>False</Private>
@ -131,7 +140,10 @@
<Compile Include="BlackBerry5Provider.cs" />
<Compile Include="BlackBerryProvider.cs" />
<Compile Include="Exchange2010.cs" />
<Compile Include="Exchange2010SP2.cs" />
<Compile Include="HostedSharePointServer2010.cs" />
<Compile Include="Lync2010.cs" />
<Compile Include="LyncTransaction.cs" />
<Compile Include="OCSEdge2007R2.cs" />
<Compile Include="OCS2007R2.cs" />
<Compile Include="CRMProvider.cs" />

View file

@ -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<string>(
/*
iisObject.SetValue<string>(
WebSite.WmSvcAccountName,
GetNonQualifiedAccountName((String)scopeCollection[0]["name"]));
//
*/
iisObject.SetValue<string>(
WebSite.WmSvcAccountName, (String)scopeCollection[0]["name"]);
//
iisObject.SetValue<string>(
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

View file

@ -1,574 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
//
// 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;
/// <remarks/>
[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;
/// <remarks/>
public ExchangeServerHostedEdition() {
this.Url = "http://localhost:9003/ExchangeServerHostedEdition.asmx";
}
/// <remarks/>
public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted;
/// <remarks/>
public event GetOrganizationDomainsCompletedEventHandler GetOrganizationDomainsCompleted;
/// <remarks/>
public event AddOrganizationDomainCompletedEventHandler AddOrganizationDomainCompleted;
/// <remarks/>
public event DeleteOrganizationDomainCompletedEventHandler DeleteOrganizationDomainCompleted;
/// <remarks/>
public event GetOrganizationDetailsCompletedEventHandler GetOrganizationDetailsCompleted;
/// <remarks/>
public event UpdateOrganizationQuotasCompletedEventHandler UpdateOrganizationQuotasCompleted;
/// <remarks/>
public event UpdateOrganizationCatchAllAddressCompletedEventHandler UpdateOrganizationCatchAllAddressCompleted;
/// <remarks/>
public event UpdateOrganizationServicePlanCompletedEventHandler UpdateOrganizationServicePlanCompleted;
/// <remarks/>
public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted;
/// <remarks/>
[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});
}
/// <remarks/>
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);
}
/// <remarks/>
public void EndCreateOrganization(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
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);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginGetOrganizationDomains(string organizationId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetOrganizationDomains", new object[] {
organizationId}, callback, asyncState);
}
/// <remarks/>
public ExchangeOrganizationDomain[] EndGetOrganizationDomains(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ExchangeOrganizationDomain[])(results[0]));
}
/// <remarks/>
public void GetOrganizationDomainsAsync(string organizationId) {
this.GetOrganizationDomainsAsync(organizationId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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});
}
/// <remarks/>
public System.IAsyncResult BeginAddOrganizationDomain(string organizationId, string domain, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("AddOrganizationDomain", new object[] {
organizationId,
domain}, callback, asyncState);
}
/// <remarks/>
public void EndAddOrganizationDomain(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void AddOrganizationDomainAsync(string organizationId, string domain) {
this.AddOrganizationDomainAsync(organizationId, domain, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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});
}
/// <remarks/>
public System.IAsyncResult BeginDeleteOrganizationDomain(string organizationId, string domain, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("DeleteOrganizationDomain", new object[] {
organizationId,
domain}, callback, asyncState);
}
/// <remarks/>
public void EndDeleteOrganizationDomain(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void DeleteOrganizationDomainAsync(string organizationId, string domain) {
this.DeleteOrganizationDomainAsync(organizationId, domain, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginGetOrganizationDetails(string organizationId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetOrganizationDetails", new object[] {
organizationId}, callback, asyncState);
}
/// <remarks/>
public ExchangeOrganization EndGetOrganizationDetails(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ExchangeOrganization)(results[0]));
}
/// <remarks/>
public void GetOrganizationDetailsAsync(string organizationId) {
this.GetOrganizationDetailsAsync(organizationId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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});
}
/// <remarks/>
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);
}
/// <remarks/>
public void EndUpdateOrganizationQuotas(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void UpdateOrganizationQuotasAsync(string organizationId, int mailboxesNumber, int contactsNumber, int distributionListsNumber) {
this.UpdateOrganizationQuotasAsync(organizationId, mailboxesNumber, contactsNumber, distributionListsNumber, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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});
}
/// <remarks/>
public System.IAsyncResult BeginUpdateOrganizationCatchAllAddress(string organizationId, string catchAllEmail, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("UpdateOrganizationCatchAllAddress", new object[] {
organizationId,
catchAllEmail}, callback, asyncState);
}
/// <remarks/>
public void EndUpdateOrganizationCatchAllAddress(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void UpdateOrganizationCatchAllAddressAsync(string organizationId, string catchAllEmail) {
this.UpdateOrganizationCatchAllAddressAsync(organizationId, catchAllEmail, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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});
}
/// <remarks/>
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);
}
/// <remarks/>
public void EndUpdateOrganizationServicePlan(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void UpdateOrganizationServicePlanAsync(string organizationId, string programId, string offerId) {
this.UpdateOrganizationServicePlanAsync(organizationId, programId, offerId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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});
}
/// <remarks/>
public System.IAsyncResult BeginDeleteOrganization(string organizationId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("DeleteOrganization", new object[] {
organizationId}, callback, asyncState);
}
/// <remarks/>
public void EndDeleteOrganization(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void DeleteOrganizationAsync(string organizationId) {
this.DeleteOrganizationAsync(organizationId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void CreateOrganizationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetOrganizationDomainsCompletedEventHandler(object sender, GetOrganizationDomainsCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public ExchangeOrganizationDomain[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((ExchangeOrganizationDomain[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void AddOrganizationDomainCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void DeleteOrganizationDomainCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetOrganizationDetailsCompletedEventHandler(object sender, GetOrganizationDetailsCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public ExchangeOrganization Result {
get {
this.RaiseExceptionIfNecessary();
return ((ExchangeOrganization)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void UpdateOrganizationQuotasCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void UpdateOrganizationCatchAllAddressCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void UpdateOrganizationServicePlanCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void DeleteOrganizationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
}

View file

@ -0,0 +1,912 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
//
// 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;
/// <remarks/>
[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;
/// <remarks/>
public LyncServer()
{
this.Url = "http://localhost:9003/LyncServer.asmx";
}
/// <remarks/>
public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted;
/// <remarks/>
public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted;
/// <remarks/>
public event CreateUserCompletedEventHandler CreateUserCompleted;
/// <remarks/>
public event GetLyncUserGeneralSettingsCompletedEventHandler GetLyncUserGeneralSettingsCompleted;
/// <remarks/>
public event SetLyncUserPlanCompletedEventHandler SetLyncUserPlanCompleted;
/// <remarks/>
public event DeleteUserCompletedEventHandler DeleteUserCompleted;
/// <remarks/>
public event GetFederationDomainsCompletedEventHandler GetFederationDomainsCompleted;
/// <remarks/>
public event AddFederationDomainCompletedEventHandler AddFederationDomainCompleted;
/// <remarks/>
public event RemoveFederationDomainCompletedEventHandler RemoveFederationDomainCompleted;
/// <remarks/>
public event ReloadConfigurationCompletedEventHandler ReloadConfigurationCompleted;
/// <remarks/>
[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]));
}
/// <remarks/>
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);
}
/// <remarks/>
public string EndCreateOrganization(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}
/// <remarks/>
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);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginDeleteOrganization(string organizationId, string sipDomain, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("DeleteOrganization", new object[] {
organizationId,
sipDomain}, callback, asyncState);
}
/// <remarks/>
public bool EndDeleteOrganization(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((bool)(results[0]));
}
/// <remarks/>
public void DeleteOrganizationAsync(string organizationId, string sipDomain)
{
this.DeleteOrganizationAsync(organizationId, sipDomain, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
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);
}
/// <remarks/>
public bool EndCreateUser(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((bool)(results[0]));
}
/// <remarks/>
public void CreateUserAsync(string organizationId, string userUpn, LyncUserPlan plan)
{
this.CreateUserAsync(organizationId, userUpn, plan, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginGetLyncUserGeneralSettings(string organizationId, string userUpn, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("GetLyncUserGeneralSettings", new object[] {
organizationId,
userUpn}, callback, asyncState);
}
/// <remarks/>
public LyncUser EndGetLyncUserGeneralSettings(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((LyncUser)(results[0]));
}
/// <remarks/>
public void GetLyncUserGeneralSettingsAsync(string organizationId, string userUpn)
{
this.GetLyncUserGeneralSettingsAsync(organizationId, userUpn, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
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);
}
/// <remarks/>
public bool EndSetLyncUserPlan(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((bool)(results[0]));
}
/// <remarks/>
public void SetLyncUserPlanAsync(string organizationId, string userUpn, LyncUserPlan plan)
{
this.SetLyncUserPlanAsync(organizationId, userUpn, plan, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginDeleteUser(string userUpn, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("DeleteUser", new object[] {
userUpn}, callback, asyncState);
}
/// <remarks/>
public bool EndDeleteUser(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((bool)(results[0]));
}
/// <remarks/>
public void DeleteUserAsync(string userUpn)
{
this.DeleteUserAsync(userUpn, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginGetFederationDomains(string organizationId, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("GetFederationDomains", new object[] {
organizationId}, callback, asyncState);
}
/// <remarks/>
public LyncFederationDomain[] EndGetFederationDomains(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((LyncFederationDomain[])(results[0]));
}
/// <remarks/>
public void GetFederationDomainsAsync(string organizationId)
{
this.GetFederationDomainsAsync(organizationId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
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);
}
/// <remarks/>
public bool EndAddFederationDomain(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((bool)(results[0]));
}
/// <remarks/>
public void AddFederationDomainAsync(string organizationId, string domainName, string proxyFqdn)
{
this.AddFederationDomainAsync(organizationId, domainName, proxyFqdn, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginRemoveFederationDomain(string organizationId, string domainName, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("RemoveFederationDomain", new object[] {
organizationId,
domainName}, callback, asyncState);
}
/// <remarks/>
public bool EndRemoveFederationDomain(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((bool)(results[0]));
}
/// <remarks/>
public void RemoveFederationDomainAsync(string organizationId, string domainName)
{
this.RemoveFederationDomainAsync(organizationId, domainName, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]);
}
/// <remarks/>
public System.IAsyncResult BeginReloadConfiguration(System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("ReloadConfiguration", new object[0], callback, asyncState);
}
/// <remarks/>
public void EndReloadConfiguration(System.IAsyncResult asyncResult)
{
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void ReloadConfigurationAsync()
{
this.ReloadConfigurationAsync(null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
public new void CancelAsync(object userState)
{
base.CancelAsync(userState);
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public string Result
{
get
{
this.RaiseExceptionIfNecessary();
return ((string)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void DeleteOrganizationCompletedEventHandler(object sender, DeleteOrganizationCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public bool Result
{
get
{
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void CreateUserCompletedEventHandler(object sender, CreateUserCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public bool Result
{
get
{
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetLyncUserGeneralSettingsCompletedEventHandler(object sender, GetLyncUserGeneralSettingsCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public LyncUser Result
{
get
{
this.RaiseExceptionIfNecessary();
return ((LyncUser)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SetLyncUserPlanCompletedEventHandler(object sender, SetLyncUserPlanCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public bool Result
{
get
{
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void DeleteUserCompletedEventHandler(object sender, DeleteUserCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public bool Result
{
get
{
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetFederationDomainsCompletedEventHandler(object sender, GetFederationDomainsCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public LyncFederationDomain[] Result
{
get
{
this.RaiseExceptionIfNecessary();
return ((LyncFederationDomain[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void AddFederationDomainCompletedEventHandler(object sender, AddFederationDomainCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public bool Result
{
get
{
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void RemoveFederationDomainCompletedEventHandler(object sender, RemoveFederationDomainCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public bool Result
{
get
{
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void ReloadConfigurationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
}

View file

@ -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.
//------------------------------------------------------------------------------
// <auto-generated>
// 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;
/// <remarks/>
[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;
/// <remarks/>
public Organizations() {
this.Url = "http://exchange-dev:9003/Organizations.asmx";
this.Url = "http://localhost:9006/Organizations.asmx";
}
/// <remarks/>
@ -103,7 +77,7 @@ namespace WebsitePanel.Providers.HostedSolution {
public event DeleteUserCompletedEventHandler DeleteUserCompleted;
/// <remarks/>
public event GeUserGeneralSettingsCompletedEventHandler GeUserGeneralSettingsCompleted;
public event GetUserGeneralSettingsCompletedEventHandler GetUserGeneralSettingsCompleted;
/// <remarks/>
public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted;
@ -117,6 +91,9 @@ namespace WebsitePanel.Providers.HostedSolution {
/// <remarks/>
public event GetPasswordPolicyCompletedEventHandler GetPasswordPolicyCompleted;
/// <remarks/>
public event GetSamAccountNameByUserPrincipalNameCompletedEventHandler GetSamAccountNameByUserPrincipalNameCompleted;
/// <remarks/>
[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 {
/// <remarks/>
[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]));
}
/// <remarks/>
@ -266,8 +244,9 @@ namespace WebsitePanel.Providers.HostedSolution {
}
/// <remarks/>
public void EndCreateUser(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
public int EndCreateUser(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((int)(results[0]));
}
/// <remarks/>
@ -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 {
/// <remarks/>
[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]));
}
/// <remarks/>
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);
}
/// <remarks/>
public OrganizationUser EndGeUserGeneralSettings(System.IAsyncResult asyncResult) {
public OrganizationUser EndGetUserGeneralSettings(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((OrganizationUser)(results[0]));
}
/// <remarks/>
public void GeUserGeneralSettingsAsync(string loginName, string organizationId) {
this.GeUserGeneralSettingsAsync(loginName, organizationId, null);
public void GetUserGeneralSettingsAsync(string loginName, string organizationId) {
this.GetUserGeneralSettingsAsync(loginName, organizationId, null);
}
/// <remarks/>
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 {
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginGetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetSamAccountNameByUserPrincipalName", new object[] {
organizationId,
userPrincipalName}, callback, asyncState);
}
/// <remarks/>
public string EndGetSamAccountNameByUserPrincipalName(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}
/// <remarks/>
public void GetSamAccountNameByUserPrincipalNameAsync(string organizationId, string userPrincipalName) {
this.GetSamAccountNameByUserPrincipalNameAsync(organizationId, userPrincipalName, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
}
/// <remarks/>
[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 {
/// <remarks/>
[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);
/// <remarks/>
[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;
}
/// <remarks/>
public int Result {
get {
this.RaiseExceptionIfNecessary();
return ((int)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
@ -826,17 +863,17 @@ namespace WebsitePanel.Providers.HostedSolution {
/// <remarks/>
[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);
/// <remarks/>
[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 {
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetSamAccountNameByUserPrincipalNameCompletedEventHandler(object sender, GetSamAccountNameByUserPrincipalNameCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public string Result {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[0]));
}
}
}
}

View file

@ -78,10 +78,10 @@
<Compile Include="CRMProxy.cs" />
<Compile Include="DatabaseServerProxy.cs" />
<Compile Include="DnsServerProxy.cs" />
<Compile Include="ExchangeServerHostedEditionProxy.cs" />
<Compile Include="ExchangeServerProxy.cs" />
<Compile Include="FtpServerProxy.cs" />
<Compile Include="HostedSharePointServerProxy.cs" />
<Compile Include="LyncServerProxy.cs" />
<Compile Include="OCSEdgeServerProxy.cs" />
<Compile Include="OCSServerProxy.cs" />
<Compile Include="OrganizationProxy.cs" />

View file

@ -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
{
/// <summary>
/// Application log.
/// </summary>
public sealed class Log
{
/// <summary>
/// Application log.
/// </summary>
public sealed class Log
{
private static TraceSwitch logSeverity = new TraceSwitch("Log", "General trace switch");
private Log()
{
}
/// <summary>
/// Write error to the log.
/// </summary>
/// <param name="message">Error message.</param>
/// <param name="ex">Exception.</param>
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()
{
}
/// <summary>
/// Write error to the log.
/// </summary>
/// <param name="ex">Exception.</param>
public static void WriteError(Exception ex)
{
/// <summary>
/// Write error to the log.
/// </summary>
/// <param name="message">Error message.</param>
/// <param name="ex">Exception.</param>
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 { }
}
/// <summary>
/// Write error to the log.
/// </summary>
/// <param name="ex">Exception.</param>
public static void WriteError(Exception ex)
{
/// <summary>
/// Write info message to log
/// </summary>
/// <param name="message"></param>
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 { }
}
/// <summary>
/// Write info message to log
/// </summary>
/// <param name="message"></param>
public static void WriteWarning(string message, params object[] args)
{
try
{
if (logSeverity.TraceWarning)
{
Trace.TraceWarning(FormatIncomingMessage(message, args));
}
}
catch { }
}
/// <summary>
/// Write info message to log
/// </summary>
/// <param name="message"></param>
public static void WriteInfo(string message, params object[] args)
{
try
{
if (logSeverity.TraceInfo)
{
Trace.TraceInformation(FormatIncomingMessage(message, "INFO", args));
}
}
catch { }
}
/// <summary>
/// Write start message to log
/// </summary>
/// <param name="message"></param>
/// <summary>
/// Write info message to log
/// </summary>
/// <param name="message"></param>
public static void WriteWarning(string message, params object[] args)
{
try
{
if (logSeverity.TraceWarning)
{
Trace.TraceWarning(FormatIncomingMessage(message, "WARNING", args));
}
}
catch { }
}
/// <summary>
/// Write start message to log
/// </summary>
/// <param name="message"></param>
public static void WriteStart(string message, params object[] args)
{
try
{
if (logSeverity.TraceInfo)
{
Trace.TraceInformation(FormatIncomingMessage(message, args));
}
}
catch { }
}
/// <summary>
/// Write end message to log
/// </summary>
/// <param name="message"></param>
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);
}
}
/// <summary>
/// Write end message to log
/// </summary>
/// <param name="message"></param>
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);
}
}
}

View file

@ -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();

View file

@ -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

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
<%@ WebService Language="C#" CodeBehind="ExchangeServerHostedEdition.asmx.cs" Class="WebsitePanel.Server.ExchangeServerHostedEdition" %>

View file

@ -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>
/// Summary description for ExchangeHostedEdition
/// </summary>
[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<ExchangeOrganizationDomain> GetOrganizationDomains(string organizationId)
{
try
{
Log.WriteStart("'{0}' GetOrganizationDomains", ProviderSettings.ProviderName);
List<ExchangeOrganizationDomain> 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;
}
}
}
}

View file

@ -0,0 +1 @@
<%@ WebService Language="C#" CodeBehind="LyncServer.asmx.cs" Class="WebsitePanel.Server.LyncServer" %>

View file

@ -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
{
/// <summary>
/// OCS Web Service
/// </summary>
[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;
}
}
}
}

View file

@ -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);
}
}
}

View file

@ -68,7 +68,7 @@
<Content Include="AutoDiscovery.asmx" />
<Content Include="BlackBerry.asmx" />
<EmbeddedResource Include="Images\logo.png" />
<Content Include="ExchangeServerHostedEdition.asmx" />
<Content Include="LyncServer.asmx" />
<Content Include="OCSEdgeServer.asmx" />
<Content Include="OCSServer.asmx" />
<Content Include="CRM.asmx" />
@ -109,8 +109,8 @@
<Compile Include="Code\ServerConfiguration.cs" />
<Compile Include="Code\ServerUsernameTokenManager.cs" />
<Compile Include="Code\UsernameAssertion.cs" />
<Compile Include="ExchangeServerHostedEdition.asmx.cs">
<DependentUpon>ExchangeServerHostedEdition.asmx</DependentUpon>
<Compile Include="LyncServer.asmx.cs">
<DependentUpon>LyncServer.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="OCSEdgeServer.asmx.cs">

View file

@ -68,7 +68,6 @@
</MenuItem>
<MenuItem pageID="SpaceVPS" resourceGroup="VPS"/>
<MenuItem pageID="SpaceVPSForPC" resourceGroup="VPSForPC"/>
<MenuItem pageID="SpaceExchangeHostedEdition" resourceGroup="ExchangeHostedEdition"/>
<MenuItem pageID="SpaceExchangeServer" resourceGroup="Hosted Organizations"/>
<MenuItem pageID="SpaceSharedSSL" resourceGroup="OS" quota="Web.SharedSSL"/>
<MenuItem pageID="SpaceAdvancedStatistics" resourceGroup="Statistics"/>
@ -121,7 +120,6 @@
</Icon>
<Icon pageID="SpaceVPS" resourceGroup="VPS" imageUrl="images/vps/servers_48.png" />
<Icon pageID="SpaceVPSForPC" resourceGroup="VPSForPC" imageUrl="images/vps/icon-home-botbar-cloud.png" />
<Icon pageID="SpaceExchangeHostedEdition" resourceGroup="ExchangeHostedEdition" imageUrl="icons/enterprise.png"/>
<Icon pageID="SpaceExchangeServer" resourceGroup="Hosted Organizations" imageUrl="icons/enterprise.png"/>
<Icon pageID="SpaceWebApplicationsGallery" resourceGroup="Web" quota="Web.WebAppGallery" imageUrl="icons/dvd_disc_48.png"/>
<Icon pageID="SpaceApplicationsInstaller" resourceGroup="OS" quota="OS.AppInstaller" imageUrl="icons/dvd_disc_48.png"/>

View file

@ -3,7 +3,7 @@
<!-- Display Settings -->
<PortalName>WebsitePanel</PortalName>
<!-- Enterprise Server -->
<EnterpriseServer>http://localhost:9002</EnterpriseServer>
<EnterpriseServer>http://localhost:9005</EnterpriseServer>
<!-- General Settings -->
<CultureCookieName>UserCulture</CultureCookieName>
<ThemeCookieName>UserTheme</ThemeCookieName>

View file

@ -486,7 +486,10 @@
<Control key="storage_usage_details" src="WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx" title="ExchangeStorageUsageBreakdown" type="View" />
<Control key="storage_limits" src="WebsitePanel/ExchangeServer/ExchangeStorageLimits.ascx" title="ExchangeStorageLimits" type="View" />
<Control key="activesync_policy" src="WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx" title="ExchangeActiveSyncSettings" type="View" />
<Control key="CRMOrganizationDetails" src="WebsitePanel/CRM/CRMOrganizationDetails.ascx" title="ExchangeActiveSyncSettings" type="View" />
<Control key="mailboxplans" src="WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx" title="ExchangeMailboxPlans" type="View" />
<Control key="add_mailboxplan" src="WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx" title="ExchangeAddMailboxPlan" type="View" />
<Control key="CRMOrganizationDetails" src="WebsitePanel/CRM/CRMOrganizationDetails.ascx" title="ExchangeActiveSyncSettings" type="View" />
<Control key="CRMUsers" src="WebsitePanel/CRM/CRMUsers.ascx" title="CRM Users" type="View" />
<Control key="CRMUserRoles" src="WebsitePanel/CRM/CRMUserRoles.ascx" title="CRM User Roles" type="View" />
<Control key="create_crm_user" src="WebsitePanel/CRM/CreateCRMUser.ascx" title="Create CRM User" type="View" />
@ -508,7 +511,15 @@
<Control key="create_new_ocs_user" src="WebsitePanel/OCS/CreateOCSUser.ascx" title="Create New OCS User" type="View" />
<Control key="edit_ocs_user" src="WebsitePanel/OCS/EditOCSUser.ascx" title="Edit OCS User" type="View" />
</Controls>
<Control key="lync_users" src="WebsitePanel/Lync/LyncUsers.ascx" title="Lync Users" type="View" />
<Control key="create_new_lync_user" src="WebsitePanel/Lync/LyncCreateUser.ascx" title="Create New Lync User" type="View" />
<Control key="lync_userplans" src="WebsitePanel/Lync/LyncUserPlans.ascx" title="LyncUserPlans" type="View" />
<Control key="lync_federationdomains" src="WebsitePanel/Lync/LyncFederationDomains.ascx" title="LyncFederationDomains" type="View" />
<Control key="add_lyncfederation_domain" src="WebsitePanel/Lync/LyncAddFederationDomain.ascx" title="LyncAddFederationDomain" type="View" />
<Control key="add_lyncuserplan" src="WebsitePanel/Lync/LyncAddLyncUserPlan.ascx" title="LyncAddLyncUserPlan" type="View" />
<Control key="edit_lync_user" src="WebsitePanel/Lync/LyncEditUser.ascx" title="Edit Lync User" type="View" />
</Controls>
</ModuleDefinition>
<ModuleDefinition id="VPS">
@ -580,17 +591,4 @@
</Controls>
</ModuleDefinition>
<ModuleDefinition id="ExchangeHostedEdition">
<Controls>
<Control key="" src="WebsitePanel/ExchangeHostedEdition/OrganizationDetails.ascx" title="HostedExchangeOrganizationDetails" type="View" />
<Control key="create_org" src="WebsitePanel/ExchangeHostedEdition/CreateOrganization.ascx" title="HostedExchangeCreateOrganization" type="View" />
<Control key="update_org_quotas" src="WebsitePanel/ExchangeHostedEdition/UpdateOrganizationQuotas.ascx" title="HostedExchangeUpdateOrganizationQuotas" type="View" />
<Control key="update_org_catchall" src="WebsitePanel/ExchangeHostedEdition/UpdateOrganizationCatchAll.ascx" title="HostedExchangeUpdateOrganizationCatchAll" type="View" />
<Control key="update_org_plan" src="WebsitePanel/ExchangeHostedEdition/UpdateOrganizationServicePlan.ascx" title="HostedExchangeUpdateOrganizationServicePlan" type="View" />
<Control key="add_org_domain" src="WebsitePanel/ExchangeHostedEdition/AddOrganizationDomain.ascx" title="HostedExchangeAddOrganizationDomain" type="View" />
<Control key="delete_org" src="WebsitePanel/ExchangeHostedEdition/DeleteOrganization.ascx" title="HostedExchangeDeleteOrganization" type="View" />
</Controls>
</ModuleDefinition>
</ModuleDefinitions>

Some files were not shown because too many files have changed in this diff Show more