public static void TeamMailboxDiagnosticsPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store) { TeamMailboxDiagnosticsInfo teamMailboxDiagnosticsInfo = store.GetDataObject("TeamMailboxDiagnosticsInfo") as TeamMailboxDiagnosticsInfo; if (dataTable.Rows.Count == 1 && teamMailboxDiagnosticsInfo != null) { if (teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.NotAvailable) { dataTable.Rows[0]["DocumentSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncNotAvailable; dataTable.Rows[0]["MembershipSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncNotAvailable; dataTable.Rows[0]["MaintenanceSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncNotAvailable; } else { dataTable.Rows[0]["DocumentSyncStatus"] = ((teamMailboxDiagnosticsInfo.HierarchySyncInfo == null) ? OwaOptionClientStrings.TeamMailboxSyncNotAvailable : OwaOptionClientStrings.TeamMailboxSyncSuccess); dataTable.Rows[0]["MembershipSyncStatus"] = ((teamMailboxDiagnosticsInfo.MembershipSyncInfo == null) ? OwaOptionClientStrings.TeamMailboxSyncNotAvailable : OwaOptionClientStrings.TeamMailboxSyncSuccess); dataTable.Rows[0]["MaintenanceSyncStatus"] = ((teamMailboxDiagnosticsInfo.MaintenanceSyncInfo == null) ? OwaOptionClientStrings.TeamMailboxSyncNotAvailable : OwaOptionClientStrings.TeamMailboxSyncSuccess); } if (teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.Failed || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.DocumentSyncFailureOnly || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.DocumentAndMembershipSyncFailure || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.DocumentAndMaintenanceSyncFailure) { dataTable.Rows[0]["DocumentSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncError; } if (teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.Failed || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.MembershipSyncFailureOnly || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.DocumentAndMembershipSyncFailure || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.MembershipAndMaintenanceSyncFailure) { dataTable.Rows[0]["MembershipSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncError; } if (teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.Failed || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.MaintenanceSyncFailureOnly || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.MembershipAndMaintenanceSyncFailure || teamMailboxDiagnosticsInfo.Status == TeamMailboxSyncStatus.DocumentAndMaintenanceSyncFailure) { dataTable.Rows[0]["MaintenanceSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncError; } dataTable.Rows[0]["MembershipSyncDate"] = ((teamMailboxDiagnosticsInfo.MembershipSyncInfo == null) ? OwaOptionClientStrings.TeamMailboxSyncNotAvailable : ((DateTime)teamMailboxDiagnosticsInfo.MembershipSyncInfo.LastAttemptedSyncTime.Value).UtcToUserDateTimeString()); dataTable.Rows[0]["MaintenanceSyncDate"] = ((teamMailboxDiagnosticsInfo.MaintenanceSyncInfo == null) ? OwaOptionClientStrings.TeamMailboxSyncNotAvailable : ((DateTime)teamMailboxDiagnosticsInfo.MaintenanceSyncInfo.LastAttemptedSyncTime.Value).UtcToUserDateTimeString()); dataTable.Rows[0]["DocumentSyncDate"] = ((teamMailboxDiagnosticsInfo.HierarchySyncInfo == null) ? OwaOptionClientStrings.TeamMailboxSyncNotAvailable : ((DateTime)teamMailboxDiagnosticsInfo.HierarchySyncInfo.LastAttemptedSyncTime.Value).UtcToUserDateTimeString()); dataTable.Rows[0]["SynchronizationDetails"] = teamMailboxDiagnosticsInfo.ToString(); dataTable.Rows[0]["MembershipSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncStatus + dataTable.Rows[0]["MembershipSyncStatus"]; dataTable.Rows[0]["MembershipSyncDate"] = OwaOptionClientStrings.TeamMailboxSyncDate + dataTable.Rows[0]["MembershipSyncDate"]; dataTable.Rows[0]["MaintenanceSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncStatus + dataTable.Rows[0]["MaintenanceSyncStatus"]; dataTable.Rows[0]["MaintenanceSyncDate"] = OwaOptionClientStrings.TeamMailboxSyncDate + dataTable.Rows[0]["MaintenanceSyncDate"]; dataTable.Rows[0]["DocumentSyncStatus"] = OwaOptionClientStrings.TeamMailboxSyncStatus + dataTable.Rows[0]["DocumentSyncStatus"]; dataTable.Rows[0]["DocumentSyncDate"] = OwaOptionClientStrings.TeamMailboxSyncDate + dataTable.Rows[0]["DocumentSyncDate"]; dataTable.Rows[0]["TeamMailboxMembershipString1"] = OwaOptionClientStrings.TeamMailboxMembershipString1; dataTable.Rows[0]["TeamMailboxMembershipString2"] = OwaOptionClientStrings.TeamMailboxMembershipString2; dataTable.Rows[0]["TeamMailboxMembershipString3"] = OwaOptionClientStrings.TeamMailboxMembershipString3; dataTable.Rows[0]["TeamMailboxMembershipString4"] = OwaOptionClientStrings.TeamMailboxMembershipString4; dataTable.Rows[0]["TeamMailboxStartedMembershipSync"] = OwaOptionClientStrings.TeamMailboxStartedMembershipSync; dataTable.Rows[0]["TeamMailboxStartedMaintenanceSync"] = OwaOptionClientStrings.TeamMailboxStartedMaintenanceSync; dataTable.Rows[0]["TeamMailboxStartedDocumentSync"] = OwaOptionClientStrings.TeamMailboxStartedDocumentSync; } }
protected override void InternalProcessRecord() { foreach (KeyValuePair <ADUser, ExchangePrincipal> entry in base.TMPrincipals) { TeamMailboxDiagnosticsInfo teamMailboxDiagnosticsInfo = null; try { teamMailboxDiagnosticsInfo = this.GetOneTeamMailboxDiagnosticsInfo(entry); } catch (StorageTransientException ex) { base.WriteError(new RecipientTaskException(Strings.ErrorGetSiteMailboxDiagnostics(entry.Value.MailboxInfo.DisplayName, ex.Message), ex), ExchangeErrorCategory.ServerTransient, null); } catch (StoragePermanentException ex2) { base.WriteError(new RecipientTaskException(Strings.ErrorGetSiteMailboxDiagnostics(entry.Value.MailboxInfo.DisplayName, ex2.Message), ex2), ExchangeErrorCategory.ServerOperation, null); } base.WriteObject(teamMailboxDiagnosticsInfo); if (base.Fields.IsModified("SendMeEmail")) { ADObjectId item; if (!base.TryGetExecutingUserId(out item)) { base.WriteError(new RecipientTaskException(Strings.ErrorTeamMailboxCannotIdentifyTheUser), ExchangeErrorCategory.Client, null); } TeamMailbox teamMailbox = TeamMailbox.FromDataObject(entry.Key); TeamMailboxNotificationHelper teamMailboxNotificationHelper = new TeamMailboxNotificationHelper(teamMailbox, (IRecipientSession)base.DataSession); try { teamMailboxNotificationHelper.SendNotification(new List <ADObjectId> { item }, Strings.SiteMailboxDiagnosticsEmailSubject(teamMailbox.DisplayName), teamMailboxDiagnosticsInfo.ToString(), RemotingOptions.AllowCrossSite); } catch (StorageTransientException ex3) { base.WriteError(new RecipientTaskException(Strings.ErrorSendNotificationForSiteMailbox(teamMailbox.DisplayName, ex3.Message), ex3), ExchangeErrorCategory.ServerTransient, null); } catch (StoragePermanentException ex4) { base.WriteError(new RecipientTaskException(Strings.ErrorSendNotificationForSiteMailbox(teamMailbox.DisplayName, ex4.Message), ex4), ExchangeErrorCategory.ServerOperation, null); } } } }