Пример #1
0
        // Token: 0x06000DF7 RID: 3575 RVA: 0x0004DFAC File Offset: 0x0004C1AC
        public PolicyData(MobileMailboxPolicy policy, bool useIrmEnabledPolicySetting)
        {
            this.identity = policy.OriginalId;
            this.allowNonProvisionableDevices       = policy.AllowNonProvisionableDevices;
            this.alphanumericDevicePasswordRequired = policy.AlphanumericPasswordRequired;
            this.attachmentsEnabled              = policy.AttachmentsEnabled;
            this.requireStorageCardEncryption    = policy.RequireStorageCardEncryption;
            this.devicePasswordEnabled           = policy.PasswordEnabled;
            this.passwordRecoveryEnabled         = policy.PasswordRecoveryEnabled;
            this.devicePolicyRefreshInterval     = policy.DevicePolicyRefreshInterval;
            this.allowSimpleDevicePassword       = policy.AllowSimplePassword;
            this.maxAttachmentSize               = policy.MaxAttachmentSize;
            this.wssAccessEnabled                = policy.WSSAccessEnabled;
            this.uncAccessEnabled                = policy.UNCAccessEnabled;
            this.minDevicePasswordLength         = policy.MinPasswordLength;
            this.maxInactivityTimeDeviceLock     = policy.MaxInactivityTimeLock;
            this.maxDevicePasswordFailedAttempts = policy.MaxPasswordFailedAttempts;
            this.devicePasswordExpiration        = policy.PasswordExpiration;
            this.devicePasswordHistory           = policy.PasswordHistory;
            this.isDefault                                = policy.IsDefault;
            this.allowStorageCard                         = policy.AllowStorageCard;
            this.allowCamera                              = policy.AllowCamera;
            this.requireDeviceEncryption                  = policy.RequireDeviceEncryption;
            this.allowUnsignedApplications                = policy.AllowUnsignedApplications;
            this.allowUnsignedInstallationPackages        = policy.AllowUnsignedInstallationPackages;
            this.allowWiFi                                = policy.AllowWiFi;
            this.allowTextMessaging                       = policy.AllowTextMessaging;
            this.allowPOPIMAPEmail                        = policy.AllowPOPIMAPEmail;
            this.allowIrDA                                = policy.AllowIrDA;
            this.requireManualSyncWhenRoaming             = policy.RequireManualSyncWhenRoaming;
            this.allowDesktopSync                         = policy.AllowDesktopSync;
            this.allowHTMLEmail                           = policy.AllowHTMLEmail;
            this.requireSignedSMIMEMessages               = policy.RequireSignedSMIMEMessages;
            this.requireEncryptedSMIMEMessages            = policy.RequireEncryptedSMIMEMessages;
            this.allowSMIMESoftCerts                      = policy.AllowSMIMESoftCerts;
            this.allowBrowser                             = policy.AllowBrowser;
            this.allowConsumerEmail                       = policy.AllowConsumerEmail;
            this.allowRemoteDesktop                       = policy.AllowRemoteDesktop;
            this.allowInternetSharing                     = policy.AllowInternetSharing;
            this.allowBluetooth                           = policy.AllowBluetooth;
            this.maxCalendarAgeFilter                     = policy.MaxCalendarAgeFilter;
            this.maxEmailAgeFilter                        = policy.MaxEmailAgeFilter;
            this.requireSignedSMIMEAlgorithm              = policy.RequireSignedSMIMEAlgorithm;
            this.requireEncryptionSMIMEAlgorithm          = policy.RequireEncryptionSMIMEAlgorithm;
            this.allowSMIMEEncryptionAlgorithmNegotiation = policy.AllowSMIMEEncryptionAlgorithmNegotiation;
            this.minDevicePasswordComplexCharacters       = policy.MinPasswordComplexCharacters;
            this.maxEmailBodyTruncationSize               = policy.MaxEmailBodyTruncationSize;
            this.maxEmailHTMLBodyTruncationSize           = policy.MaxEmailHTMLBodyTruncationSize;
            this.unapprovedInROMApplicationList           = policy.UnapprovedInROMApplicationList;
            this.approvedApplicationList                  = policy.ApprovedApplicationList;
            this.allowExternalDeviceManagement            = policy.AllowExternalDeviceManagement;
            this.MobileOTAUpdateMode                      = policy.MobileOTAUpdateMode;
            this.AllowMobileOTAUpdate                     = policy.AllowMobileOTAUpdate;
            this.isIrmEnabled                             = (useIrmEnabledPolicySetting && policy.IrmEnabled);
            string policyXml = ProvisionCommandPhaseOne.BuildEASProvisionDoc(20, out this.preversion121DeviceCompatibility, this) + policy.AllowNonProvisionableDevices;

            this.preversion121HashCode = PolicyData.GetPolicyHashCode(policyXml);
            policyXml = ProvisionCommandPhaseOne.BuildEASProvisionDoc(121, out this.version121DeviceCompatibility, this) + policy.AllowNonProvisionableDevices;
            this.version121HashCode = PolicyData.GetPolicyHashCode(policyXml);
        }
