Exemple #1
0
        // Token: 0x060002D5 RID: 725 RVA: 0x0000B580 File Offset: 0x00009780
        protected IConfigurable GetDataObject <TObject>(IIdentityParameter id, IConfigDataProvider session, ObjectId rootID, OptionalIdentityData optionalData, LocalizedString?notFoundError, LocalizedString?multipleFoundError, ExchangeErrorCategory errorCategory) where TObject : IConfigurable, new()
        {
            IConfigurable         result = null;
            LocalizedString?      localizedString;
            IEnumerable <TObject> dataObjects = this.GetDataObjects <TObject>(id, session, rootID, optionalData, out localizedString);
            Exception             ex          = null;

            using (IEnumerator <TObject> enumerator = dataObjects.GetEnumerator())
            {
                if (enumerator.MoveNext())
                {
                    result = enumerator.Current;
                    if (enumerator.MoveNext())
                    {
                        ex = new ManagementObjectAmbiguousException(multipleFoundError ?? Strings.ErrorManagementObjectAmbiguous(id.ToString()));
                    }
                }
                else if (notFoundError != null)
                {
                    LocalizedString message;
                    if (localizedString != null)
                    {
                        LocalizedString?localizedString2 = notFoundError;
                        string          notFound         = (localizedString2 != null) ? localizedString2.GetValueOrDefault() : null;
                        LocalizedString?localizedString3 = localizedString;
                        message = Strings.ErrorNotFoundWithReason(notFound, (localizedString3 != null) ? localizedString3.GetValueOrDefault() : null);
                    }
                    else
                    {
                        message = notFoundError.Value;
                    }
                    ex = new ManagementObjectNotFoundException(message);
                }
                else
                {
                    ex = new ManagementObjectNotFoundException(localizedString ?? this.GetErrorMessageObjectNotFound(id.ToString(), typeof(TObject).ToString(), (this.DataSession != null) ? this.DataSession.Source : null));
                }
            }
            if (ex != null)
            {
                if (errorCategory != (ExchangeErrorCategory)0)
                {
                    RecipientTaskHelper.SetExceptionErrorCategory(ex, errorCategory);
                }
                throw ex;
            }
            return(result);
        }
        public IEnumerable <T> GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason) where T : IConfigurable, new()
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (!(session is ComplianceJobProvider))
            {
                throw new NotSupportedException("session: " + session.GetType().FullName);
            }
            if (optionalData != null && optionalData.AdditionalFilter != null)
            {
                throw new NotSupportedException("Supplying Additional Filters is not currently supported by this IdParameter.");
            }
            T t;

            if (string.IsNullOrEmpty(this.displayName))
            {
                t = (T)((object)((ComplianceJobProvider)session).Read <ComplianceSearch>(new ComplianceJobId(this.jobId)));
            }
            else
            {
                t = (T)((object)((ComplianceJobProvider)session).FindJobsByName <T>(this.displayName));
            }
            if (t == null)
            {
                notFoundReason = new LocalizedString?(Strings.ErrorManagementObjectNotFound(this.rawIdentity));
                return(new T[0]);
            }
            notFoundReason = null;
            return(new T[]
            {
                t
            });
        }
 internal IEnumerable <T> GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason) where T : IConfigurable, new()
 {
     notFoundReason = new LocalizedString?(Strings.ErrorManagementObjectNotFound(this.ToString()));
     return(session.FindPaged <T>((optionalData == null) ? null : optionalData.AdditionalFilter, rootId, false, null, 0));
 }
Exemple #4
0
        // Token: 0x0600026F RID: 623 RVA: 0x00010750 File Offset: 0x0000E950
        private void ReportBuilderException(HttpResponse response, AuthMetadataBuilderException ex, bool logCallStack, HttpStatusCode httpStatusCode, LocalizedString?overridingError)
        {
            this.logger.Set(ServiceCommonMetadata.ErrorCode, ex.GetType().Name);
            string value = logCallStack ? ex.ToString() : ex.Message;

            this.logger.AppendGenericError(ex.GetType().Name, value);
            response.StatusCode             = (int)httpStatusCode;
            response.TrySkipIisCustomErrors = true;
            LocalizedString?localizedString  = new LocalizedString?(overridingError ?? ex.LocalizedString);
            LocalizedString?localizedString2 = localizedString;

            this.WriteResponse(response, (localizedString2 != null) ? localizedString2.GetValueOrDefault() : null, true);
        }
        // Token: 0x06000C48 RID: 3144 RVA: 0x00026B90 File Offset: 0x00024D90
        IEnumerable <T> IIdentityParameter.GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (null == this.internalOWAExtensionId)
            {
                throw new InvalidOperationException(Strings.ErrorOperationOnInvalidObject);
            }
            IConfigurable[] array = session.Find <T>(null, this.internalOWAExtensionId, false, null);
            if (array == null || array.Length == 0)
            {
                notFoundReason = new LocalizedString?(Strings.ErrorManagementObjectNotFound(this.ToString()));
                return(new T[0]);
            }
            notFoundReason = null;
            T[] array2 = new T[array.Length];
            int num    = 0;

            foreach (IConfigurable configurable in array)
            {
                array2[num++] = (T)((object)configurable);
            }
            return(array2);
        }
