protected override void InternalProcessRecord() { LazilyInitialized <SharedTenantConfigurationState> currentOrgState = this.CurrentOrgState; OrganizationId currentOrganizationId = base.CurrentOrganizationId; TDataObject dataObject = base.DataObject; if (!currentOrganizationId.Equals(dataObject.OrganizationId)) { currentOrgState = new LazilyInitialized <SharedTenantConfigurationState>(delegate() { TDataObject dataObject3 = base.DataObject; return(SharedConfiguration.GetSharedConfigurationState(dataObject3.OrganizationId)); }); } if (SharedConfigurationTaskHelper.ShouldPrompt(this, this.SharedTenantConfigurationMode, currentOrgState) && !base.InternalForce) { TDataObject dataObject2 = base.DataObject; if (!base.ShouldContinue(Strings.ConfirmSharedConfiguration(dataObject2.OrganizationId.OrganizationalUnit.Name))) { TaskLogger.LogExit(); return; } } base.InternalProcessRecord(); }
// Token: 0x060005CC RID: 1484 RVA: 0x0001614C File Offset: 0x0001434C protected override void InternalProcessRecord() { TaskLogger.LogEnter(); OrganizationId currentOrganizationId = base.CurrentOrganizationId; TDataObject dataObject = this.DataObject; if (!currentOrganizationId.Equals(dataObject.OrganizationId)) { this.CurrentOrgState = new LazilyInitialized <SharedTenantConfigurationState>(delegate() { TDataObject dataObject8 = this.DataObject; return(SharedConfiguration.GetSharedConfigurationState(dataObject8.OrganizationId)); }); } if (SharedConfigurationTaskHelper.ShouldPrompt(this, this.SharedTenantConfigurationMode, this.CurrentOrgState) && !base.InternalForce) { TDataObject dataObject2 = this.DataObject; if (!base.ShouldContinue(Strings.ConfirmSharedConfiguration(dataObject2.OrganizationId.OrganizationalUnit.Name))) { TaskLogger.LogExit(); return; } } TDataObject dataObject3 = this.DataObject; if (dataObject3.IsChanged(ADObjectSchema.Id)) { IDirectorySession tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(base.DomainController, true, ConsistencyMode.PartiallyConsistent, null, base.OrgWideSessionSettings, ConfigScopes.TenantSubTree, 702, "InternalProcessRecord", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\SetAdObjectTask.cs"); tenantOrTopologyConfigurationSession.UseConfigNC = ((IDirectorySession)base.DataSession).UseConfigNC; TDataObject dataObject4 = this.DataObject; ADObjectId parent = dataObject4.Id.Parent; ADRawEntry adrawEntry = tenantOrTopologyConfigurationSession.ReadADRawEntry(parent, new PropertyDefinition[] { ADObjectSchema.ExchangeVersion, ADObjectSchema.ObjectClass }); ExchangeObjectVersion exchangeObjectVersion = (ExchangeObjectVersion)adrawEntry[ADObjectSchema.ExchangeVersion]; MultiValuedProperty <string> multiValuedProperty = (MultiValuedProperty <string>)adrawEntry[ADObjectSchema.ObjectClass]; TDataObject dataObject5 = this.DataObject; if (dataObject5.ExchangeVersion.IsOlderThan(exchangeObjectVersion) && !multiValuedProperty.Contains(Organization.MostDerivedClass)) { TDataObject dataObject6 = this.DataObject; string name = dataObject6.Name; TDataObject dataObject7 = this.DataObject; base.WriteError(new TaskException(Strings.ErrorParentHasNewerVersion(name, dataObject7.ExchangeVersion.ToString(), exchangeObjectVersion.ToString())), (ErrorCategory)1004, null); } } base.InternalProcessRecord(); TaskLogger.LogExit(); }
protected override IConfigurable ConvertDataObjectToPresentationObject(IConfigurable dataObject) { if (dataObject == null) { return(null); } ADUser user = (ADUser)dataObject; SharedConfiguration sharedConfig = null; if (SharedConfiguration.IsDehydratedConfiguration(user.OrganizationId) || (SharedConfiguration.GetSharedConfigurationState(user.OrganizationId) & SharedTenantConfigurationState.Static) != SharedTenantConfigurationState.UnSupported) { sharedConfig = base.ProvisioningCache.TryAddAndGetOrganizationData <SharedConfiguration>(CannedProvisioningCacheKeys.MailboxSharedConfigCacheKey, user.OrganizationId, () => SharedConfiguration.GetSharedConfiguration(user.OrganizationId)); } if (null != user.MasterAccountSid) { user.LinkedMasterAccount = SecurityPrincipalIdParameter.GetFriendlyUserName(user.MasterAccountSid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose)); user.ResetChangeTracking(); } Mailbox mailbox = new Mailbox(user); mailbox.propertyBag.SetField(MailboxSchema.Database, ADObjectIdResolutionHelper.ResolveDN(mailbox.Database)); if (sharedConfig != null) { mailbox.SharedConfiguration = sharedConfig.SharedConfigId.ConfigurationUnit; if (mailbox.RoleAssignmentPolicy == null) { mailbox.RoleAssignmentPolicy = base.ProvisioningCache.TryAddAndGetOrganizationData <ADObjectId>(CannedProvisioningCacheKeys.MailboxRoleAssignmentPolicyCacheKey, user.OrganizationId, () => sharedConfig.GetSharedRoleAssignmentPolicy()); } } else if (mailbox.RoleAssignmentPolicy == null && !mailbox.ExchangeVersion.IsOlderThan(MailboxSchema.RoleAssignmentPolicy.VersionAdded)) { ADObjectId defaultRoleAssignmentPolicy = RBACHelper.GetDefaultRoleAssignmentPolicy(user.OrganizationId); if (defaultRoleAssignmentPolicy != null) { mailbox.RoleAssignmentPolicy = defaultRoleAssignmentPolicy; } } if (mailbox.SharingPolicy == null && !mailbox.propertyBag.IsReadOnlyProperty(MailboxSchema.SharingPolicy)) { mailbox.SharingPolicy = base.GetDefaultSharingPolicyId(user, sharedConfig); } if (mailbox.RetentionPolicy == null && mailbox.ShouldUseDefaultRetentionPolicy && !mailbox.propertyBag.IsReadOnlyProperty(MailboxSchema.RetentionPolicy)) { mailbox.RetentionPolicy = base.GetDefaultRetentionPolicyId(user, sharedConfig); } if (mailbox.Database != null && mailbox.UseDatabaseRetentionDefaults) { this.SetDefaultRetentionValues(mailbox); } mailbox.AdminDisplayVersion = Microsoft.Exchange.Data.Directory.SystemConfiguration.Server.GetServerVersion(mailbox.ServerName); return(mailbox); }
// Token: 0x060005CA RID: 1482 RVA: 0x000160B9 File Offset: 0x000142B9 protected override void InternalBeginProcessing() { base.InternalBeginProcessing(); this.CurrentOrgState = new LazilyInitialized <SharedTenantConfigurationState>(() => SharedConfiguration.GetSharedConfigurationState(base.CurrentOrganizationId)); }
protected override void InternalBeginProcessing() { TaskLogger.LogEnter(); base.InternalBeginProcessing(); base.CurrentOrganizationId = this.ResolveCurrentOrganization(); this.CurrentOrgState = new LazilyInitialized <SharedTenantConfigurationState>(() => SharedConfiguration.GetSharedConfigurationState(base.CurrentOrganizationId)); TaskLogger.LogExit(); }
// Token: 0x060005C3 RID: 1475 RVA: 0x00015CAC File Offset: 0x00013EAC protected override void InternalProcessRecord() { TaskLogger.LogEnter(); OrganizationId currentOrganizationId = base.CurrentOrganizationId; TDataObject dataObject = this.DataObject; if (!currentOrganizationId.Equals(dataObject.OrganizationId)) { this.CurrentOrgState = new LazilyInitialized <SharedTenantConfigurationState>(delegate() { TDataObject dataObject17 = this.DataObject; return(SharedConfiguration.GetSharedConfigurationState(dataObject17.OrganizationId)); }); } ADRecipient adrecipient = this.DataObject; bool flag = adrecipient != null && adrecipient.RecipientSoftDeletedStatus > 0; if (RecipientTaskHelper.IsMailEnabledRecipientType(this.DesiredRecipientType) && !flag) { if (!base.IsProvisioningLayerAvailable) { base.WriteError(new InvalidOperationException(Strings.ErrorNoProvisioningHandlerAvailable), (ErrorCategory)1001, null); } TDataObject dataObject2 = this.DataObject; if (dataObject2.IsModified(ADRecipientSchema.EmailAddresses)) { TDataObject dataObject3 = this.DataObject; if (dataObject3.EmailAddresses.Count > 0) { if (VariantConfiguration.InvariantNoFlightingSnapshot.Global.MultiTenancy.Enabled && this.ShouldCheckAcceptedDomains()) { IDirectorySession configurationSession = this.ConfigurationSession; TDataObject dataObject4 = this.DataObject; IConfigurationSession configurationSession2 = (IConfigurationSession)TaskHelper.UnderscopeSessionToOrganization(configurationSession, dataObject4.OrganizationId, true); IConfigurationSession cfgSession = configurationSession2; TDataObject dataObject5 = this.DataObject; RecipientTaskHelper.ValidateSmtpAddress(cfgSession, dataObject5.EmailAddresses, this.DataObject, new Task.ErrorLoggerDelegate(base.WriteError), base.ProvisioningCache); } ADObjectId rootOrgContainerId = base.RootOrgContainerId; TDataObject dataObject6 = this.DataObject; ADSessionSettings sessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopes(rootOrgContainerId, dataObject6.OrganizationId, base.ExecutingUserOrganizationId, false); IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(base.DomainController, true, ConsistencyMode.PartiallyConsistent, string.IsNullOrEmpty(base.DomainController) ? null : base.NetCredential, sessionSettings, 557, "InternalProcessRecord", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\SetAdObjectTask.cs"); IRecipientSession tenantCatalogSession = tenantOrRootOrgRecipientSession; TDataObject dataObject7 = this.DataObject; RecipientTaskHelper.ValidateEmailAddressErrorOut(tenantCatalogSession, dataObject7.EmailAddresses, this.DataObject, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerReThrowDelegate(this.WriteError)); } } } TDataObject dataObject8 = this.DataObject; if (dataObject8.IsChanged(ADObjectSchema.Id)) { IDirectorySession tenantOrTopologyConfigurationSession = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(base.DomainController, true, ConsistencyMode.PartiallyConsistent, null, base.OrgWideSessionSettings, ConfigScopes.TenantSubTree, 579, "InternalProcessRecord", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\BaseTasks\\SetAdObjectTask.cs"); tenantOrTopologyConfigurationSession.UseConfigNC = ((IDirectorySession)base.DataSession).UseConfigNC; TDataObject dataObject9 = this.DataObject; ADObjectId parent = dataObject9.Id.Parent; ADRawEntry adrawEntry = tenantOrTopologyConfigurationSession.ReadADRawEntry(parent, new PropertyDefinition[] { ADObjectSchema.ExchangeVersion }); ExchangeObjectVersion exchangeObjectVersion = (ExchangeObjectVersion)adrawEntry[ADObjectSchema.ExchangeVersion]; TDataObject dataObject10 = this.DataObject; if (dataObject10.ExchangeVersion.IsOlderThan(exchangeObjectVersion)) { TDataObject dataObject11 = this.DataObject; string name = dataObject11.Name; TDataObject dataObject12 = this.DataObject; base.WriteError(new TaskException(Strings.ErrorParentHasNewerVersion(name, dataObject12.ExchangeVersion.ToString(), exchangeObjectVersion.ToString())), (ErrorCategory)1004, null); } } TDataObject dataObject13 = this.DataObject; if (dataObject13.RecipientType != this.DesiredRecipientType && this.DesiredRecipientType != RecipientType.Invalid) { TDataObject dataObject14 = this.DataObject; string id = dataObject14.Identity.ToString(); string oldType = this.DesiredRecipientType.ToString(); TDataObject dataObject15 = this.DataObject; Exception exception = new InvalidOperationException(Strings.ErrorSetTaskChangeRecipientType(id, oldType, dataObject15.RecipientType.ToString())); ErrorCategory category = (ErrorCategory)1000; TDataObject dataObject16 = this.DataObject; base.WriteError(exception, category, dataObject16.Identity); } base.InternalProcessRecord(); TaskLogger.LogExit(); }
// Token: 0x060005BF RID: 1471 RVA: 0x00015B40 File Offset: 0x00013D40 protected override void InternalBeginProcessing() { TaskLogger.LogEnter(); base.InternalBeginProcessing(); this.CurrentOrgState = new LazilyInitialized <SharedTenantConfigurationState>(() => SharedConfiguration.GetSharedConfigurationState(base.CurrentOrganizationId)); if (this.IgnoreDefaultScope && base.DomainController != null) { base.ThrowTerminatingError(new ArgumentException(Strings.ErrorIgnoreDefaultScopeAndDCSetTogether), ErrorCategory.InvalidArgument, null); } TaskLogger.LogExit(); }
private IList <TeamMailboxProvisioningPolicy> GetTeamMailboxPolicies() { OrganizationId currentOrganizationId = base.CurrentOrganizationId; IConfigurationSession session = this.ConfigurationSession; if (SharedConfiguration.IsDehydratedConfiguration(currentOrganizationId) || (SharedConfiguration.GetSharedConfigurationState(currentOrganizationId) & SharedTenantConfigurationState.Static) != SharedTenantConfigurationState.UnSupported) { ADSessionSettings adsessionSettings = null; SharedConfiguration sharedConfiguration = SharedConfiguration.GetSharedConfiguration(currentOrganizationId); if (sharedConfiguration != null) { adsessionSettings = sharedConfiguration.GetSharedConfigurationSessionSettings(); } if (adsessionSettings == null) { adsessionSettings = ADSessionSettings.FromOrganizationIdWithoutRbacScopes(base.RootOrgContainerId, currentOrganizationId, base.ExecutingUserOrganizationId, false); adsessionSettings.IsSharedConfigChecked = true; } session = DirectorySessionFactory.Default.GetTenantOrTopologyConfigurationSession(base.DomainController, true, ConsistencyMode.PartiallyConsistent, base.NetCredential, adsessionSettings, 732, "GetTeamMailboxPolicies", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\RecipientTasks\\TeamMailbox\\NewSiteMailbox.cs"); } return(DefaultTeamMailboxProvisioningPolicyUtility.GetDefaultPolicies(session)); }
protected override IConfigurable ConvertDataObjectToPresentationObject(IConfigurable dataObject) { ReducedRecipient reducedRecipient = (ReducedRecipient)dataObject; if (reducedRecipient == null) { return(null); } if (this.ShouldReadProperties(new ADPropertyDefinition[] { ReducedRecipientSchema.OwaMailboxPolicy, ReducedRecipientSchema.SharingPolicy, ReducedRecipientSchema.RetentionPolicy }) && reducedRecipient.RecipientType == Microsoft.Exchange.Data.Directory.Recipient.RecipientType.UserMailbox) { SharedConfiguration sharedConfig = null; if (SharedConfiguration.IsDehydratedConfiguration(reducedRecipient.OrganizationId) || (SharedConfiguration.GetSharedConfigurationState(reducedRecipient.OrganizationId) & SharedTenantConfigurationState.Static) != SharedTenantConfigurationState.UnSupported) { sharedConfig = SharedConfiguration.GetSharedConfiguration(reducedRecipient.OrganizationId); } if (this.ShouldReadProperties(new ADPropertyDefinition[] { ReducedRecipientSchema.OwaMailboxPolicy }) && reducedRecipient.OwaMailboxPolicy == null) { ADObjectId defaultOwaMailboxPolicyId = this.GetDefaultOwaMailboxPolicyId(reducedRecipient); if (defaultOwaMailboxPolicyId != null) { reducedRecipient.OwaMailboxPolicy = defaultOwaMailboxPolicyId; } } if (this.ShouldReadProperties(new ADPropertyDefinition[] { ReducedRecipientSchema.SharingPolicy }) && reducedRecipient.SharingPolicy == null) { reducedRecipient.SharingPolicy = base.GetDefaultSharingPolicyId(reducedRecipient, sharedConfig); } if (this.ShouldReadProperties(new ADPropertyDefinition[] { ReducedRecipientSchema.RetentionPolicy }) && reducedRecipient.RetentionPolicy == null && reducedRecipient.ShouldUseDefaultRetentionPolicy) { reducedRecipient.RetentionPolicy = base.GetDefaultRetentionPolicyId(reducedRecipient, sharedConfig); } } if (this.ShouldReadProperties(new ADPropertyDefinition[] { ReducedRecipientSchema.ActiveSyncMailboxPolicy, ReducedRecipientSchema.ActiveSyncMailboxPolicyIsDefaulted }) && reducedRecipient.ActiveSyncMailboxPolicy == null && !reducedRecipient.ExchangeVersion.IsOlderThan(ReducedRecipientSchema.ActiveSyncMailboxPolicy.VersionAdded)) { ADObjectId defaultPolicyId = base.GetDefaultPolicyId(reducedRecipient); if (defaultPolicyId != null) { reducedRecipient.ActiveSyncMailboxPolicy = defaultPolicyId; reducedRecipient.ActiveSyncMailboxPolicyIsDefaulted = true; } } if (this.ShouldReadProperties(new ADPropertyDefinition[] { ReducedRecipientSchema.AuthenticationType }) && reducedRecipient.OrganizationId.ConfigurationUnit != null) { SmtpAddress windowsLiveID = reducedRecipient.WindowsLiveID; if (reducedRecipient.WindowsLiveID.Domain != null && !reducedRecipient.ExchangeVersion.IsOlderThan(ExchangeObjectVersion.Exchange2010)) { reducedRecipient.AuthenticationType = MailboxTaskHelper.GetNamespaceAuthenticationType(reducedRecipient.OrganizationId, reducedRecipient.WindowsLiveID.Domain); } } if (this.ShouldReadProperties(new ADPropertyDefinition[] { ReducedRecipientSchema.Capabilities })) { reducedRecipient.PopulateCapabilitiesProperty(); } return(reducedRecipient); }