Пример #2
0
        internal static MobileDevicePolicyData GetMobileDevicePolicyDataFromAD(IConfigurationSession session, ADObjectId mobileMailboxPolicyId)
        {
            ExTraceGlobals.MobileDevicePolicyTracer.TraceDebug <ADObjectId>(0L, "Looking up mobile device policy object in AD: '{0}'", mobileMailboxPolicyId);
            MobileMailboxPolicy mobileMailboxPolicy = session.Read <MobileMailboxPolicy>(mobileMailboxPolicyId);

            return(MobileDevicePolicyDataFactory.GetMobileDevicePolicyDataFromMobileMailboxPolicy(mobileMailboxPolicy));
        }
Пример #3
0
 private static bool HasAdditionalCustomSettings(MobileMailboxPolicy policy)
 {
     foreach (ADPropertyDefinition adpropertyDefinition in MobileDeviceMailboxPolicyService.AdditionalProperties)
     {
         if ((adpropertyDefinition.Flags & ADPropertyDefinitionFlags.MultiValued) == ADPropertyDefinitionFlags.MultiValued)
         {
             if (adpropertyDefinition.DefaultValue != null)
             {
                 throw new NotSupportedException("Non-empty default value for multivalued property is not supported!");
             }
             if (policy[adpropertyDefinition] != null && ((IList)policy[adpropertyDefinition]).Count > 0)
             {
                 return(true);
             }
         }
         else if (adpropertyDefinition.Type == typeof(bool))
         {
             if ((bool)policy[adpropertyDefinition] != (bool)adpropertyDefinition.DefaultValue)
             {
                 return(true);
             }
         }
         else if (adpropertyDefinition.Type == typeof(int))
         {
             if ((int)policy[adpropertyDefinition] != (int)adpropertyDefinition.DefaultValue)
             {
                 return(true);
             }
         }
         else if (adpropertyDefinition.Type == typeof(Unlimited <int>))
         {
             if ((Unlimited <int>)policy[adpropertyDefinition] != (Unlimited <int>)adpropertyDefinition.DefaultValue)
             {
                 return(true);
             }
         }
         else if (adpropertyDefinition.Type == typeof(Unlimited <EnhancedTimeSpan>))
         {
             if ((Unlimited <EnhancedTimeSpan>)policy[adpropertyDefinition] != (Unlimited <EnhancedTimeSpan>)adpropertyDefinition.DefaultValue)
             {
                 return(true);
             }
         }
         else if (adpropertyDefinition.Type == typeof(Unlimited <ByteQuantifiedSize>))
         {
             if ((Unlimited <ByteQuantifiedSize>)policy[adpropertyDefinition] != (Unlimited <ByteQuantifiedSize>)adpropertyDefinition.DefaultValue)
             {
                 return(true);
             }
         }
         else if (policy[adpropertyDefinition] != adpropertyDefinition.DefaultValue)
         {
             return(true);
         }
     }
     return(false);
 }
Пример #4
0
        private static PolicyData LoadPolicySetting(IConfigurationSession scopedSession, ADObjectId policyId)
        {
            MobileMailboxPolicy mobileMailboxPolicy = scopedSession.Read <MobileMailboxPolicy>(policyId);

            if (mobileMailboxPolicy != null)
            {
                return(MobilePolicySettingsHelper.CreatePolicyData(mobileMailboxPolicy));
            }
            return(null);
        }