Exemple #6
0
 protected new IConfigurable GetDataObject <TObject>(IIdentityParameter id, IConfigDataProvider session, ObjectId rootID, LocalizedString?notFoundError, LocalizedString?multipleFoundError) where TObject : IConfigurable, new()
 {
     return(base.GetDataObject <TObject>(id, session, rootID, null, notFoundError, multipleFoundError));
 }
        // Token: 0x060008DA RID: 2266 RVA: 0x0001EEE8 File Offset: 0x0001D0E8
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            if (typeof(T) != typeof(Server) && typeof(T) != typeof(MiniServer) && typeof(T) != typeof(MiniClientAccessServerOrArray))
            {
                throw new ArgumentException(Strings.ErrorInvalidType(typeof(T).Name), "type");
            }
            EnumerableWrapper <T> wrapper = EnumerableWrapper <T> .GetWrapper(base.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason));

            if (!wrapper.HasElements() && this.Fqdn != null)
            {
                QueryFilter filter = new OrFilter(new QueryFilter[]
                {
                    new ComparisonFilter(ComparisonOperator.Equal, ServerSchema.Fqdn, this.Fqdn),
                    new ComparisonFilter(ComparisonOperator.Equal, ServerSchema.ExchangeLegacyDN, this.Fqdn)
                });
                wrapper = EnumerableWrapper <T> .GetWrapper(base.PerformPrimarySearch <T>(filter, rootId, session, true, optionalData));
            }
            if (typeof(T) == typeof(Server))
            {
                List <T> list = new List <T>();
                foreach (T t in wrapper)
                {
                    list.Add(t);
                    string     key        = ((ADObjectId)t.Identity).ToDNString().ToLowerInvariant();
                    Server     server     = (Server)((object)t);
                    ServerInfo serverInfo = new ServerInfo();
                    serverInfo.Identity = server.Id;
                    serverInfo.Role     = server.CurrentServerRole;
                    lock (ServerIdParameter.serverRoleCache)
                    {
                        ServerIdParameter.serverRoleCache[key] = serverInfo;
                        ServerIdParameter.serverRoleCache[server.Name.ToLowerInvariant()] = serverInfo;
                        ServerIdParameter.serverRoleCache[server.Fqdn.ToLowerInvariant()] = serverInfo;
                    }
                }
                return(list);
            }
            return(wrapper);
        }
Exemple #8
0
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            if (typeof(T) != typeof(ExtendedRight))
            {
                throw new ArgumentException(Strings.ErrorInvalidType(typeof(T).Name), "type");
            }
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (ExtendedRightIdParameter.AllExtendedRights == null)
            {
                ADPagedReader <ExtendedRight> adpagedReader = ((ITopologyConfigurationSession)session).GetAllExtendedRights();
                ExtendedRightIdParameter.allExtendedRights = adpagedReader.ReadAllPages();
            }
            base.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason);
            List <T> list = new List <T>();

            foreach (ExtendedRight extendedRight in ExtendedRightIdParameter.AllExtendedRights)
            {
                if (ADObjectId.Equals(extendedRight.Id, base.InternalADObjectId) || (base.InternalADObjectId != null && base.InternalADObjectId.ObjectGuid == extendedRight.RightsGuid) || (base.RawIdentity != null && (string.Compare(extendedRight.DisplayName, base.RawIdentity, StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(extendedRight.Name, base.RawIdentity, StringComparison.OrdinalIgnoreCase) == 0)))
                {
                    list.Add((T)((object)extendedRight));
                    break;
                }
            }
            return(list);
        }
