Exemplo n.º 1
0
 protected virtual void PrepareUserObject(ADUser user)
 {
     TaskLogger.LogEnter();
     if (this.WindowsLiveID != null && this.WindowsLiveID.SmtpAddress != SmtpAddress.Empty)
     {
         if (base.IsDebugOn)
         {
             base.WriteDebug(Strings.DebugStartInAcceptedDomainCheck);
         }
         if (this.ShouldCheckAcceptedDomains())
         {
             RecipientTaskHelper.ValidateInAcceptedDomain(this.ConfigurationSession, base.CurrentOrganizationId, this.WindowsLiveID.SmtpAddress.Domain, new Task.ErrorLoggerDelegate(base.WriteError), base.ProvisioningCache);
         }
         if (base.IsDebugOn)
         {
             base.WriteDebug(Strings.DebugEndInAcceptedDomainCheck);
         }
         this.IsSetRandomPassword = true;
         user.WindowsLiveID       = this.WindowsLiveID.SmtpAddress;
         user.UserPrincipalName   = this.WindowsLiveID.SmtpAddress.ToString();
     }
     else if (VariantConfiguration.InvariantNoFlightingSnapshot.CmdletInfra.ValidateExternalEmailAddressInAcceptedDomain.Enabled && this.ShouldCheckAcceptedDomains())
     {
         RecipientTaskHelper.ValidateInAcceptedDomain(this.ConfigurationSession, user.OrganizationId, RecipientTaskHelper.GetDomainPartOfUserPrincalName(user.UserPrincipalName), new Task.ErrorLoggerDelegate(base.WriteError), base.ProvisioningCache);
     }
     TaskLogger.LogExit();
 }
Exemplo n.º 2
0
 protected override void InternalValidate()
 {
     TaskLogger.LogEnter();
     base.InternalValidate();
     if (this.FederatedIdentity != null && this.Password != null)
     {
         base.WriteError(new RecipientTaskException(Strings.ErrorFederatedIdentityandPasswordTogether), ExchangeErrorCategory.Client, this.DataObject.Identity);
     }
     if (this.DataObject.IsChanged(MailUserSchema.WindowsLiveID))
     {
         MailboxTaskHelper.IsMemberExists((IRecipientSession)base.DataSession, this.DataObject.WindowsLiveID, new Task.ErrorLoggerDelegate(base.WriteError));
     }
     if (this.DataObject.IsModified(MailUserSchema.UserPrincipalName))
     {
         if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).CmdletInfra.ValidateExternalEmailAddressInAcceptedDomain.Enabled&& this.ShouldCheckAcceptedDomains())
         {
             RecipientTaskHelper.ValidateInAcceptedDomain(this.ConfigurationSession, this.DataObject.OrganizationId, RecipientTaskHelper.GetDomainPartOfUserPrincalName(this.DataObject.UserPrincipalName), new Task.ErrorLoggerDelegate(base.WriteError), base.ProvisioningCache);
         }
         RecipientTaskHelper.IsUserPrincipalNameUnique(base.TenantGlobalCatalogSession, this.DataObject, this.DataObject.UserPrincipalName, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client);
     }
     if (this.DataObject.IsChanged(MailboxSchema.JournalArchiveAddress) && this.DataObject.JournalArchiveAddress != SmtpAddress.NullReversePath && this.DataObject.JournalArchiveAddress != SmtpAddress.Empty)
     {
         RecipientTaskHelper.IsJournalArchiveAddressUnique(base.TenantGlobalCatalogSession, this.DataObject.OrganizationId, this.DataObject, this.DataObject.JournalArchiveAddress, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client);
     }
     if (this.DataObject.IsModified(MailUserSchema.SamAccountName))
     {
         RecipientTaskHelper.IsSamAccountNameUnique(this.DataObject, this.DataObject.SamAccountName, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), ExchangeErrorCategory.Client);
     }
     TaskLogger.LogExit();
 }
Exemplo n.º 3
0
 internal static void ValidateUserParameters(ADUser userObject, IConfigurationSession configSession, IRecipientSession globalCatalogSession, Task.TaskVerboseLoggingDelegate verboseLogger, Task.ErrorLoggerDelegate errorLogger, ExchangeErrorCategory errorLoggerCategory, bool shouldCheckAcceptedDomains, ProvisioningCache provisioningCache)
 {
     if (userObject.IsModified(UserSchema.ResetPasswordOnNextLogon) && userObject.ResetPasswordOnNextLogon && (userObject.UserAccountControl & UserAccountControlFlags.DoNotExpirePassword) != UserAccountControlFlags.None)
     {
         errorLogger(new TaskInvalidOperationException(Strings.ErrorUserCannotChangePasswordAtNextLogon(userObject.Identity.ToString())), errorLoggerCategory, userObject.Identity);
     }
     if (userObject.IsModified(UserSchema.UserPrincipalName))
     {
         if (VariantConfiguration.GetSnapshot(MachineSettingsContext.Local, null, null).CmdletInfra.ValidateExternalEmailAddressInAcceptedDomain.Enabled&& shouldCheckAcceptedDomains)
         {
             RecipientTaskHelper.ValidateInAcceptedDomain(configSession, userObject.OrganizationId, RecipientTaskHelper.GetDomainPartOfUserPrincalName(userObject.UserPrincipalName), errorLogger, provisioningCache);
         }
         RecipientTaskHelper.IsUserPrincipalNameUnique(globalCatalogSession, userObject, userObject.UserPrincipalName, verboseLogger, errorLogger, errorLoggerCategory);
     }
     if (userObject.IsModified(UserSchema.SamAccountName))
     {
         RecipientTaskHelper.IsSamAccountNameUnique(globalCatalogSession, userObject, userObject.SamAccountName, verboseLogger, errorLogger, errorLoggerCategory);
     }
 }