Пример #5
0
        public static void GetObjectPostAction(DataRow inputRow, DataTable dataTable, DataObjectStore store)
        {
            MobileMailboxPolicy mobileMailboxPolicy = store.GetDataObject("MobileMailboxPolicy") as MobileMailboxPolicy;

            if (dataTable.Rows.Count == 1 && mobileMailboxPolicy != null)
            {
                DataRow dataRow = dataTable.Rows[0];
                dataRow["IsMinPasswordLengthSet"]         = (mobileMailboxPolicy.PasswordEnabled && mobileMailboxPolicy.MinPasswordLength != null);
                dataRow["MinPasswordLength"]              = ((mobileMailboxPolicy.MinPasswordLength != null) ? ((int)dataRow["MinPasswordLength"]) : 4);
                dataRow["IsMaxPasswordFailedAttemptsSet"] = (mobileMailboxPolicy.PasswordEnabled && !mobileMailboxPolicy.MaxPasswordFailedAttempts.IsUnlimited);
                dataRow["MaxPasswordFailedAttempts"]      = (mobileMailboxPolicy.MaxPasswordFailedAttempts.IsUnlimited ? "8" : mobileMailboxPolicy.MaxPasswordFailedAttempts.Value.ToString(CultureInfo.InvariantCulture));
                dataRow["IsMaxInactivityTimeLockSet"]     = (mobileMailboxPolicy.PasswordEnabled && !mobileMailboxPolicy.MaxInactivityTimeLock.IsUnlimited);
                dataRow["MaxInactivityTimeLock"]          = (mobileMailboxPolicy.MaxInactivityTimeLock.IsUnlimited ? "15" : mobileMailboxPolicy.MaxInactivityTimeLock.Value.TotalMinutes.ToString(CultureInfo.InvariantCulture));
                dataRow["IsPasswordExpirationSet"]        = (mobileMailboxPolicy.PasswordEnabled && !mobileMailboxPolicy.PasswordExpiration.IsUnlimited);
                dataRow["PasswordExpiration"]             = (mobileMailboxPolicy.PasswordExpiration.IsUnlimited ? "90" : mobileMailboxPolicy.PasswordExpiration.Value.Days.ToString());
                dataRow["PasswordRequirementsString"]     = MobileDeviceMailboxPolicyService.PasswordRequirementsString(dataRow);
                dataRow["HasAdditionalCustomSettings"]    = MobileDeviceMailboxPolicyService.HasAdditionalCustomSettings(mobileMailboxPolicy);
            }
        }
        private static PolicyData AddPolicyToCache(MobileMailboxPolicy mobileMaiboxPolicy, PartitionId partitionId)
        {
            PolicyData policyData = null;

            if (mobileMaiboxPolicy != null)
            {
                policyData = new PolicyData(mobileMaiboxPolicy);
                string defaultPolicyKey = ADNotificationManager.GetDefaultPolicyKey(mobileMaiboxPolicy.Id);
                if (policyData.IsDefault)
                {
                    AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.RequestsTracer, null, "Adding policy {0} as default.", mobileMaiboxPolicy.Id.DistinguishedName);
                    ADNotificationManager.policies.Add(defaultPolicyKey, new ADNotificationManager.ADSettingsInfo <PolicyData>(partitionId, policyData, ExDateTime.UtcNow));
                }
                else if (ADNotificationManager.IsOrgDefaultPolicyEquals(mobileMaiboxPolicy.Id, defaultPolicyKey))
                {
                    AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.RequestsTracer, null, "Removing policy {0} as default.", mobileMaiboxPolicy.Id.DistinguishedName);
                    ADNotificationManager.policies.Remove(defaultPolicyKey);
                }
                AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.RequestsTracer, null, "Adding policy to location {0}.", mobileMaiboxPolicy.Id.DistinguishedName);
                ADNotificationManager.policies.Add(mobileMaiboxPolicy.Id.DistinguishedName, new ADNotificationManager.ADSettingsInfo <PolicyData>(partitionId, policyData, ExDateTime.UtcNow));
            }
            return(policyData);
        }
        private static PolicyData LoadPolicySetting(IConfigurationSession scopedSession, IAirSyncUser user, ADObjectId policyId, bool forceLoad)
        {
            MobileMailboxPolicy mobileMailboxPolicy = null;
            ADOperationResult   adoperationResult   = ADNotificationAdapter.TryRunADOperation(delegate()
            {
                mobileMailboxPolicy = scopedSession.Read <MobileMailboxPolicy>(policyId);
            });

            if (!adoperationResult.Succeeded)
            {
                AirSyncDiagnostics.TraceDebug <ADObjectId, string>(ExTraceGlobals.RequestsTracer, null, "Exception occurred during AD Operation during LoadPolicySettings {0}. Exception Message - {1}", policyId, adoperationResult.Exception.Message);
                throw adoperationResult.Exception;
            }
            if (user != null)
            {
                user.Context.ProtocolLogger.SetValue(ProtocolLoggerData.DomainController, scopedSession.LastUsedDc);
            }
            if (mobileMailboxPolicy != null && (forceLoad || mobileMailboxPolicy.IsDefault))
            {
                AirSyncDiagnostics.TraceInfo(ExTraceGlobals.RequestsTracer, null, "LoadPolicySetting from AD");
                return(ADNotificationManager.AddPolicyToCache(mobileMailboxPolicy, scopedSession.SessionSettings.CurrentOrganizationId.PartitionId));
            }
            return(null);
        }