Exemple #9
0
        // Token: 0x06000A29 RID: 2601 RVA: 0x00021A8C File Offset: 0x0001FC8C
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            IEnumerable <T> enumerable = null;
            List <T>        list       = new List <T>();

            notFoundReason = null;
            int num  = 0;
            int num2 = 0;

            if (base.InternalADObjectId != null)
            {
                enumerable = base.GetADObjectIdObjects <T>(base.InternalADObjectId, rootId, subTreeSession, optionalData);
            }
            EnumerableWrapper <T> wrapper = EnumerableWrapper <T> .GetWrapper(enumerable);

            if (wrapper.HasElements())
            {
                using (IEnumerator <T> enumerator = wrapper.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        T item = enumerator.Current;
                        if (ServerIdParameter.HasRole((ADObjectId)item.Identity, this.RoleRestriction, (IConfigDataProvider)session) || (this.AllowLegacy && !ServerIdParameter.HasRole((ADObjectId)item.Identity, ServerRole.All, (IConfigDataProvider)session)))
                        {
                            list.Add(item);
                        }
                        else if (!ServerIdParameter.HasRole((ADObjectId)item.Identity, ServerRole.All, (IConfigDataProvider)session))
                        {
                            num2++;
                        }
                        else
                        {
                            num++;
                        }
                    }
                    goto IL_21B;
                }
            }
            if (!string.IsNullOrEmpty(this.CommonName) && this.ServerId != null)
            {
                ADObjectId[] matchingIdentities = this.ServerId.GetMatchingIdentities((IConfigDataProvider)session);
                foreach (ADObjectId rootId2 in matchingIdentities)
                {
                    enumerable = base.GetObjectsInOrganization <T>(this.CommonName, rootId2, session, optionalData);
                    foreach (T item2 in enumerable)
                    {
                        if (ServerIdParameter.HasRole((ADObjectId)item2.Identity, this.RoleRestriction, (IConfigDataProvider)session) || (this.AllowLegacy && !ServerIdParameter.HasRole((ADObjectId)item2.Identity, ServerRole.All, (IConfigDataProvider)session)))
                        {
                            list.Add(item2);
                        }
                        else if (!ServerIdParameter.HasRole((ADObjectId)item2.Identity, ServerRole.All, (IConfigDataProvider)session))
                        {
                            num2++;
                        }
                        else
                        {
                            num++;
                        }
                    }
                }
            }
IL_21B:
            if (list.Count == 0)
            {
                if (num2 != 0)
                {
                    notFoundReason = new LocalizedString?(Strings.ExceptionLegacyObjects(this.ToString()));
                }
                if (num != 0)
                {
                    notFoundReason = new LocalizedString?(Strings.ExceptionRoleNotFoundObjects(this.ToString()));
                }
            }
            return(list);
        }
Exemple #10
0
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            IEnumerable <T> enumerable = Enumerable.Empty <T>();

            if (this.ShouldIncludeOutOfBoxCollections && VariantConfiguration.InvariantNoFlightingSnapshot.Global.MultiTenancy.Enabled && base.InternalADObjectId == null)
            {
                bool flag  = false;
                bool flag2 = OrganizationId.ForestWideOrgId.Equals(session.SessionSettings.CurrentOrganizationId);
                if (flag2 && this.IsHierarchical && this.IsHierarchyValid)
                {
                    ClassificationRuleCollectionIdParameter classificationRuleCollectionIdParameter = new ClassificationRuleCollectionIdParameter(this.FriendlyName);
                    enumerable = classificationRuleCollectionIdParameter.GetObjects <T>(rootId, (IConfigDataProvider)session, optionalData, out notFoundReason);
                    flag       = true;
                }
                else if (!flag2 && !this.IsHierarchical)
                {
                    ITopologyConfigurationSession session2 = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(true, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 431, "GetObjects", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\transport\\ClassificationDefinitions\\ClassificationRuleCollectionIdParameter.cs");
                    enumerable = base.GetObjects <T>(ClassificationDefinitionUtils.GetClassificationRuleCollectionContainerId(session2), session2, null, out notFoundReason);
                    flag       = true;
                }
                if (flag)
                {
                    if (optionalData == null)
                    {
                        optionalData = new OptionalIdentityData();
                    }
                    List <T>    list        = enumerable.ToList <T>();
                    QueryFilter queryFilter = ClassificationRuleCollectionIdParameter.CreateExcludeFilter <T>(list);
                    if (queryFilter != null)
                    {
                        optionalData.AdditionalFilter = ((optionalData.AdditionalFilter == null) ? queryFilter : QueryFilter.AndTogether(new QueryFilter[]
                        {
                            optionalData.AdditionalFilter,
                            queryFilter
                        }));
                    }
                    enumerable = list;
                }
            }
            return(enumerable.Concat(base.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason)));
        }
