diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs index 099e23a1..8e0a1a82 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs @@ -1241,7 +1241,6 @@ namespace WebsitePanel.EnterpriseServer private static string BuildAccountName(string orgId, string name) { string accountName = name = name.Replace(" ", ""); - string CounterStr = "00000"; int counter = 0; bool bFound = false; @@ -1249,11 +1248,10 @@ namespace WebsitePanel.EnterpriseServer do { - accountName = genSamLogin(name, CounterStr); + accountName = genSamLogin(name, counter.ToString("d5")); if (!AccountExists(accountName)) bFound = true; - CounterStr = counter.ToString("d5"); counter++; } while (!bFound); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index 4ab73171..c868b440 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1458,19 +1458,15 @@ namespace WebsitePanel.EnterpriseServer private static string BuildAccountName(string orgId, string name, int ServiceId) { string accountName = name = name.Replace(" ", ""); - string CounterStr = "00000"; int counter = 0; bool bFound = false; - if (!AccountExists(accountName, ServiceId)) return accountName; - do { - accountName = genSamLogin(name, CounterStr); + accountName = genSamLogin(name, counter.ToString("d5")); if (!AccountExists(accountName, ServiceId)) bFound = true; - CounterStr = counter.ToString("d5"); counter++; } while (!bFound);