Пример #8
0
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            base.InternalValidate();
            if (base.Fields.IsModified(CASMailboxSchema.ActiveSyncMailboxPolicy))
            {
                if (this.ActiveSyncMailboxPolicy != null)
                {
                    MobileMailboxPolicy mobileMailboxPolicy = (MobileMailboxPolicy)base.GetDataObject <MobileMailboxPolicy>(this.ActiveSyncMailboxPolicy, this.ConfigurationSession, null, new LocalizedString?(Strings.ErrorMobileMailboxPolicyNotFound(this.ActiveSyncMailboxPolicy.ToString())), new LocalizedString?(Strings.ErrorMobileMailboxPolicyNotUnique(this.ActiveSyncMailboxPolicy.ToString())));
                    this.DataObject.ActiveSyncMailboxPolicy = (ADObjectId)mobileMailboxPolicy.Identity;
                }
                else
                {
                    this.DataObject.ActiveSyncMailboxPolicy = null;
                }
            }
            if (base.Fields.IsModified(CASMailboxSchema.OwaMailboxPolicy))
            {
                if (this.DataObject.ExchangeVersion.Equals(ExchangeObjectVersion.Exchange2007))
                {
                    base.WriteError(new ArgumentException(Strings.ErrorSetOWAMailboxPolicyToE12User), ErrorCategory.InvalidArgument, this.Identity);
                }
                if (this.OwaMailboxPolicy != null)
                {
                    OwaMailboxPolicy owaMailboxPolicy = (OwaMailboxPolicy)base.GetDataObject <OwaMailboxPolicy>(this.OwaMailboxPolicy, this.ConfigurationSession, null, new LocalizedString?(Strings.ErrorOwaMailboxPolicyNotFound(this.OwaMailboxPolicy.ToString())), new LocalizedString?(Strings.ErrorOwaMailboxPolicyNotUnique(this.OwaMailboxPolicy.ToString())));
                    this.DataObject.OwaMailboxPolicy = (ADObjectId)owaMailboxPolicy.Identity;
                }
                else
                {
                    this.DataObject.OwaMailboxPolicy = null;
                }
            }
            this.allowedDeviceIDs = this.DataObject.ActiveSyncAllowedDeviceIDs;
            this.blockedDeviceIDs = this.DataObject.ActiveSyncBlockedDeviceIDs;
            bool changed  = this.allowedDeviceIDs.Changed;
            bool changed2 = this.blockedDeviceIDs.Changed;

            if (changed || changed2)
            {
                List <string> list  = new List <string>();
                List <string> list2 = new List <string>();
                this.deviceIdListsChanged = true;
                foreach (string text in this.allowedDeviceIDs)
                {
                    foreach (string b in this.blockedDeviceIDs)
                    {
                        if (string.Equals(text, b, StringComparison.OrdinalIgnoreCase))
                        {
                            if (changed && changed2)
                            {
                                base.WriteError(new ErrorDeviceIdInBothLists(text), ErrorCategory.InvalidData, this.Identity);
                            }
                            else if (changed)
                            {
                                list2.Add(text);
                            }
                            else
                            {
                                list.Add(text);
                            }
                        }
                    }
                }
                if (list.Count > 0)
                {
                    foreach (string item in list)
                    {
                        this.allowedDeviceIDs.Remove(item);
                    }
                    this.DataObject.ActiveSyncAllowedDeviceIDs = this.allowedDeviceIDs;
                }
                if (list2.Count > 0)
                {
                    foreach (string item2 in list2)
                    {
                        this.blockedDeviceIDs.Remove(item2);
                    }
                    this.DataObject.ActiveSyncBlockedDeviceIDs = this.blockedDeviceIDs;
                }
            }
            TaskLogger.LogExit();
        }