Exemple #11
0
 protected override void InternalProcessRecord()
 {
     TaskLogger.LogEnter();
     try
     {
         if (this.Identity != null)
         {
             TIdentity identity = this.Identity;
             if (identity.OrganizationId != null)
             {
                 IDirectorySession recipSession = this.RecipSession;
                 TIdentity         identity2    = this.Identity;
                 if (TaskHelper.ShouldUnderscopeDataSessionToOrganization(recipSession, identity2.OrganizationId))
                 {
                     IDirectorySession recipSession2 = this.RecipSession;
                     TIdentity         identity3     = this.Identity;
                     this.RecipSession = (IRecipientSession)TaskHelper.UnderscopeSessionToOrganization(recipSession2, identity3.OrganizationId, true);
                 }
                 IDirectorySession currentOrgConfigSession = this.CurrentOrgConfigSession;
                 TIdentity         identity4 = this.Identity;
                 if (TaskHelper.ShouldUnderscopeDataSessionToOrganization(currentOrgConfigSession, identity4.OrganizationId))
                 {
                     IDirectorySession currentOrgConfigSession2 = this.CurrentOrgConfigSession;
                     TIdentity         identity5 = this.Identity;
                     this.CurrentOrgConfigSession     = (ITenantConfigurationSession)TaskHelper.UnderscopeSessionToOrganization(currentOrgConfigSession2, identity5.OrganizationId, true);
                     this.indexProvider.ConfigSession = this.CurrentOrgConfigSession;
                 }
             }
             TIdentity identity6 = this.Identity;
             if (!string.IsNullOrEmpty(identity6.MailboxName))
             {
                 IRecipientSession recipSession3  = this.RecipSession;
                 IRecipientSession gcsession      = this.GCSession;
                 ADServerSettings  serverSettings = base.ServerSettings;
                 TIdentity         identity7      = this.Identity;
                 ADUser            aduser         = RequestTaskHelper.ResolveADUser(recipSession3, gcsession, serverSettings, new MailboxOrMailUserIdParameter(identity7.MailboxName), base.OptionalIdentityData, this.DomainController, new DataAccessHelper.CategorizedGetDataObjectDelegate(base.GetDataObject <ADUser>), new Task.TaskVerboseLoggingDelegate(base.WriteVerbose), new Task.ErrorLoggerDelegate(base.WriteError), false);
                 if (aduser != null)
                 {
                     TIdentity identity8 = this.Identity;
                     identity8.MailboxId = aduser.Id;
                     if (TaskHelper.ShouldUnderscopeDataSessionToOrganization(this.RecipSession, aduser))
                     {
                         this.RecipSession = (IRecipientSession)TaskHelper.UnderscopeSessionToOrganization(this.RecipSession, aduser.OrganizationId, true);
                     }
                     if (TaskHelper.ShouldUnderscopeDataSessionToOrganization(this.CurrentOrgConfigSession, aduser))
                     {
                         this.CurrentOrgConfigSession     = (ITenantConfigurationSession)TaskHelper.UnderscopeSessionToOrganization(this.CurrentOrgConfigSession, aduser.OrganizationId, true);
                         this.indexProvider.ConfigSession = this.CurrentOrgConfigSession;
                     }
                 }
             }
             TIdentity identity9 = this.Identity;
             if (!string.IsNullOrEmpty(identity9.OrganizationName))
             {
                 IConfigurationSession configurationSession = RequestTaskHelper.CreateOrganizationFindingSession(base.CurrentOrganizationId, base.ExecutingUserOrganizationId);
                 TIdentity             identity10           = this.Identity;
                 IIdentityParameter    id                  = new OrganizationIdParameter(identity10.OrganizationName);
                 IConfigDataProvider   session             = configurationSession;
                 ObjectId             rootID               = null;
                 TIdentity            identity11           = this.Identity;
                 LocalizedString?     notFoundError        = new LocalizedString?(Strings.ErrorOrganizationNotFound(identity11.OrganizationName));
                 TIdentity            identity12           = this.Identity;
                 ADOrganizationalUnit adorganizationalUnit = (ADOrganizationalUnit)base.GetDataObject <ADOrganizationalUnit>(id, session, rootID, notFoundError, new LocalizedString?(Strings.ErrorOrganizationNotUnique(identity12.OrganizationName)));
                 if (TaskHelper.ShouldUnderscopeDataSessionToOrganization(this.RecipSession, adorganizationalUnit))
                 {
                     this.RecipSession = (IRecipientSession)TaskHelper.UnderscopeSessionToOrganization(this.RecipSession, adorganizationalUnit.OrganizationId, true);
                 }
                 if (TaskHelper.ShouldUnderscopeDataSessionToOrganization(this.CurrentOrgConfigSession, adorganizationalUnit))
                 {
                     this.CurrentOrgConfigSession     = (ITenantConfigurationSession)TaskHelper.UnderscopeSessionToOrganization(this.CurrentOrgConfigSession, adorganizationalUnit.OrganizationId, true);
                     this.indexProvider.ConfigSession = this.CurrentOrgConfigSession;
                 }
             }
             TIdentity identity13 = this.Identity;
             identity13.SetDefaultIndex(this.DefaultRequestIndexId);
         }
         base.InternalProcessRecord();
     }
     finally
     {
         TaskLogger.LogExit();
     }
 }
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            TaskLogger.LogEnter();
            notFoundReason = null;
            IEnumerable <T> result = new List <T>();

            if (typeof(Database).IsAssignableFrom(typeof(T)) && !string.IsNullOrEmpty(base.RawIdentity))
            {
                LegacyDN legacyDN = null;
                if (LegacyDN.TryParse(base.RawIdentity, out legacyDN))
                {
                    QueryFilter filter = new ComparisonFilter(ComparisonOperator.Equal, DatabaseSchema.ExchangeLegacyDN, base.RawIdentity);
                    result = base.PerformPrimarySearch <T>(filter, rootId, session, true, optionalData);
                }
            }
            else
            {
                result = base.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason);
            }
            TaskLogger.LogExit();
            return(result);
        }
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            if (typeof(T) != typeof(ReducedRecipient))
            {
                throw new ArgumentException(Strings.ErrorInvalidType(typeof(T).Name), "type");
            }
            OptionalIdentityData optionalIdentityData;

            if (optionalData == null)
            {
                optionalIdentityData = new OptionalIdentityData();
            }
            else
            {
                optionalIdentityData = optionalData.Clone();
            }
            RoleGroupIdParameter @object = new RoleGroupIdParameter(base.RawIdentity);
            ADGroup object2 = base.GetObject <ADGroup>(rootId, session, subTreeSession, optionalIdentityData, new RecipientIdParameter.GetObjectsDelegate <ADGroup>(@object.GetObjects <ADGroup>), out notFoundReason);

            if (object2 == null)
            {
                return(EnumerableWrapper <T> .Empty);
            }
            optionalIdentityData.RootOrgDomainContainerId = null;
            IDirectorySession directorySession        = TaskHelper.UnderscopeSessionToOrganization(session, object2.OrganizationId, true);
            IDirectorySession reducedRecipientSession = DirectorySessionFactory.Default.GetReducedRecipientSession((IRecipientSession)directorySession, 160, "GetObjects", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\IdentityParameter\\RecipientParameters\\RoleGroupMemberIdParameter.cs");
            QueryFilter       filter = new ComparisonFilter(ComparisonOperator.Equal, ADRecipientSchema.MemberOfGroup, object2.Id);

            return(base.PerformPrimarySearch <T>(filter, null, reducedRecipientSession, true, optionalIdentityData));
        }
