// Token: 0x06000009 RID: 9 RVA: 0x0000215C File Offset: 0x0000035C public void OnStartBegin() { this.isStarted = true; Configuration.Initialize(this.eventLog, new Action(this.serviceManager.StopService)); if (!Configuration.ServiceEnabled) { AddressBookService.GeneralTracer.TraceDebug(0L, "The service is not enabled."); return; } AddressBookService.InitializePerfCounters(new AddressBookPerformanceCounters()); NspiPropMapper.Initialize(); this.RegisterServicePrincipalNames(); ADSession.DisableAdminTopologyMode(); this.serviceManager.AddHttpPort(6001.ToString()); NspiServer.Initialize(this.serviceManager, this.eventLog); RfriServer.Initialize(this.serviceManager, this.eventLog); if (Configuration.ProtocolLoggingEnabled) { if (string.IsNullOrEmpty(Configuration.LogFilePath)) { this.eventLog.LogEvent(AddressBookEventLogConstants.Tuple_BadConfigParameter, "LogFilePath", new object[] { Configuration.LogFilePath }); return; } ProtocolLog.Initialize(ExDateTime.UtcNow, Configuration.LogFilePath, TimeSpan.FromHours((double)Configuration.MaxRetentionPeriod), Configuration.MaxDirectorySize, Configuration.PerFileMaxSize, Configuration.ApplyHourPrecision); } }
protected override void InternalBeginProcessing() { TaskLogger.LogEnter(); if (this.Credential != null) { base.NetCredential = this.Credential.GetNetworkCredential(); } base.InternalBeginProcessing(); base.WriteVerbose(Strings.VerboseIgnoreDefaultScope); this.domainRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, false, ConsistencyMode.PartiallyConsistent, base.NetCredential, base.OrgWideSessionSettings, 106, "InternalBeginProcessing", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\RecipientTasks\\recipient\\UpdateRecipient.cs"); this.domainRecipientSession.EnforceDefaultScope = false; ADSessionSettings sessionSettings = ADSessionSettings.FromRootOrgScopeSet(); if (!OrganizationId.ForestWideOrgId.Equals(base.OrgWideSessionSettings.CurrentOrganizationId)) { sessionSettings = ADSessionSettings.FromAccountPartitionRootOrgScopeSet(base.OrgWideSessionSettings.CurrentOrganizationId.PartitionId); } this.configurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(base.DomainController, true, ConsistencyMode.PartiallyConsistent, string.IsNullOrEmpty(base.DomainController) ? null : base.NetCredential, sessionSettings, 120, "InternalBeginProcessing", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\RecipientTasks\\recipient\\UpdateRecipient.cs"); this.localForestLinkResolutionServer = ADSession.GetCurrentConfigDC(base.OrgWideSessionSettings.GetAccountOrResourceForestFqdn()); string fqdn = NativeHelpers.CanonicalNameFromDistinguishedName(this.configurationSession.GetRootDomainNamingContextFromCurrentReadConnection()); if (ADForest.IsLocalForestFqdn(fqdn) || !OrganizationId.ForestWideOrgId.Equals(base.OrgWideSessionSettings.CurrentOrganizationId)) { this.domainRecipientSession.LinkResolutionServer = this.localForestLinkResolutionServer; } TaskLogger.LogExit(); }
protected override void InternalProcessRecord() { TaskLogger.LogEnter(); Exception ex = null; try { ADSession.SetSharedConfigDC((base.CurrentOrganizationId.PartitionId != null) ? base.CurrentOrganizationId.PartitionId.ForestFQDN : TopologyProvider.LocalForestFqdn, this.DomainController, 389); } catch (DataSourceOperationException ex2) { ex = ex2; } catch (DataSourceTransientException ex3) { ex = ex3; } catch (DataValidationException ex4) { ex = ex4; } finally { if (ex != null) { base.WriteError(ex, ErrorCategory.InvalidOperation, null); } TaskLogger.LogExit(); } }
// Token: 0x06000DBC RID: 3516 RVA: 0x0002905C File Offset: 0x0002725C internal override IEnumerable <T> PerformSearch <T>(QueryFilter filter, ADObjectId rootId, IDirectorySession session, bool deepSearch) { ADObjectId deletedObjectsContainer = ADSession.GetDeletedObjectsContainer(session.GetDomainNamingContext()); ADPagedReader <RemovedMailbox> adpagedReader = session.FindPagedDeletedObject <RemovedMailbox>(deletedObjectsContainer, QueryScope.OneLevel, filter, null, 0); return((IEnumerable <T>)adpagedReader); }
private void Application_Start(object sender, EventArgs e) { EcpEventLogConstants.Tuple_EcpStarted.LogEvent(new object[] { AppDomain.CurrentDomain.FriendlyName }); if (!Util.IsDataCenter) { ServiceDiscovery.ADNotificationScope = ExchangeTopologyScope.ADAndExchangeServerAndSiteAndVirtualDirectoryTopology; } Globals.InitializeMultiPerfCounterInstance("ECP"); foreach (ExPerformanceCounter exPerformanceCounter in EcpPerfCounters.AllCounters) { exPerformanceCounter.RawValue = 0L; } using (Process currentProcess = Process.GetCurrentProcess()) { EcpPerfCounters.PID.RawValue = (long)currentProcess.Id; } ADSession.DisableAdminTopologyMode(); BaseSprite.IsDataCenter = Util.IsMicrosoftHostedOnly; BaseSprite.GetSpriteImageSrc = new GetSpriteImageSrcDelegate(Util.GetSpriteImageSrc); VirtualDirectoryConfiguration.EcpVirtualDirectoryAnonymousAuthenticationEnabled = VirtualDirectoryConfiguration.GetEcpAnonymousAuthenticationStatus(); string identification = ConfigurationManager.AppSettings["ProvisioningCacheIdentification"]; ProvisioningCache.InitializeAppRegistrySettings(identification); this.InvokeExtendedApplicationStart(sender, e); ScriptManager.ScriptResourceMapping.AddDefinition("MicrosoftAjax.js", new ScriptResourceDefinition { Path = ThemeResource.ScriptPath + "microsoftajax.js", DebugPath = ThemeResource.ScriptPath + "microsoftajax.debug.js" }); }
internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason) { if (typeof(T) != typeof(ADSchemaClassObject) && typeof(T) != typeof(ADSchemaAttributeObject)) { throw new ArgumentException(Strings.ErrorInvalidType(typeof(T).Name), "type"); } if (session == null) { throw new ArgumentNullException("session"); } IEnumerable <T> enumerable = base.GetObjects <T>(session.GetSchemaNamingContext(), session, subTreeSession, optionalData, out notFoundReason); EnumerableWrapper <T> wrapper = EnumerableWrapper <T> .GetWrapper(enumerable); if (!wrapper.HasElements() && base.InternalADObjectId != null && base.InternalADObjectId.ObjectGuid != Guid.Empty) { QueryFilter filter = new ComparisonFilter(ComparisonOperator.Equal, ADSchemaObjectSchema.SchemaIDGuid, base.InternalADObjectId.ObjectGuid); enumerable = base.PerformPrimarySearch <T>(filter, ADSession.GetSchemaNamingContextForLocalForest(), session, true, optionalData); wrapper = EnumerableWrapper <T> .GetWrapper(enumerable); } if (!wrapper.HasElements() && !string.IsNullOrEmpty(base.RawIdentity)) { QueryFilter filter2 = new ComparisonFilter(ComparisonOperator.Equal, ADSchemaObjectSchema.DisplayName, base.RawIdentity); enumerable = base.PerformPrimarySearch <T>(filter2, ADSession.GetSchemaNamingContextForLocalForest(), session, true, optionalData); wrapper = EnumerableWrapper <T> .GetWrapper(enumerable); } return(wrapper); }
protected override IConfigurable PrepareDataObject() { Container container = (Container)base.PrepareDataObject(); container.SetId(ADSession.GetConfigurationUnitsRootForLocalForest()); return(container); }
// Token: 0x0600048C RID: 1164 RVA: 0x000104A8 File Offset: 0x0000E6A8 protected override IConfigDataProvider CreateSession() { IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, false, ConsistencyMode.PartiallyConsistent, base.SessionSettings, 355, "CreateSession", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\NewAdObjectTask.cs"); tenantOrRootOrgRecipientSession.LinkResolutionServer = ADSession.GetCurrentConfigDC(base.SessionSettings.GetAccountOrResourceForestFqdn()); tenantOrRootOrgRecipientSession.UseGlobalCatalog = false; return(tenantOrRootOrgRecipientSession); }
protected override IConfigDataProvider CreateSession() { IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, false, ConsistencyMode.PartiallyConsistent, null, base.SessionSettings, ConfigScopes.TenantSubTree, 101, "CreateSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Deployment\\InstallUserAccount.cs"); tenantOrRootOrgRecipientSession.LinkResolutionServer = ADSession.GetCurrentConfigDC(tenantOrRootOrgRecipientSession.SessionSettings.GetAccountOrResourceForestFqdn()); tenantOrRootOrgRecipientSession.UseGlobalCatalog = false; return(tenantOrRootOrgRecipientSession); }
internal static IRecipientSession GetWritableRecipientSession(Fqdn domainController) { IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(domainController, false, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 514, "GetWritableRecipientSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Common\\recipient\\PermissionTaskHelper.cs"); tenantOrRootOrgRecipientSession.EnforceDefaultScope = false; tenantOrRootOrgRecipientSession.LinkResolutionServer = ADSession.GetCurrentConfigDC(tenantOrRootOrgRecipientSession.SessionSettings.GetAccountOrResourceForestFqdn()); return(tenantOrRootOrgRecipientSession); }
internal static void VerifyIsInScopes(ADObject adObject, ScopeSet scopeSet, Task.TaskErrorLoggingDelegate writeErrorDelegate) { ADScopeException ex; if (!ADSession.TryVerifyIsWithinScopes(adObject, scopeSet.RecipientReadScope, scopeSet.RecipientWriteScopes, scopeSet.ExclusiveRecipientScopes, false, out ex)) { writeErrorDelegate(new TaskException(Strings.ErrorCannotChangeObjectOutOfWriteScope(adObject.Identity.ToString(), (ex == null) ? string.Empty : ex.Message), ex), ErrorCategory.PermissionDenied, null); } }
protected override IConfigDataProvider CreateSession() { ADSessionSettings adsessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopes(base.RootOrgContainerId, base.CurrentOrganizationId, base.ExecutingUserOrganizationId, false); IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(this.DomainController, false, ConsistencyMode.PartiallyConsistent, adsessionSettings, 82, "CreateSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\RecipientTasks\\MicrosoftExchangeRecipient\\RemoveMicrosoftExchangeRecipient.cs"); tenantOrRootOrgRecipientSession.LinkResolutionServer = ADSession.GetCurrentConfigDC(adsessionSettings.GetAccountOrResourceForestFqdn()); tenantOrRootOrgRecipientSession.UseGlobalCatalog = false; return(tenantOrRootOrgRecipientSession); }
private IEnumerable <ADRawEntry> ReadDeletedObjects() { ExTraceGlobals.TenantRelocationTracer.TraceDebug((long)SyncConfiguration.TraceId, "TenantRelocationSyncConfiguration.ReadDeletedObjects ..."); int sizeLimit = Math.Max(1, TenantRelocationSyncConfiguration.ObjectsPerPageLimit - base.ReturnedObjectCount); ExTraceGlobals.TenantRelocationTracer.TraceDebug <int>((long)SyncConfiguration.TraceId, "TenantRelocationSyncConfiguration.ReadDeletedObjects sizeLimit = {0}", sizeLimit); ADRawEntry[] results = null; if (this.PageToken.State == TenantRelocationSyncState.EnumerateConfigUnitDeletedObjects) { ITenantConfigurationSession tenantConfigurationSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession(true, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(base.RecipientSession.SessionSettings.CurrentOrganizationId), 629, "ReadDeletedObjects", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\Sync\\TenantRelocationSync\\TenantRelocationSyncConfiguration.cs"); tenantConfigurationSession.DomainController = base.RecipientSession.DomainController; tenantConfigurationSession.LogSizeLimitExceededEvent = false; tenantConfigurationSession.UseGlobalCatalog = false; tenantConfigurationSession.UseConfigNC = !ADSession.IsTenantConfigInDomainNC(base.RecipientSession.SessionSettings.GetAccountOrResourceForestFqdn()); results = tenantConfigurationSession.FindDeletedTenantSyncObjectByUsnRange(base.RecipientSession.SessionSettings.CurrentOrganizationId.OrganizationalUnit, this.PageToken.ConfigUnitTombstoneUSN, sizeLimit, TenantRelocationSyncConfiguration.PropertyDefinitionsForDeletedObjects); } else { ITenantRecipientSession tenantRecipientSession = DirectorySessionFactory.Default.CreateTenantRecipientSession(true, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromOrganizationIdWithoutRbacScopesServiceOnly(base.RecipientSession.SessionSettings.CurrentOrganizationId), 649, "ReadDeletedObjects", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\Sync\\TenantRelocationSync\\TenantRelocationSyncConfiguration.cs"); tenantRecipientSession.DomainController = base.RecipientSession.DomainController; tenantRecipientSession.LogSizeLimitExceededEvent = false; tenantRecipientSession.UseGlobalCatalog = false; results = tenantRecipientSession.FindDeletedTenantSyncObjectByUsnRange(base.RecipientSession.SessionSettings.CurrentOrganizationId.OrganizationalUnit, this.PageToken.OrganizationalUnitTombstoneUSN, sizeLimit, TenantRelocationSyncConfiguration.PropertyDefinitionsForDeletedObjects); } ExTraceGlobals.TenantRelocationTracer.TraceDebug <int>((long)SyncConfiguration.TraceId, "TenantRelocationSyncConfiguration.ReadDeletedObjects results count = {0}", (results != null) ? results.Length : 0); long maxUsnReturned = long.MaxValue; foreach (ADRawEntry entry in results) { ExTraceGlobals.TenantRelocationTracer.TraceDebug <ADObjectId>((long)SyncConfiguration.TraceId, "TenantRelocationSyncConfiguration.ReadDeletedObjects entry {0}", entry.Id); base.ReturnedObjectCount++; ExTraceGlobals.TenantRelocationTracer.TraceDebug <int>((long)SyncConfiguration.TraceId, "TenantRelocationSyncConfiguration.ReadDeletedObjects this.ReturnedObjectCount = {0}", base.ReturnedObjectCount); maxUsnReturned = (long)entry[ADRecipientSchema.UsnChanged]; yield return(entry); } if (this.PageToken.State == TenantRelocationSyncState.EnumerateConfigUnitDeletedObjects) { this.PageToken.ConfigUnitTombstoneUSN = ((maxUsnReturned == long.MaxValue) ? long.MaxValue : (maxUsnReturned + 1L)); ExTraceGlobals.TenantRelocationTracer.TraceDebug <long>((long)SyncConfiguration.TraceId, "TenantRelocationSyncConfiguration.ReadDeletedObjects set this.PageToken.ConfigUnitTombstoneUSN to {0}", this.PageToken.ConfigUnitTombstoneUSN); } else { this.PageToken.OrganizationalUnitTombstoneUSN = ((maxUsnReturned == long.MaxValue) ? long.MaxValue : (maxUsnReturned + 1L)); ExTraceGlobals.TenantRelocationTracer.TraceDebug <long>((long)SyncConfiguration.TraceId, "TenantRelocationSyncConfiguration.ReadDeletedObjects set this.PageToken.OrganizationalUnitTombstoneUSN to {0}", this.PageToken.OrganizationalUnitTombstoneUSN); } if (results.Length < sizeLimit) { this.PageToken.SwitchToNextState(); ExTraceGlobals.TenantRelocationTracer.TraceDebug((long)SyncConfiguration.TraceId, "TenantRelocationSyncConfiguration.ReadDeletedObjects no more deleted objects, we are done"); } else { ExTraceGlobals.TenantRelocationTracer.TraceDebug((long)SyncConfiguration.TraceId, "TenantRelocationSyncConfiguration.ReadDeletedObjects do nothing, page token is already up to date"); } yield break; }
private ActiveDirectoryConnectivityOutcome SearchUsingADDriver() { return(this.RunSearchOperationWithTimeCheck(delegate { QueryFilter filter = new ComparisonFilter(ComparisonOperator.Equal, ADObjectSchema.ObjectClass, "*"); base.Context.RecipientSession.Find(ADSession.GetDomainNamingContextForLocalForest(), QueryScope.Base, filter, null, 2); base.Context.CurrentDomainController = base.Context.RecipientSession.LastUsedDc; return 1; })); }
// Token: 0x06000004 RID: 4 RVA: 0x0000223C File Offset: 0x0000043C protected override void OnStartInternal(string[] args) { if (AssistantsService.debugBreakOnStart) { Debugger.Break(); } using (Process currentProcess = Process.GetCurrentProcess()) { Globals.Logger.LogEvent(InfoWorkerEventLogConstants.Tuple_ServiceStarting, null, new object[] { currentProcess.Id, "Microsoft Exchange", "15.00.1497.010" }); } AssistantsService.TracerPfd.TracePfd <int, DateTime>((long)this.GetHashCode(), "PFD IWS {0} Starting the Mailbox Assistants Service {1} ", 28055, DateTime.UtcNow); AssistantsLog.LogServiceStartEvent(this.activityId); bool flag = false; try { ADSession.DisableAdminTopologyMode(); SettingOverrideSync.Instance.Start(true); ProcessAccessManager.RegisterComponent(SettingOverrideSync.Instance); AssistantsService.TracerPfd.TracePfd <int>((long)this.GetHashCode(), "PFD IWS {0} Initializing the Assistant Infrastructure", 27479); this.databaseManager = new DatabaseManager("MSExchangeMailboxAssistants", 50, InfoworkerAssistants.CreateEventBasedAssistantTypes(), InfoworkerAssistants.CreateTimeBasedAssistantTypes(), true); this.databaseManager.Start(); MailboxSearchServer.StartServer(); Globals.Logger.LogEvent(InfoWorkerEventLogConstants.Tuple_ServiceStarted, null, new object[0]); AssistantsService.TracerPfd.TracePfd <int>((long)this.GetHashCode(), "PFD IWS {0} Mailbox Assistants Service is started successfully ", 23959); if (Configuration.MemoryMonitorEnabled) { this.memoryMonitor = new MemoryMonitor(); this.memoryMonitor.Start((ulong)Configuration.MemoryBarrierPrivateBytesUsageLimit, (uint)Configuration.MemoryBarrierNumberOfSamples, Configuration.MemoryBarrierSamplingDelay, Configuration.MemoryBarrierSamplingInterval, delegate(ulong memoryInUse) { Globals.Logger.LogEvent(InfoWorkerEventLogConstants.Tuple_ServiceOutOfMemory, null, new object[] { memoryInUse }); throw new ServiceOutOfMemoryException(); }); } this.watermarkCleanupTimer = new Timer(new TimerCallback(InfoworkerAssistants.DeleteWatermarksForDisabledAndDeprecatedAssistants), null, Configuration.WatermarkCleanupInterval, Configuration.WatermarkCleanupInterval); ProcessAccessManager.RegisterComponent(this); flag = true; } finally { if (!flag) { Globals.Logger.LogEvent(InfoWorkerEventLogConstants.Tuple_ServiceFailedToStart, null, new object[0]); } } }
protected override void InternalProcessRecord() { TaskLogger.LogEnter(); ADSession.SetAdminTopologyMode(); if (ExchangePropertyContainer.IsContainerInitialized(base.SessionState)) { ExchangePropertyContainer.SetServerSettings(base.SessionState, null); } base.SessionState.Variables[ExchangePropertyContainer.ADServerSettingsVarName] = null; TaskLogger.LogExit(); }
// Token: 0x060006FE RID: 1790 RVA: 0x0001A440 File Offset: 0x00018640 internal static IDirectorySession UnderscopeSessionToOrganization(IDirectorySession session, OrganizationId orgId, ADSessionSettings sSettings, bool rehomeDataSession = true) { ADSessionSettings adsessionSettings = sSettings ?? session.SessionSettings; ADSessionSettings adsessionSettings2 = ADSessionSettings.RescopeToOrganization(adsessionSettings, orgId, rehomeDataSession); if (adsessionSettings2 == adsessionSettings) { return(session); } return(ADSession.CreateScopedSession(session, adsessionSettings2)); }
protected override IConfigDataProvider CreateSession() { IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, false, ConsistencyMode.PartiallyConsistent, null, base.SessionSettings, 65, "CreateSession", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\ADObjectActionTask.cs"); if (this.InternalIgnoreDefaultScope) { tenantOrRootOrgRecipientSession.EnforceDefaultScope = false; } tenantOrRootOrgRecipientSession.LinkResolutionServer = ADSession.GetCurrentConfigDC(base.SessionSettings.GetAccountOrResourceForestFqdn()); return(tenantOrRootOrgRecipientSession); }
internal static void VerifyIsInScopes(ADObject adObject, ScopeSet scopeSet, Task.TaskErrorLoggingDelegate writeErrorDelegate) { try { ADSession.VerifyIsWithinScopes(adObject, scopeSet.RecipientReadScope, scopeSet.RecipientWriteScopes, scopeSet.ExclusiveRecipientScopes, false); } catch (ADScopeException) { writeErrorDelegate(new MailboxSearchScopeException(adObject.Id.ToString()), ErrorCategory.PermissionDenied, null); } }
public static ExchangeConfigurationUnit GetExchangeConfigurationUnit(ADObjectId organizationMailboxId) { if (!ADSession.IsTenantIdentity(organizationMailboxId, organizationMailboxId.GetPartitionId().ForestFQDN)) { throw new InvalidOperationException(); } ADSessionSettings sessionSettings = ADSessionSettings.FromAllTenantsObjectId(organizationMailboxId); ITenantConfigurationSession tenantConfigurationSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession(ConsistencyMode.IgnoreInvalid, sessionSettings, 495, "GetExchangeConfigurationUnit", "f:\\15.00.1497\\sources\\dev\\data\\src\\storage\\OrganizationMailbox\\OrganizationMailbox.cs"); ExchangePrincipal exchangePrincipal = OrganizationMailbox.GetExchangePrincipal(organizationMailboxId); return(tenantConfigurationSession.Read <ExchangeConfigurationUnit>(exchangePrincipal.MailboxInfo.OrganizationId.ConfigurationUnit)); }
internal static object[][] GetDirectReportsView(IRecipientSession adSession, IADOrgPerson person, params PropertyDefinition[] returnProperties) { if (returnProperties == null) { throw new ArgumentNullException("returnProperties"); } QueryFilter filter = new ComparisonFilter(ComparisonOperator.Equal, ADOrgPersonSchema.Manager, person.Id); ADPagedReader <ADRawEntry> adpagedReader = adSession.FindPagedADRawEntry(adSession.SearchRoot, QueryScope.SubTree, filter, null, 0, returnProperties); ADRawEntry[] recipients = adpagedReader.ReadAllPages(); return(ADSession.ConvertToView(recipients, returnProperties)); }
internal static IRecipientSession CreateRecipientSession(Fqdn domainController, ADSessionSettings sessionSettings) { IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(domainController, true, ConsistencyMode.PartiallyConsistent, null, sessionSettings, ConfigScopes.TenantSubTree, 92, "CreateRecipientSession", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Search\\Utils.cs"); if (VariantConfiguration.InvariantNoFlightingSnapshot.Global.MultiTenancy.Enabled) { tenantOrRootOrgRecipientSession.SessionSettings.IncludeInactiveMailbox = true; } tenantOrRootOrgRecipientSession.LinkResolutionServer = ADSession.GetCurrentConfigDC(tenantOrRootOrgRecipientSession.SessionSettings.GetAccountOrResourceForestFqdn()); tenantOrRootOrgRecipientSession.UseGlobalCatalog = true; return(tenantOrRootOrgRecipientSession); }
internal static void DoMaintenanceTask(PublicFolderDatabase publicStore, string domainController, Task.TaskWarningLoggingDelegate warningHandler) { Server server = publicStore.GetServer(); if (!server.IsExchange2007OrLater) { warningHandler(Strings.WarningSiteFolderCheckTaskNotAvailableOnTiServer(server.Name)); return; } string a = domainController; try { a = SystemConfigurationTasksHelper.GetConfigurationDomainControllerFqdn(domainController); } catch (SocketException ex) { warningHandler(Strings.ErrorResolveFqdnForDomainController(domainController, ex.Message)); } string configDC = ADSession.GetConfigDC(TopologyProvider.LocalForestFqdn, server.Name); if (string.Equals(a, configDC, StringComparison.InvariantCultureIgnoreCase)) { try { using (ExRpcAdmin exRpcAdmin = ExRpcAdmin.Create("Client=Management", server.Fqdn, null, null, null)) { exRpcAdmin.DoMaintenanceTask(publicStore.Guid, MaintenanceTask.SiteFolderCheck); } return; } catch (MapiPermanentException ex2) { TaskLogger.Trace("Set/New-OfflineAddressBook.InternalProcessRecord raises exception while running site folder check task: {0}", new object[] { ex2.Message }); warningHandler(Strings.ErrorFailedToRunSiteFolderCheckTask(server.Name, ex2.Message)); return; } catch (MapiRetryableException ex3) { TaskLogger.Trace("Set/New-OfflineAddressBook.InternalProcessRecord raises exception while running site folder check task: {0}", new object[] { ex3.Message }); warningHandler(Strings.ErrorFailedToRunSiteFolderCheckTask(server.Name, ex3.Message)); return; } } warningHandler(Strings.WarningOabSiteFolderCheckNotRun(server.Name)); }
// Token: 0x060007E9 RID: 2025 RVA: 0x0001D104 File Offset: 0x0001B304 internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason) { if (session == null) { throw new ArgumentNullException("session"); } if (subTreeSession == null) { throw new ArgumentNullException("subTreeSession"); } EnumerableWrapper <T> enumerableWrapper = null; enumerableWrapper = base.GetEnumerableWrapper <T>(enumerableWrapper, base.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason)); if (enumerableWrapper.HasElements()) { return(enumerableWrapper); } if (!typeof(T).IsAssignableFrom(typeof(AccountPartition))) { return(enumerableWrapper); } if (this.fqdn != null) { ADObjectId adobjectId = ADSession.GetDomainNamingContextForLocalForest(); adobjectId = adobjectId.GetChildId("System").GetChildId(this.fqdn.ToString()); ADPagedReader <T> collection = session.FindPaged <T>(rootId, QueryScope.SubTree, new ComparisonFilter(ComparisonOperator.Equal, AccountPartitionSchema.TrustedDomainLink, adobjectId.DistinguishedName), null, 0, null); enumerableWrapper = base.GetEnumerableWrapper <T>(enumerableWrapper, collection); if (enumerableWrapper.HasElements()) { return(enumerableWrapper); } Guid g; Guid.TryParse(this.fqdn, out g); if (TopologyProvider.LocalForestFqdn.Equals(this.fqdn.ToString(), StringComparison.OrdinalIgnoreCase) || ADObjectId.ResourcePartitionGuid.Equals(g)) { collection = session.FindPaged <T>(rootId, QueryScope.SubTree, new ComparisonFilter(ComparisonOperator.Equal, AccountPartitionSchema.IsLocalForest, true), null, 0, null); enumerableWrapper = base.GetEnumerableWrapper <T>(enumerableWrapper, collection); } if (enumerableWrapper.HasElements()) { return(enumerableWrapper); } PartitionId partitionId; if (ADAccountPartitionLocator.IsSingleForestTopology(out partitionId) && this.fqdn.ToString().Equals(partitionId.ForestFQDN, StringComparison.OrdinalIgnoreCase) && partitionId.PartitionObjectId != null) { base.UpdateInternalADObjectId(new ADObjectId(partitionId.PartitionObjectId.Value)); enumerableWrapper = base.GetEnumerableWrapper <T>(enumerableWrapper, base.GetExactMatchObjects <T>(rootId, session, optionalData)); } } return(enumerableWrapper); }
internal static string GetConfigurationDomainControllerFqdn(string domainController) { if (string.IsNullOrEmpty(domainController)) { return(ADSession.GetCurrentConfigDCForLocalForest()); } Fqdn fqdn; if (!Fqdn.TryParse(domainController, out fqdn) || 0 >= domainController.IndexOf('.')) { domainController = Dns.GetHostEntry(domainController).HostName; } return(domainController); }
static MRSService() { ServerThrottlingResource.InitializeServerThrottlingObjects(true); ResourceLoadDelayInfo.Initialize(); ADSession.DisableAdminTopologyMode(); MRSService.NextFullScanTime = DateTime.MinValue; MRSService.scheduledLogsList = new List <ILogProcessable>(); MRSService.jobPoller = new PeriodicJobExecuter("PickHeavyJobs", new PeriodicJobExecuter.JobPollerCallback(MRSService.PickHeavyJobs), 0.1); MRSService.lightJobPoller = new PeriodicJobExecuter("PickLightJobs", new PeriodicJobExecuter.JobPollerCallback(MRSService.PickLightJobs), 0.1); MRSService.logDumper = new PeriodicJobExecuter("DumpLogFiles", new PeriodicJobExecuter.JobPollerCallback(MRSService.DumpLogFiles), 0.0); MRSService.issueCache = new MRSIssueCache(); MailboxReplicationServicePerformanceCounters.LastScanTime.RawValue = CommonUtils.TimestampToPerfcounterLong(DateTime.UtcNow); MRSService.serviceStartTime = DateTime.UtcNow; }
protected override IEnumerable <ADRawEntry> GetPagedData() { if (this.Cookie == null) { DeletedRecipient item = new DeletedRecipient(); return(new List <ADRawEntry> { item }); } PropertyDefinition[] properties = new PropertyDefinition[] { ADObjectSchema.Id, ADObjectSchema.Name, ADObjectSchema.DistinguishedName, ADObjectSchema.Guid, ADObjectSchema.OrganizationalUnitRoot, ADObjectSchema.ObjectClass, ADObjectSchema.WhenChanged, ADObjectSchema.WhenChangedUTC, ADObjectSchema.WhenCreated, ADObjectSchema.WhenCreatedUTC }; if (this.requireTwoQueries) { IRecipientSession sessionForSoftDeletedObjects = SoftDeletedTaskHelper.GetSessionForSoftDeletedObjects(base.CurrentOrganizationId, this.DomainController); ADObjectId childId = base.CurrentOrganizationId.OrganizationalUnit.GetChildId("OU", "Soft Deleted Objects"); QueryFilter queryFilter = new ComparisonFilter(ComparisonOperator.Equal, ADRecipientSchema.IsSoftDeletedByRemove, true); queryFilter = new AndFilter(new QueryFilter[] { queryFilter, SyncTaskHelper.GetDeltaFilter(this.inputCookie) }); this.reader2 = sessionForSoftDeletedObjects.FindPagedADRawEntry(childId, QueryScope.OneLevel, queryFilter, null, this.PageSize, properties); this.reader2.Cookie = this.inputCookie.PageCookie2; base.WriteVerbose(TaskVerboseStringHelper.GetFindDataObjectsVerboseString(sessionForSoftDeletedObjects, typeof(ADRawEntry), queryFilter, null, false)); } IRecipientSession recipientSession = (IRecipientSession)base.DataSession; ADObjectId deletedObjectsContainer = ADSession.GetDeletedObjectsContainer(recipientSession.GetDomainNamingContext()); QueryFilter internalFilter = this.InternalFilter; recipientSession.SessionSettings.SkipCheckVirtualIndex = true; ADPagedReader <ADRawEntry> adpagedReader = recipientSession.FindPagedADRawEntry(deletedObjectsContainer, QueryScope.OneLevel, internalFilter, null, this.PageSize, properties); adpagedReader.IncludeDeletedObjects = true; adpagedReader.Cookie = this.inputCookie.PageCookie; base.WriteVerbose(TaskVerboseStringHelper.GetFindDataObjectsVerboseString(base.DataSession, typeof(ADRawEntry), this.InternalFilter, null, false)); return(adpagedReader); }
public ADRawEntry[] FindDeletedADRawEntryByUsnRange(ADObjectId lastKnownParentId, long startUsn, int sizeLimit, IEnumerable <PropertyDefinition> properties) { if (sizeLimit > ADDataSession.RangedValueDefaultPageSize) { throw new ArgumentOutOfRangeException("sizeLimit"); } QueryFilter filter = new AndFilter(new QueryFilter[] { new ComparisonFilter(ComparisonOperator.GreaterThanOrEqual, ADRecipientSchema.UsnChanged, startUsn), new ComparisonFilter(ComparisonOperator.Equal, ADObjectSchema.OrganizationalUnitRoot, lastKnownParentId) }); ADObjectId rootId = ADSession.IsTenantConfigInDomainNC(base.SessionSettings.GetAccountOrResourceForestFqdn()) ? ADSession.GetDeletedObjectsContainer(lastKnownParentId.DomainId) : ADSession.GetDeletedObjectsContainer(base.ConfigurationNamingContext); return(base.Find <ADRawEntry>(rootId, QueryScope.OneLevel, filter, ADDataSession.SortByUsn, sizeLimit, properties, true)); }
public InstallExchangeOrganization() { base.ImplementsResume = false; base.Fields["InstallationMode"] = InstallationModes.Install; base.Fields["OrgConfigVersion"] = Organization.OrgConfigurationVersion; base.Fields["PrepareSchema"] = false; base.Fields["PrepareOrganization"] = false; base.Fields["CustomerFeedbackEnabled"] = null; base.Fields["Industry"] = IndustryType.NotSpecified; base.Fields["PrepareDomain"] = false; base.Fields["PrepareSCT"] = false; base.Fields["PrepareAllDomains"] = false; base.Fields["BinPath"] = ConfigurationContext.Setup.BinPath; base.Fields["ActiveDirectorySplitPermissions"] = null; ADSession.InitializeForestModeFlagForLocalForest(); }
protected override void InternalProcessRecord() { TaskLogger.LogEnter(); TDataObject dataObject = this.DataObject; ADObjectId parent = dataObject.Id.Parent; ADSessionSettings adsessionSettings = ADSessionSettings.FromAllTenantsOrRootOrgAutoDetect(parent); if (!parent.Equals(ADSession.GetRootDomainNamingContext(adsessionSettings.GetAccountOrResourceForestFqdn()))) { IDirectorySession tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(base.DomainController, true, ConsistencyMode.PartiallyConsistent, null, adsessionSettings, 264, "InternalProcessRecord", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\NewAdObjectTask.cs"); tenantOrTopologyConfigurationSession.UseConfigNC = ((IDirectorySession)base.DataSession).UseConfigNC; ADRawEntry adrawEntry = tenantOrTopologyConfigurationSession.ReadADRawEntry(parent, new PropertyDefinition[] { ADObjectSchema.ExchangeVersion, ADObjectSchema.ObjectClass }); if (adrawEntry == null) { if (string.IsNullOrEmpty(base.DomainController)) { TDataObject dataObject2 = this.DataObject; base.WriteError(new TaskException(Strings.ErrorParentNotFound(dataObject2.Name, parent.ToString())), (ErrorCategory)1003, null); } else { TDataObject dataObject3 = this.DataObject; base.WriteError(new TaskException(Strings.ErrorParentNotFoundOnDomainController(dataObject3.Name, base.DomainController, parent.ToString(), parent.DomainId.ToString())), (ErrorCategory)1003, null); } } ExchangeObjectVersion exchangeObjectVersion = (ExchangeObjectVersion)adrawEntry[ADObjectSchema.ExchangeVersion]; MultiValuedProperty <string> multiValuedProperty = (MultiValuedProperty <string>)adrawEntry[ADObjectSchema.ObjectClass]; TDataObject dataObject4 = this.DataObject; if (dataObject4.ExchangeVersion.IsOlderThan(exchangeObjectVersion) && !multiValuedProperty.Contains(Organization.MostDerivedClass) && this.EnforceExchangeObjectVersion) { TDataObject dataObject5 = this.DataObject; string name = dataObject5.Name; TDataObject dataObject6 = this.DataObject; base.WriteError(new TaskException(Strings.ErrorParentHasNewerVersion(name, dataObject6.ExchangeVersion.ToString(), exchangeObjectVersion.ToString())), (ErrorCategory)1004, null); } } if (base.IsVerboseOn) { base.WriteVerbose(TaskVerboseStringHelper.GetConfigurableObjectChangedProperties(this.DataObject)); } base.InternalProcessRecord(); TaskLogger.LogExit(); }