Пример #9
0
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            base.InternalValidate();
            if ("Linked" == base.ParameterSetName)
            {
                try
                {
                    NetworkCredential userForestCredential = (this.LinkedCredential == null) ? null : this.LinkedCredential.GetNetworkCredential();
                    this.linkedUserSid = MailboxTaskHelper.GetAccountSidFromAnotherForest(this.LinkedMasterAccount, this.LinkedDomainController, userForestCredential, this.ResourceForestSession, new MailboxTaskHelper.GetUniqueObject(base.GetDataObject <ADUser>), new Task.ErrorLoggerDelegate(base.ThrowTerminatingError));
                }
                catch (PSArgumentException exception)
                {
                    base.ThrowTerminatingError(exception, ErrorCategory.InvalidArgument, this.LinkedCredential);
                }
            }
            if (this.ManagedFolderMailboxPolicy != null)
            {
                ManagedFolderMailboxPolicy managedFolderMailboxPolicy = (ManagedFolderMailboxPolicy)base.GetDataObject <ManagedFolderMailboxPolicy>(this.ManagedFolderMailboxPolicy, this.TenantConfigurationSession, null, new LocalizedString?(Strings.ErrorManagedFolderMailboxPolicyNotFound(this.ManagedFolderMailboxPolicy.ToString())), new LocalizedString?(Strings.ErrorManagedFolderMailboxPolicyNotUnique(this.ManagedFolderMailboxPolicy.ToString())));
                this.elcPolicyId = (ADObjectId)managedFolderMailboxPolicy.Identity;
            }
            if (this.RetentionPolicy != null)
            {
                if (SharedConfiguration.IsDehydratedConfiguration(base.CurrentOrganizationId))
                {
                    base.WriteError(new LocalizedException(Strings.ErrorLinkOpOnDehydratedTenant("RetentionPolicy")), ExchangeErrorCategory.Client, null);
                }
                RetentionPolicy retentionPolicy = (RetentionPolicy)base.GetDataObject <RetentionPolicy>(this.RetentionPolicy, this.TenantConfigurationSession, null, new LocalizedString?(Strings.ErrorRetentionPolicyNotFound(this.RetentionPolicy.ToString())), new LocalizedString?(Strings.ErrorRetentionPolicyNotUnique(this.RetentionPolicy.ToString())));
                this.retentionPolicyId = retentionPolicy.Id;
            }
            if (this.ActiveSyncMailboxPolicy != null)
            {
                MobileMailboxPolicy mobileMailboxPolicy = (MobileMailboxPolicy)base.GetDataObject <MobileMailboxPolicy>(this.ActiveSyncMailboxPolicy, this.TenantConfigurationSession, null, new LocalizedString?(Strings.ErrorMobileMailboxPolicyNotFound(this.ActiveSyncMailboxPolicy.ToString())), new LocalizedString?(Strings.ErrorMobileMailboxPolicyNotUnique(this.ActiveSyncMailboxPolicy.ToString())));
                this.mobilePolicyId = (ADObjectId)mobileMailboxPolicy.Identity;
            }
            if (this.AddressBookPolicy != null)
            {
                AddressBookMailboxPolicy addressBookMailboxPolicy = (AddressBookMailboxPolicy)base.GetDataObject <AddressBookMailboxPolicy>(this.AddressBookPolicy, this.TenantConfigurationSession, null, new LocalizedString?(Strings.ErrorAddressBookMailboxPolicyNotFound(this.AddressBookPolicy.ToString())), new LocalizedString?(Strings.ErrorAddressBookMailboxPolicyNotUnique(this.AddressBookPolicy.ToString())), ExchangeErrorCategory.Client);
                this.addressBookPolicyId = (ADObjectId)addressBookMailboxPolicy.Identity;
            }
            MailboxTaskHelper.ValidateMailboxIsDisconnected(this.GlobalCatalogSession, this.DataObject.MailboxGuid, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError));
            if (!this.Archive)
            {
                ConnectMailbox.CheckLegacyDNNotInUse(this.DataObject.Identity, this.DataObject.LegacyDN, this.GlobalCatalogSession, new Task.ErrorLoggerDelegate(base.WriteError));
            }
            if (this.User != null)
            {
                this.userToConnect = (ADUser)base.GetDataObject <ADUser>(this.User, this.RecipientSession, null, new LocalizedString?(Strings.ErrorRecipientNotFound(this.User.ToString())), new LocalizedString?(Strings.ErrorRecipientNotUnique(this.User.ToString())));
                if (this.Archive)
                {
                    ConnectMailbox.CheckUserForArchive(this.DataObject, this.GlobalCatalogSession, new Task.ErrorLoggerDelegate(base.WriteError), this.userToConnect, this.OwnerMailboxDatabase, this.AllowLegacyDNMismatch);
                }
                else if (RecipientType.User != this.userToConnect.RecipientType)
                {
                    base.WriteError(new RecipientTaskException(Strings.ErrorNoMatchedUserTypeFound(RecipientType.User.ToString(), this.User.ToString(), this.userToConnect.RecipientType.ToString())), ErrorCategory.InvalidArgument, this.User);
                }
            }
            else if (!this.Archive)
            {
                if ("ValidateOnly" == base.ParameterSetName)
                {
                    this.matchedUsers = this.FindMatchedUser(this.DataObject, null);
                }
                else
                {
                    this.matchedUsers = this.FindMatchedUser(this.DataObject, new bool?("User" == base.ParameterSetName));
                }
                if ("ValidateOnly" != base.ParameterSetName)
                {
                    if (this.matchedUsers.Length == 0)
                    {
                        base.WriteError(new MdbAdminTaskException(Strings.ErrorNoMatchedUserFound), ErrorCategory.InvalidArgument, this.Identity);
                    }
                    else if (this.matchedUsers.Length > 1)
                    {
                        this.WriteWarning(Strings.ErrorMultipleMatchedUser(this.Identity.ToString()));
                        this.needListMatchingUser = true;
                    }
                    else
                    {
                        this.userToConnect = (ADUser)this.matchedUsers[0];
                        this.userToConnect = (ADUser)this.RecipientSession.Read(this.userToConnect.Id);
                        if (this.userToConnect == null)
                        {
                            base.WriteError(new MdbAdminTaskException(Strings.ErrorNoMatchedUserFound), ErrorCategory.InvalidArgument, this.Identity);
                        }
                        if (this.Archive)
                        {
                            ConnectMailbox.CheckUserForArchive(this.DataObject, this.GlobalCatalogSession, new Task.ErrorLoggerDelegate(base.WriteError), this.userToConnect, this.OwnerMailboxDatabase, this.AllowLegacyDNMismatch);
                        }
                    }
                }
            }
            else
            {
                this.userToConnect = this.FindArchiveUser(this.DataObject, this.RecipientSession, new Task.TaskErrorLoggingDelegate(base.WriteError));
                ConnectMailbox.CheckUserForArchive(this.DataObject, this.GlobalCatalogSession, new Task.ErrorLoggerDelegate(base.WriteError), this.userToConnect, this.OwnerMailboxDatabase, this.AllowLegacyDNMismatch);
            }
            if (this.userToConnect != null && !this.Archive)
            {
                if ("User" == base.ParameterSetName)
                {
                    if ((this.userToConnect.UserAccountControl & UserAccountControlFlags.AccountDisabled) != UserAccountControlFlags.None && this.DataObject.MailboxType == StoreMailboxType.Private)
                    {
                        base.WriteError(new RecipientTaskException(Strings.ErrorAccountDisabledForUserMailbox), ErrorCategory.InvalidArgument, this.userToConnect);
                    }
                }
                else if ((this.userToConnect.UserAccountControl & UserAccountControlFlags.AccountDisabled) == UserAccountControlFlags.None)
                {
                    base.WriteError(new RecipientTaskException(Strings.ErrorAccountEnabledForNonUserMailbox), ErrorCategory.InvalidArgument, this.userToConnect);
                }
                if (!string.IsNullOrEmpty(this.Alias))
                {
                    this.alias = this.Alias;
                }
                else
                {
                    this.alias = RecipientTaskHelper.GenerateUniqueAlias(this.globalCatalogSession, this.userToConnect.OrganizationId, this.userToConnect.Name, new Task.TaskVerboseLoggingDelegate(base.WriteVerbose));
                }
            }
            if (this.Archive && this.userToConnect.ManagedFolderMailboxPolicy != null)
            {
                base.WriteError(new MdbAdminTaskException(Strings.ErrorNoArchiveWithManagedFolder(this.userToConnect.Name)), ErrorCategory.InvalidData, this.Identity);
            }
            if (this.DataObject.IsArchiveMailbox != null && this.Archive != this.DataObject.IsArchiveMailbox.Value)
            {
                if (this.Archive)
                {
                    base.WriteError(new MdbAdminTaskException(Strings.ErrorDisconnectedMailboxNotArchive(this.Identity.ToString(), this.userToConnect.Name)), ErrorCategory.InvalidArgument, this.Identity);
                }
                else
                {
                    base.WriteError(new MdbAdminTaskException(Strings.ErrorDisconnectedMailboxNotPrimary(this.Identity.ToString(), this.userToConnect.Name)), ErrorCategory.InvalidArgument, this.Identity);
                }
            }
            ADSessionSettings sessionSettings = ADSessionSettings.FromCustomScopeSet(base.ScopeSet, ADSystemConfigurationSession.GetRootOrgContainerIdForLocalForest(), base.CurrentOrganizationId, base.ExecutingUserOrganizationId, true);

            MapiTaskHelper.VerifyDatabaseIsWithinScope(sessionSettings, this.OwnerMailboxDatabase, new Task.ErrorLoggerDelegate(base.WriteError));
            TaskLogger.LogExit();
        }