Exemple #14
0
 public IEnumerable <T> GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason) where T : IConfigurable, new()
 {
     notFoundReason = null;
     return(session.FindPaged <T>(null, rootId, false, null, 0));
 }
Exemple #15
0
        internal IEnumerable <T> GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason) where T : IConfigurable, new()
        {
            notFoundReason = null;
            QueryFilter queryFilter = new DagNetworkQueryFilter(this.m_objectId);

            if (optionalData != null && optionalData.AdditionalFilter != null)
            {
                queryFilter = QueryFilter.AndTogether(new QueryFilter[]
                {
                    queryFilter,
                    optionalData.AdditionalFilter
                });
            }
            return(session.FindPaged <T>(queryFilter, rootId, true, null, 0));
        }
        // Token: 0x06000C70 RID: 3184 RVA: 0x00027120 File Offset: 0x00025320
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(session.DomainController, true, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 104, "GetObjects", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\IdentityParameter\\SystemAttendantIdParameter.cs");
            IEnumerable <Server>          objects = base.GetObjects <Server>(rootId, topologyConfigurationSession, topologyConfigurationSession, null, out notFoundReason);
            List <T> list = new List <T>();

            foreach (Server server in objects)
            {
                ADObjectId  childId = server.Id.GetChildId("Microsoft System Attendant");
                QueryFilter filter  = new ComparisonFilter(ComparisonOperator.Equal, ADObjectSchema.ObjectCategory, "exchangeAdminService");
                IEnumerable <ADRecipient> enumerable = base.PerformPrimarySearch <ADRecipient>(filter, childId, session, true, optionalData);
                int num = 0;
                foreach (ADRecipient adrecipient in enumerable)
                {
                    list.Add((T)((object)adrecipient));
                    num++;
                }
            }
            return(list);
        }
        // Token: 0x0600096A RID: 2410 RVA: 0x00020668 File Offset: 0x0001E868
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            if (!typeof(Database).IsAssignableFrom(typeof(T)))
            {
                throw new ArgumentException(Strings.ErrorInvalidType(typeof(T).Name), "type");
            }
            new List <T>();
            notFoundReason = null;
            if (rootId != null)
            {
                Server server = (Server)((IConfigDataProvider)session).Read <Server>(rootId);
                if (server != null)
                {
                    if (optionalData != null && optionalData.AdditionalFilter != null)
                    {
                        throw new NotSupportedException("Supplying Additional Filters and a RootId is not currently supported by this IdParameter.");
                    }
                    return(server.GetDatabases <T>(this.AllowInvalid));
                }
            }
            IEnumerable <T> objects    = base.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason);
            IEnumerable <T> enumerable = from tmpDb in objects
                                         where tmpDb.IsValid || this.AllowInvalid
                                         select tmpDb;
            EnumerableWrapper <T> wrapper = EnumerableWrapper <T> .GetWrapper(enumerable);

            if (!wrapper.HasElements() && this.legacyParameter != null)
            {
                wrapper = EnumerableWrapper <T> .GetWrapper(this.legacyParameter.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason));
            }
            return(wrapper);
        }
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            IEnumerable <T> objects = base.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason);

            if (notFoundReason == null)
            {
                notFoundReason = new LocalizedString?(MrsStrings.ErrorCouldNotFindMoveRequest(this.ToString()));
            }
            return(objects);
        }
