Fix: Unable to create public folders with the same name. "sAMAccountName" didnt

get registered within ExchangeAccounts. Server Component updated to ensure
either netbios domain or "samaccountname" is returned. ES Server Component
updated to ensure it's stored within the database.
This commit is contained in:
robvde 2012-07-30 22:37:41 +04:00
parent 418c11cdf5
commit 6942c229fe
3 changed files with 35 additions and 2 deletions

View file

@ -3674,10 +3674,13 @@ namespace WebsitePanel.EnterpriseServer
name, name,
domain); domain);
ExchangePublicFolder folder = exchange.GetPublicFolderGeneralSettings(parentFolder + "\\" + folderName);
// add meta-item // add meta-item
int accountId = AddAccount(itemId, ExchangeAccountType.PublicFolder, accountName, int accountId = AddAccount(itemId, ExchangeAccountType.PublicFolder, accountName,
folderPath, email, mailEnabled, folderPath, email, mailEnabled,
0, "", null, 0 , null); 0, folder.NETBIOS+"\\"+accountName, null, 0, null);
// register email address // register email address
if(mailEnabled) if(mailEnabled)

View file

@ -31,7 +31,9 @@ namespace WebsitePanel.Providers.HostedSolution
public class ExchangePublicFolder public class ExchangePublicFolder
{ {
string name; string name;
string netbios;
string displayName; string displayName;
string sAMAccountName;
bool hideFromAddressBook; bool hideFromAddressBook;
bool mailEnabled; bool mailEnabled;
@ -89,5 +91,19 @@ namespace WebsitePanel.Providers.HostedSolution
get { return requireSenderAuthentication; } get { return requireSenderAuthentication; }
set { requireSenderAuthentication = value; } set { requireSenderAuthentication = value; }
} }
public string SAMAccountName
{
get { return this.sAMAccountName; }
set { this.sAMAccountName = value; }
}
public string NETBIOS
{
get { return this.netbios; }
set { this.netbios = value; }
}
} }
} }

View file

@ -4321,8 +4321,22 @@ namespace WebsitePanel.Providers.HostedSolution
info.Name = (string)GetPSObjectProperty(publicFolder, "Name"); info.Name = (string)GetPSObjectProperty(publicFolder, "Name");
info.MailEnabled = (bool)GetPSObjectProperty(publicFolder, "MailEnabled"); info.MailEnabled = (bool)GetPSObjectProperty(publicFolder, "MailEnabled");
info.HideFromAddressBook = (bool)GetPSObjectProperty(publicFolder, "HiddenFromAddressListsEnabled"); info.HideFromAddressBook = (bool)GetPSObjectProperty(publicFolder, "HiddenFromAddressListsEnabled");
info.NETBIOS = GetNETBIOSDomainName();
info.Accounts = GetPublicFolderAccounts(runSpace, folder); info.Accounts = GetPublicFolderAccounts(runSpace, folder);
if (info.MailEnabled)
{
Command cmd = new Command("Get-MailPublicFolder");
cmd.Parameters.Add("Identity", folder);
if (!string.IsNullOrEmpty(PublicFolderServer))
cmd.Parameters.Add("Server", PublicFolderServer);
result = ExecuteShellCommand(runSpace, cmd);
if (result.Count > 0)
{
publicFolder = result[0];
info.SAMAccountName = string.Format("{0}\\{1}", GetNETBIOSDomainName(), (string)GetPSObjectProperty(publicFolder, "Alias"));
}
}
} }
finally finally
{ {