Exemple #1
0
        private void ProcessSyncAdminAccountsResponse(FailedAdminAccounts syncAdminAccountsResponse, EhfCompanyAdmins requestAdmins, string operationName)
        {
            if (syncAdminAccountsResponse == null)
            {
                base.DiagSession.LogAndTraceInfo(EdgeSyncLoggingLevel.Low, "Successfully completed SyncAdminAccounts operation. Sync details: <{0}>", new object[]
                {
                    requestAdmins
                });
                return;
            }
            int           num              = 0;
            int           num2             = 0;
            bool          hasCriticalError = false;
            StringBuilder stringBuilder    = new StringBuilder();

            stringBuilder.AppendFormat(CultureInfo.InvariantCulture, "Tenant: <{0}> ", new object[]
            {
                requestAdmins.TenantOU
            });
            stringBuilder.Append("SyncAdminAccountUserErrors: ");
            if (syncAdminAccountsResponse.FailedUsers != null)
            {
                EhfAdminAccountSynchronizer.ClassifyFailedResponse <string>(syncAdminAccountsResponse.FailedUsers, ref num, ref num2, ref hasCriticalError, stringBuilder);
            }
            stringBuilder.Append(" SyncAdminAccountGroupErrors: ");
            if (syncAdminAccountsResponse.FailedGroups != null)
            {
                EhfAdminAccountSynchronizer.ClassifyFailedResponse <Guid>(syncAdminAccountsResponse.FailedGroups, ref num, ref num2, ref hasCriticalError, stringBuilder);
            }
            string text = stringBuilder.ToString();

            this.HandleOperationFailureCounts(requestAdmins.EhfCompanyIdentity, operationName, (num > 0) ? 1 : 0, (num2 > 0) ? 1 : 0, text, hasCriticalError);
            this.LogAdminSyncOperationFailure(operationName, num, num2, text);
        }
Exemple #2
0
        private void InvokeSyncAdminAccountsAndSyncGroupUsers(EhfCompanyAdmins admin, EhfADAdapter configADAdapter)
        {
            bool syncAdminAccountsCompleted = true;
            bool syncAdminAgentCompleted    = true;
            bool syncHelpdeskAgentCompleted = true;

            if (admin.HasLocalAdminChanges)
            {
                FailedAdminAccounts syncAdminAccountsResponse = null;
                FaultException      syncAdminException        = null;
                string syncAdminsOperation = EhfAdminAccountSynchronizer.SyncAdminsOperation;
                base.InvokeProvisioningService(syncAdminsOperation, delegate
                {
                    syncAdminAccountsResponse = this.ProvisioningService.SyncAdminAccounts(admin.GetLocalAdminsToSync(this.DiagSession), out syncAdminException);
                }, 1);
                if (syncAdminException != null)
                {
                    this.HandleOperationLevelException(syncAdminException, syncAdminsOperation, admin.EhfCompanyIdentity);
                }
                else
                {
                    this.ProcessSyncAdminAccountsResponse(syncAdminAccountsResponse, admin, syncAdminsOperation);
                }
                syncAdminAccountsCompleted = (syncAdminException == null);
            }
            if (admin.HasPartnerAdminGroupChanges)
            {
                syncAdminAgentCompleted    = this.InvokeSyncGroupUsers(admin.EhfCompanyIdentity, admin.AdminAgent, admin.TenantOU);
                syncHelpdeskAgentCompleted = this.InvokeSyncGroupUsers(admin.EhfCompanyIdentity, admin.HelpdeskAgent, admin.TenantOU);
            }
            this.UpdateSyncStateInAD(admin, configADAdapter, syncAdminAccountsCompleted, syncAdminAgentCompleted, syncHelpdeskAgentCompleted);
        }