Exemple #19
0
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            DistributionGroupIdParameter @object = new DistributionGroupIdParameter(base.RawIdentity);
            ReducedRecipient             object2 = base.GetObject <ReducedRecipient>(rootId, session, subTreeSession, optionalData, new RecipientIdParameter.GetObjectsDelegate <ReducedRecipient>(@object.GetObjects <ReducedRecipient>), out notFoundReason);

            if (object2 == null)
            {
                return(EnumerableWrapper <T> .Empty);
            }
            if (object2.RecipientTypeDetails == RecipientTypeDetails.GroupMailbox || object2.RecipientTypeDetails == RecipientTypeDetails.RemoteGroupMailbox)
            {
                throw new ArgumentException(Strings.WrongTypeMailboxRecipient(object2.Id.ToString()));
            }
            IDirectorySession directorySession        = TaskHelper.UnderscopeSessionToOrganization(session, object2.OrganizationId, true);
            IDirectorySession reducedRecipientSession = DirectorySessionFactory.Default.GetReducedRecipientSession((IRecipientSession)directorySession, 155, "GetObjects", "f:\\15.00.1497\\sources\\dev\\Configuration\\src\\ObjectModel\\IdentityParameter\\RecipientParameters\\DistributionGroupMemberIdParameter.cs");
            QueryFilter       filter = new ComparisonFilter(ComparisonOperator.Equal, ADRecipientSchema.MemberOfGroup, object2.Id);

            return(base.PerformPrimarySearch <T>(filter, null, reducedRecipientSession, true, optionalData));
        }