Пример #10
0
 private static PolicyData CreatePolicyData(MobileMailboxPolicy mobileMaiboxPolicy)
 {
     return(new PolicyData(mobileMaiboxPolicy, false));
 }
Пример #11
0
 // Token: 0x06000DF6 RID: 3574 RVA: 0x0004DF9C File Offset: 0x0004C19C
 public PolicyData(MobileMailboxPolicy policy) : this(policy, GlobalSettings.IrmEnabled)
 {
 }
Пример #12
0
        internal static MobileDevicePolicyData GetMobileDevicePolicyDataFromMobileMailboxPolicy(MobileMailboxPolicy mobileMailboxPolicy)
        {
            MobileDevicePolicyData result = null;

            if (mobileMailboxPolicy != null)
            {
                result = new MobileDevicePolicyData
                {
                    AlphanumericDevicePasswordRequired = mobileMailboxPolicy.AlphanumericPasswordRequired,
                    DeviceEncryptionRequired           = mobileMailboxPolicy.RequireDeviceEncryption,
                    DevicePasswordRequired             = mobileMailboxPolicy.PasswordEnabled,
                    MaxDevicePasswordExpiration        = mobileMailboxPolicy.PasswordExpiration,
                    MaxDevicePasswordFailedAttempts    = mobileMailboxPolicy.MaxPasswordFailedAttempts,
                    MaxInactivityTimeDeviceLock        = mobileMailboxPolicy.MaxInactivityTimeLock,
                    MinDevicePasswordComplexCharacters = mobileMailboxPolicy.MinPasswordComplexCharacters,
                    MinDevicePasswordHistory           = mobileMailboxPolicy.PasswordHistory,
                    MinDevicePasswordLength            = mobileMailboxPolicy.MinPasswordLength,
                    SimpleDevicePasswordAllowed        = mobileMailboxPolicy.AllowSimplePassword,
                    AllowApplePushNotifications        = mobileMailboxPolicy.AllowApplePushNotifications,
                    AllowMicrosoftPushNotifications    = mobileMailboxPolicy.AllowMicrosoftPushNotifications,
                    AllowGooglePushNotifications       = mobileMailboxPolicy.AllowGooglePushNotifications
                };
            }
            return(result);
        }