コード例 #1
0
ファイル: NewRequest.cs プロジェクト: YHZX2013/exchange_diff
        protected virtual ADObjectId AutoSelectRequestQueueForPFRequest(OrganizationId orgId)
        {
            Guid guid = Guid.Empty;

            TenantPublicFolderConfigurationCache.Instance.RemoveValue(orgId);
            TenantPublicFolderConfiguration value = TenantPublicFolderConfigurationCache.Instance.GetValue(orgId);
            PublicFolderInformation         hierarchyMailboxInformation = value.GetHierarchyMailboxInformation();

            guid = hierarchyMailboxInformation.HierarchyMailboxGuid;
            if (guid == Guid.Empty)
            {
                base.WriteError(new RecipientTaskException(MrsStrings.PublicFolderMailboxesNotProvisionedForMigration), ExchangeErrorCategory.ServerOperation, null);
            }
            PublicFolderRecipient localMailboxRecipient = value.GetLocalMailboxRecipient(guid);

            return(localMailboxRecipient.Database);
        }
コード例 #2
0
        private static ADUser GetPublicFolderHierarchyMailboxUser(IConfigurationSession configurationSession)
        {
            PublicFolderInformation defaultPublicFolderMailbox = configurationSession.GetOrgContainer().DefaultPublicFolderMailbox;
            Guid hierarchyMailboxGuid = defaultPublicFolderMailbox.HierarchyMailboxGuid;

            if (defaultPublicFolderMailbox.Type != PublicFolderInformation.HierarchyType.MailboxGuid || hierarchyMailboxGuid == Guid.Empty)
            {
                return(null);
            }
            IRecipientSession tenantOrRootOrgRecipientSession = DirectorySessionFactory.Default.GetTenantOrRootOrgRecipientSession(true, ConsistencyMode.FullyConsistent, configurationSession.SessionSettings, 136, "GetPublicFolderHierarchyMailboxUser", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\MapiTasks\\PublicFolderPermission\\PublicFolderPermissionTaskHelper.cs");

            ADUser[] array = tenantOrRootOrgRecipientSession.FindADUser(null, QueryScope.SubTree, new AndFilter(new QueryFilter[]
            {
                new ComparisonFilter(ComparisonOperator.Equal, ADMailboxRecipientSchema.ExchangeGuid, hierarchyMailboxGuid),
                Filters.GetRecipientTypeDetailsFilterOptimization(RecipientTypeDetails.PublicFolderMailbox)
            }), null, 1);
            if (array.Length <= 0)
            {
                return(null);
            }
            return(array[0]);
        }
コード例 #3
0
        protected override void InternalValidate()
        {
            base.InternalValidate();
            if (this.DataObject.IsChanged(OrganizationSchema.CustomerFeedbackEnabled) && this.DataObject.CustomerFeedbackEnabled == null)
            {
                base.WriteError(new InvalidOperationException(Strings.CustomerFeedbackEnabledError), ErrorCategory.InvalidOperation, null);
            }
            if (this.DataObject.IsChanged(OrganizationSchema.OrganizationSummary))
            {
                MultiValuedProperty <OrganizationSummaryEntry> organizationSummary = this.DataObject.OrganizationSummary;
                this.MergeAdded(organizationSummary);
                this.MergeRemoved(organizationSummary);
                if (this.mergedCollection.Changed)
                {
                    this.UpdateUploadDate();
                }
                this.DataObject.OrganizationSummary = this.mergedCollection;
            }
            Organization organization = (Organization)this.GetDynamicParameters();

            if (organization.EwsAllowListSpecified && organization.EwsBlockListSpecified)
            {
                base.ThrowTerminatingError(new ArgumentException(Strings.ErrorEwsAllowListAndEwsBlockListSpecified), ErrorCategory.InvalidArgument, null);
            }
            if (organization.IsModified(OrganizationSchema.EwsApplicationAccessPolicy))
            {
                if (organization.EwsApplicationAccessPolicy == EwsApplicationAccessPolicy.EnforceAllowList && organization.EwsBlockListSpecified)
                {
                    base.ThrowTerminatingError(new ArgumentException(Strings.ErrorEwsEnforceAllowListAndEwsBlockListSpecified), ErrorCategory.InvalidArgument, null);
                }
                if (organization.EwsApplicationAccessPolicy == EwsApplicationAccessPolicy.EnforceBlockList && organization.EwsAllowListSpecified)
                {
                    base.ThrowTerminatingError(new ArgumentException(Strings.ErrorEwsEnforceBlockListAndEwsAllowListSpecified), ErrorCategory.InvalidArgument, null);
                }
            }
            if (organization.IsModified(OrganizationSchema.DefaultPublicFolderMailbox))
            {
                Organization            orgContainer = ((IConfigurationSession)base.DataSession).GetOrgContainer();
                PublicFolderInformation defaultPublicFolderMailbox = orgContainer.DefaultPublicFolderMailbox;
                if (!defaultPublicFolderMailbox.CanUpdate)
                {
                    base.WriteError(new RecipientTaskException(Strings.ErrorCannotUpdatePublicFolderHierarchyInformation), ExchangeErrorCategory.Client, null);
                }
                if (defaultPublicFolderMailbox.HierarchyMailboxGuid != Guid.Empty)
                {
                    base.WriteError(new RecipientTaskException(Strings.ErrorPublicFolderHierarchyAlreadyProvisioned), ExchangeErrorCategory.Client, null);
                }
            }
            if (this.DataObject.IsChanged(OrganizationSchema.TenantRelocationsAllowed) && !this.DataObject.TenantRelocationsAllowed)
            {
                string ridMasterName = ForestTenantRelocationsCache.GetRidMasterName(this.DataObject.OrganizationId.PartitionId);
                ITenantConfigurationSession tenantConfigurationSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession(ridMasterName, true, ConsistencyMode.PartiallyConsistent, null, ADSessionSettings.FromAllTenantsPartitionId(this.DataObject.OrganizationId.PartitionId ?? PartitionId.LocalForest), 564, "InternalValidate", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\SystemConfigurationTasks\\organization\\SetOrganization.cs");
                TenantRelocationRequest[]   array = tenantConfigurationSession.Find <TenantRelocationRequest>(null, QueryScope.SubTree, new OrFilter(new QueryFilter[]
                {
                    TenantRelocationRequest.TenantRelocationRequestFilter,
                    TenantRelocationRequest.TenantRelocationLandingFilter
                }), null, 1);
                if (array.Length > 0)
                {
                    base.WriteError(new InvalidOperationException(Strings.ErrorTenantRelocationInProgress(array[0].Name)), ErrorCategory.InvalidOperation, null);
                }
            }
        }