diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs index 42a4e2bd..816eed66 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs @@ -1121,7 +1121,7 @@ namespace WebsitePanel.EnterpriseServer { return DataProvider.AddExchangeAccount(itemId, (int)accountType, accountName, displayName, primaryEmailAddress, mailEnabledPublicFolder, - mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword), mailboxPlanId, subscriberNumber.Trim()); + mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword), mailboxPlanId, (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim())); } private static void UpdateAccount(ExchangeAccount account) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs index d8f22589..60c3e411 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs @@ -3419,27 +3419,29 @@ namespace WebsitePanel.Providers.HostedSolution Runspace runSpace = null; try { - runSpace = OpenRunspace(); + runSpace = OpenRunspace(); - Command cmd = new Command("Get-DistributionGroup"); - cmd.Parameters.Add("Identity", accountName); - Collection result = ExecuteShellCommand(runSpace, cmd); - PSObject distributionGroup = result[0]; + Command cmd = new Command("Get-DistributionGroup"); + cmd.Parameters.Add("Identity", accountName); + Collection result = ExecuteShellCommand(runSpace, cmd); + PSObject distributionGroup = result[0]; - info.DisplayName = (string)GetPSObjectProperty(distributionGroup, "DisplayName"); - info.HideFromAddressBook = - (bool)GetPSObjectProperty(distributionGroup, "HiddenFromAddressListsEnabled"); + info.DisplayName = (string)GetPSObjectProperty(distributionGroup, "DisplayName"); + info.HideFromAddressBook = + (bool)GetPSObjectProperty(distributionGroup, "HiddenFromAddressListsEnabled"); - cmd = new Command("Get-Group"); - cmd.Parameters.Add("Identity", accountName); - result = ExecuteShellCommand(runSpace, cmd); - PSObject group = result[0]; + info.SAMAccountName = string.Format("{0}\\{1}", GetNETBIOSDomainName(), (string)GetPSObjectProperty(distributionGroup, "SamAccountName")); - info.ManagerAccount = GetGroupManagerAccount(runSpace, group); - info.MembersAccounts = GetGroupMembers(runSpace, accountName); - info.Notes = (string)GetPSObjectProperty(group, "Notes"); - } + cmd = new Command("Get-Group"); + cmd.Parameters.Add("Identity", accountName); + result = ExecuteShellCommand(runSpace, cmd); + PSObject group = result[0]; + + info.ManagerAccount = GetGroupManagerAccount(runSpace, group); + info.MembersAccounts = GetGroupMembers(runSpace, accountName); + info.Notes = (string)GetPSObjectProperty(group, "Notes"); + } finally {