示例#1
0
 internal void SetExternalResources(bool failOnError)
 {
     if (!AADClientFactory.IsAADEnabled())
     {
         this.AddVerboseLog("AADClient is not enabled. Skipping SetExternalResources step.");
         return;
     }
     using (new StopwatchPerformanceTracker("GroupMailboxContext.PublishExchangeResources", GenericCmdletInfoDataLogger.Instance))
     {
         try
         {
             new GroupMailboxExchangeResourcesPublisher(this.groupMailbox, this.GetActivityId()).Publish(new int?(0));
             this.AddVerboseLog("Published ExternalResources to AAD.");
             if (!this.groupMailbox.GroupMailboxExternalResourcesSet)
             {
                 this.groupMailbox.GroupMailboxExternalResourcesSet = true;
                 this.adSession.Save(this.groupMailbox);
             }
             this.AddVerboseLog("Set GroupMailboxExternalResourcesSet to true");
         }
         catch (LocalizedException ex)
         {
             if (failOnError)
             {
                 this.errorHandler(new LocalizedException(new LocalizedString("Failed to set exchangeResources in AAD: " + ex.ToString()), ex), ExchangeErrorCategory.ServerTransient, null);
             }
             else
             {
                 this.warningHandler(new LocalizedString("Failed to set exchangeResources in AAD: " + ex.ToString()));
             }
         }
     }
 }
示例#2
0
        // Token: 0x0600152B RID: 5419 RVA: 0x00078E20 File Offset: 0x00077020
        internal static bool IsGroupMailboxExchangeResourcesVersionOutdated(int?resourcesVersion, Guid mailboxGuid)
        {
            if (!AADClientFactory.IsAADEnabled())
            {
                GroupMailboxAssistantType.Tracer.TraceDebug <Guid>(0L, "GroupMailboxAssistantType.IsGroupMailboxExchangeResourcesVersionOutdated: AAD is not enabled for mailbox {0}, skipping resource publishing.", mailboxGuid);
                return(false);
            }
            bool flag = GroupMailboxExchangeResourcesPublisher.IsPublishedVersionOutdated(resourcesVersion);

            GroupMailboxAssistantType.Tracer.TraceDebug <Guid, bool>(0L, "GroupMailboxAssistantType.IsGroupMailboxExchangeResourcesVersionOutdated:  {0} - {1}", mailboxGuid, flag);
            return(flag);
        }