示例#1
0
        private void ConfigureGroupMailboxIfRequired(MailboxSession mailboxSession)
        {
            if (this.group.IsGroupMailboxConfigured && this.forceActionMask == (GroupMailboxConfigurationActionType)0)
            {
                return;
            }
            ConfigureGroupMailbox configureGroupMailbox = new ConfigureGroupMailbox(this.adSession, this.group, this.executingUser, mailboxSession);

            try
            {
                GroupMailboxConfigurationReport groupMailboxConfigurationReport = configureGroupMailbox.Execute((GroupMailboxConfigurationAction)this.forceActionMask);
                foreach (KeyValuePair <GroupMailboxConfigurationAction, LatencyStatistics> keyValuePair in groupMailboxConfigurationReport.ConfigurationActionLatencyStatistics)
                {
                    LatencyStatistics value = keyValuePair.Value;
                    this.AppendAggregatedOperationStatisticsToCmdletLog(keyValuePair.Key, "AD", value.ADLatency);
                    this.AppendAggregatedOperationStatisticsToCmdletLog(keyValuePair.Key, "Rpc", value.RpcLatency);
                    this.AppendGenericLatencyToCmdletLog(keyValuePair.Key, (long)value.ElapsedTime.TotalMilliseconds);
                }
            }
            catch (LocalizedException ex)
            {
                UpdateGroupMailboxViaXSO.Tracer.TraceError <string>((long)this.GetHashCode(), "UpdateGroupMailboxViaXSO.ConfigureGroupMailboxIfRequired - Caught LocalizedException: {0}", ex.Message);
                base.Error = ex.LocalizedString;
            }
        }
示例#2
0
 public override void Execute()
 {
     using (MailboxSession mailboxSession = ConfigureGroupMailbox.CreateMailboxSessionForConfiguration(this.groupMailboxPrincipal, this.group.OriginatingServer))
     {
         this.ConfigureGroupMailboxIfRequired(mailboxSession);
         string arg = GroupMailboxContext.EnsureGroupIsInDirectoryCache("UpdateGroupMailboxViaXSO.Execute", this.adSession, this.group);
         UpdateGroupMailboxViaXSO.Tracer.TraceDebug <string>((long)this.GetHashCode(), "{0}", arg);
         this.WriteMembersToGroupIfRequired(mailboxSession);
         this.SetPermissionsVersionIfRequired(mailboxSession);
     }
 }