Exemple #20
0
 IEnumerable <T> IIdentityParameter.GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
 {
     throw new NotImplementedException();
 }
 // Token: 0x06000465 RID: 1125 RVA: 0x0001952F File Offset: 0x0001772F
 internal override MultiValuedPropertyBase CreateMultiValuedProperty(ProviderPropertyDefinition propertyDefinition, bool createAsReadOnly, ICollection values, ICollection invalidValues, LocalizedString?readOnlyErrorMessage)
 {
     return(ADValueConvertor.CreateGenericMultiValuedProperty(propertyDefinition, createAsReadOnly, values, invalidValues, readOnlyErrorMessage));
 }
 // Token: 0x060009DE RID: 2526 RVA: 0x000214F0 File Offset: 0x0001F6F0
 internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
 {
     if (typeof(T) != typeof(HostedConnectionFilterPolicy))
     {
         throw new ArgumentException(Strings.ErrorInvalidType(typeof(T).Name), "type");
     }
     return(base.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason));
 }
        protected override void InternalProcessRecord()
        {
            string forestFQDN = this.DataObject.OrganizationId.PartitionId.ForestFQDN;

            if (this.applyTransitionFromCmdlet)
            {
                LocalizedString?localizedString = null;
                if (!this.DataObject.AutoCompletionEnabled && this.DataObject.RelocationStatusDetailsSource != (RelocationStatusDetailsSource)this.DataObject.RelocationStateRequested)
                {
                    localizedString = new LocalizedString?(Strings.WarningApplyingTransitionWhileRelocationStatusNotReachedStateRequested(this.Identity.ToString(), this.DataObject.RelocationStateRequested.ToString(), this.DataObject.RelocationStatusDetailsSource.ToString()));
                }
                else if (this.DataObject.AutoCompletionEnabled && this.DataObject.RelocationStatusDetailsSource != RelocationStatusDetailsSource.RetiredUpdatedTargetForest)
                {
                    localizedString = new LocalizedString?(Strings.WarningApplyingTransitionWhileRelocationStatusNotReachedStateRequested(this.Identity.ToString(), this.DataObject.RelocationStateRequested.ToString(), this.DataObject.RelocationStatusDetailsSource.ToString()));
                }
                if (localizedString != null && !base.ShouldContinue(localizedString.Value))
                {
                    return;
                }
                if (this.RollbackGls && this.DataObject.RelocationStatusDetailsSource == RelocationStatusDetailsSource.RetiredUpdatedTargetForest)
                {
                    localizedString = new LocalizedString?(Strings.WarningPossibleDataLossWithGlsRollback(this.Identity.ToString(), this.DataObject.TargetForest, forestFQDN));
                    if (!base.ShouldContinue(localizedString.Value))
                    {
                        return;
                    }
                }
            }
            if (this.Suspend && this.DataObject.RelocationStatusDetailsSource > RelocationStatusDetailsSource.SynchronizationStartedDeltaSync)
            {
                LocalizedString?localizedString2 = new LocalizedString?(Strings.WarningSuspendSupportedOnlyDuringSync(this.DataObject.RelocationStatusDetailsSource.ToString(), RelocationStatusDetailsSource.SynchronizationStartedFullSync.ToString(), RelocationStatusDetailsSource.SynchronizationStartedDeltaSync.ToString()));
                if (!base.ShouldContinue(localizedString2.Value))
                {
                    return;
                }
            }
            this.DataObject.RelocationLastError = RelocationError.None;
            if (base.Fields.IsChanged(TenantRelocationRequestSchema.RelocationStateRequested))
            {
                this.DataObject.RelocationStateRequested = (RelocationStateRequested)this.RelocationStateRequested;
            }
            if (base.Fields.IsChanged(TenantRelocationRequestSchema.LargeTenantModeEnabled))
            {
                this.DataObject.LargeTenantModeEnabled = this.LargeTenantModeEnabled;
            }
            if (base.Fields.IsChanged(TenantRelocationRequestSchema.AutoCompletionEnabled))
            {
                this.DataObject.AutoCompletionEnabled = this.AutoCompletionEnabled;
                if (this.AutoCompletionEnabled)
                {
                    this.DataObject.RelocationStateRequested = Microsoft.Exchange.Data.Directory.SystemConfiguration.RelocationStateRequested.None;
                }
            }
            if (base.Fields.IsChanged(TenantRelocationRequestSchema.SafeLockdownSchedule))
            {
                this.DataObject.SafeLockdownSchedule = this.SafeLockdownSchedule;
            }
            if (this.Suspend)
            {
                this.DataObject.Suspended = true;
            }
            else if (this.Resume)
            {
                this.DataObject.Suspended = false;
            }
            if (this.applyTransitionFromCmdlet)
            {
                Exception ex;
                TenantRelocationRequest.PopulatePresentationObject(this.DataObject, null, out ex);
                if (ex != null)
                {
                    throw ex;
                }
                RelocationStatusDetails relocationStatusDetailsRaw = this.DataObject.RelocationStatusDetailsRaw;
                this.DataObject.RelocationStatusDetailsRaw = RelocationStatusDetails.SynchronizationFinishedFullSync;
                this.DataObject.AutoCompletionEnabled      = false;
                if (this.RollbackGls)
                {
                    this.RevertGlsAccountForestToSource(forestFQDN);
                    this.RevertTargetTenantStateToArriving();
                    this.DataObject.IncrementTransitionCounter(TenantRelocationTransition.RetiredToSync);
                    this.DataObject.OrganizationStatus = OrganizationStatus.Active;
                    TenantRelocationRequest.SetRelocationCompletedOnOU((ITenantConfigurationSession)base.DataSession, this.DataObject.OrganizationId);
                }
                else
                {
                    TenantRelocationTransition transition;
                    if (relocationStatusDetailsRaw == RelocationStatusDetails.SynchronizationFinishedDeltaSync)
                    {
                        transition = TenantRelocationTransition.DeltaSyncToSync;
                    }
                    else
                    {
                        transition = TenantRelocationTransition.LockdownToSync;
                    }
                    this.DataObject.IncrementTransitionCounter(transition);
                }
            }
            if (this.ResetTransitionCounter)
            {
                this.DataObject.TransitionCounter = new MultiValuedProperty <TransitionCount>();
            }
            if (this.ResetPermanentError)
            {
                this.DataObject.RelocationLastError = RelocationError.None;
            }
            if (this.ResetStartSyncTime)
            {
                this.DataObject.LastSuccessfulRelocationSyncStart = new DateTime?(DateTime.UtcNow);
            }
            ((IDirectorySession)base.DataSession).SessionSettings.RetiredTenantModificationAllowed = true;
            base.InternalProcessRecord();
            string ridMasterName = ForestTenantRelocationsCache.GetRidMasterName(new PartitionId(forestFQDN));

            if (this.DataObject.OriginatingServer != ridMasterName)
            {
                this.WriteWarning(Strings.WarningShouldWriteToRidMaster(this.DataObject.OriginatingServer, ridMasterName));
            }
        }
        IEnumerable <T> IIdentityParameter.GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (null == this.InternalMailboxFolderId)
            {
                throw new InvalidOperationException(Strings.ErrorOperationOnInvalidObject);
            }
            if (!(session is MailboxFolderDataProviderBase))
            {
                throw new NotSupportedException("session: " + session.GetType().FullName);
            }
            if (optionalData != null && optionalData.AdditionalFilter != null)
            {
                throw new NotSupportedException("Supplying Additional Filters is not currently supported by this IdParameter.");
            }
            T t = (T)((object)session.Read <T>(this.InternalMailboxFolderId));

            if (t == null)
            {
                notFoundReason = new LocalizedString?(Strings.ErrorManagementObjectNotFound(this.ToString()));
                return(new T[0]);
            }
            notFoundReason = null;
            return(new T[]
            {
                t
            });
        }
        // Token: 0x06000955 RID: 2389 RVA: 0x00020298 File Offset: 0x0001E498
        internal override IEnumerable <T> GetObjects <T>(ADObjectId rootId, IDirectorySession session, IDirectorySession subTreeSession, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            var func  = null;
            var func2 = null;
            var func3 = null;
            Func <DatabaseCopy, int> func4 = null;

            if (!typeof(DatabaseCopy).IsAssignableFrom(typeof(T)))
            {
                throw new ArgumentException(Strings.ErrorInvalidType(typeof(T).Name), "type");
            }
            new List <T>();
            notFoundReason = null;
            if (base.InternalADObjectId != null)
            {
                return(base.GetObjects <T>(rootId, session, subTreeSession, optionalData, out notFoundReason));
            }
            IEnumerable <DatabaseCopy> enumerable;

            if (this.DatabaseName.Equals("*"))
            {
                enumerable = from dbCopy in base.PerformPrimarySearch <DatabaseCopy>(base.CreateWildcardOrEqualFilter(ADObjectSchema.Name, this.ServerName), rootId, session, true, optionalData)
                             where dbCopy.IsValidDatabaseCopy(this.AllowInvalid)
                             select dbCopy;
            }
            else
            {
                IEnumerable <MiniDatabase> source = this.PerformSearch <MiniDatabase>(base.CreateWildcardOrEqualFilter(ADObjectSchema.Name, this.DatabaseName), null, session, true);
                if (func == null)
                {
                    func = ((MiniDatabase db) => new
                    {
                        db = db,
                        tmpRootId = (db.Id ?? new ADObjectId(db.Name))
                    });
                }
                var source2            = source.Select(func);
                var collectionSelector = < > h__TransparentIdentifier0 => this.PerformPrimarySearch <DatabaseCopy>(this.CreateWildcardOrEqualFilter(ADObjectSchema.Name, this.ServerName), <> h__TransparentIdentifier0.tmpRootId, session, true, optionalData);
                if (func2 == null)
                {
                    func2 = ((< > h__TransparentIdentifier0, DatabaseCopy dbCopy) => new
                    {
        public IEnumerable <T> GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason) where T : IConfigurable, new()
        {
            notFoundReason = null;
            AggregationSubscriptionQueryFilter filter = new AggregationSubscriptionQueryFilter(this);

            return(session.FindPaged <T>(filter, rootId, false, null, 0));
        }
        IEnumerable <T> IIdentityParameter.GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (!(session is EwsStoreDataProvider))
            {
                throw new NotSupportedException("session: " + session.GetType().FullName);
            }
            if (optionalData != null && optionalData.AdditionalFilter != null)
            {
                throw new NotSupportedException("Supplying Additional Filters is not currently supported by this IdParameter.");
            }
            T t = (this.ewsStoreObjectId != null) ? ((T)((object)session.Read <T>(this.ewsStoreObjectId))) : ((EwsStoreDataProvider)session).FindByAlternativeId <T>(this.rawIdentity);

            if (t == null)
            {
                notFoundReason = new LocalizedString?(Strings.ErrorManagementObjectNotFound(this.ToString()));
                return(new T[0]);
            }
            notFoundReason = null;
            return(new T[]
            {
                t
            });
        }
Exemple #28
0
        internal IEnumerable <T> GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason) where T : IConfigurable, new()
        {
            if (!(session is ContentFilterPhraseDataProvider))
            {
                throw new ArgumentException(Strings.ErrorInvalidType((session != null) ? session.GetType().Name : "null"), "session");
            }
            notFoundReason = null;
            IConfigurable configurable = session.Read <T>(new ContentFilterPhraseIdentity(this.phrase));

            T[] result;
            if (configurable != null)
            {
                result = new T[]
                {
                    (T)((object)configurable)
                };
            }
            else
            {
                result = new T[0];
            }
            return(result);
        }
Exemple #29
0
 // Token: 0x06000881 RID: 2177 RVA: 0x0001E7C1 File Offset: 0x0001C9C1
 IEnumerable <T> IIdentityParameter.GetObjects <T>(ObjectId rootId, IConfigDataProvider session, OptionalIdentityData optionalData, out LocalizedString?notFoundReason)
 {
     return(this.GetObjects <T>(rootId, session, optionalData, out notFoundReason));
 }
Exemple #30
0
 // Token: 0x060002D1 RID: 721 RVA: 0x0000B34C File Offset: 0x0000954C
 protected IConfigurable GetDataObject <TObject>(IIdentityParameter id, IConfigDataProvider session, ObjectId rootID, LocalizedString?notFoundError, LocalizedString?multipleFoundError, ExchangeErrorCategory errorCategory) where TObject : IConfigurable, new()
 {
     return(this.GetDataObject <TObject>(id, session, rootID, null, notFoundError, multipleFoundError, errorCategory));
 }