Lync User Provisioning retry added
This commit is contained in:
parent
8f51befe02
commit
f38530fd66
3 changed files with 27 additions and 11 deletions
|
@ -274,7 +274,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
command = new Command("Update-CsUserDatabase");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
int trySleep = 5000; int tryMaxCount = 10; bool PlanSet = false;
|
||||
int trySleep = 2000; int tryMaxCount = 10; bool PlanSet = false;
|
||||
for (int tryCount = 0; (tryCount < tryMaxCount) && (!PlanSet); tryCount++ )
|
||||
{
|
||||
try
|
||||
|
@ -285,10 +285,6 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
if (!PlanSet) System.Threading.Thread.Sleep(trySleep);
|
||||
}
|
||||
|
||||
command = new Command("Update-CsAddressBook");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
command = new Command("Update-CsUserDatabase");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -474,7 +470,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId);
|
||||
HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn);
|
||||
bool bCloseRunSpace = false;
|
||||
bool bResult = false;
|
||||
bool ret = true;
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -533,7 +529,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
command = new Command("Update-CsUserDatabase");
|
||||
ExecuteShellCommand(runspace, command, false);
|
||||
|
||||
bResult = true;
|
||||
ret = false;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -550,7 +546,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
HostedSolutionLog.LogEnd("SetLyncUserPlanInternal");
|
||||
|
||||
return bResult;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/// <summary> Deletes user.</summary>
|
||||
|
|
|
@ -509,8 +509,16 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
}
|
||||
user.CommitChanges();
|
||||
|
||||
//set-plan
|
||||
SetLyncUserPlanInternal(organizationId, userUpn, plan, runSpace);
|
||||
int trySleep = 2000; int tryMaxCount = 10; bool PlanSet = false;
|
||||
for (int tryCount = 0; (tryCount < tryMaxCount) && (!PlanSet); tryCount++)
|
||||
{
|
||||
try
|
||||
{
|
||||
PlanSet = SetLyncUserPlanInternal(organizationId, userUpn, plan, runSpace);
|
||||
}
|
||||
catch { }
|
||||
if (!PlanSet) System.Threading.Thread.Sleep(trySleep);
|
||||
}
|
||||
|
||||
//initiate addressbook generation
|
||||
cmd = new Command("Update-CsAddressBook");
|
||||
|
@ -519,6 +527,9 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
//initiate user database replication
|
||||
cmd = new Command("Update-CsUserDatabase");
|
||||
ExecuteShellCommand(runSpace, cmd, false);
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -509,7 +509,16 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
user.CommitChanges();
|
||||
|
||||
//set-plan
|
||||
SetLyncUserPlanInternal(organizationId, userUpn, plan, runSpace);
|
||||
int trySleep = 2000; int tryMaxCount = 10; bool PlanSet = false;
|
||||
for (int tryCount = 0; (tryCount < tryMaxCount) && (!PlanSet); tryCount++)
|
||||
{
|
||||
try
|
||||
{
|
||||
PlanSet = SetLyncUserPlanInternal(organizationId, userUpn, plan, runSpace);
|
||||
}
|
||||
catch { }
|
||||
if (!PlanSet) System.Threading.Thread.Sleep(trySleep);
|
||||
}
|
||||
|
||||
//initiate addressbook generation
|
||||
cmd = new Command("Update-CsAddressBook");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue