Exemplo n.º 1
0
        // Methods
        internal override void PerServerProcessRecord()
        {
            ADObjectFactory <ADObject> factory           = new ADObjectFactory <ADObject>();
            CmdletSessionInfo          cmdletSessionInfo = this.GetCmdletSessionInfo();

            factory.SetCmdletSessionInfo(cmdletSessionInfo);
            base._factory.SetCmdletSessionInfo(cmdletSessionInfo);
            string[] propertiesToFetch = new string[] { "msDS-NCReplCursors" };
            string[] partitionList     = base._cmdletParameters["PartitionFilter"] as string[];
            if (partitionList == null)
            {
                partitionList = new string[] { "Default" };
            }
            foreach (string str in ADForestPartitionInfo.ConstructPartitionList(cmdletSessionInfo.ADRootDSE, partitionList, false))
            {
                ADObject identityObj = new ADObject(str);
                try
                {
                    identityObj = factory.GetExtendedObjectFromIdentity(identityObj, cmdletSessionInfo.DefaultPartitionPath, propertiesToFetch);
                }
                catch (Exception exception)
                {
                    if (!(exception is ADIdentityNotFoundException) && !(exception is ADReferralException))
                    {
                        throw exception;
                    }
                    continue;
                }
                foreach (ADReplicationUpToDatenessVectorTable table in base._factory.GetExtendedObjectFromDirectoryObject(identityObj, "msDS-NCReplCursors", "DS_REPL_CURSOR"))
                {
                    base.WriteObject(table);
                }
            }
        }
        internal override void PerServerProcessRecord()
        {
            ADObjectFactory <ADObject> factory           = new ADObjectFactory <ADObject>();
            CmdletSessionInfo          cmdletSessionInfo = this.GetCmdletSessionInfo();

            factory.SetCmdletSessionInfo(cmdletSessionInfo);
            base._factory.SetCmdletSessionInfo(cmdletSessionInfo);
            string[] partitionList = base._cmdletParameters["PartitionFilter"] as string[];
            if (partitionList == null)
            {
                partitionList = new string[] { "Default" };
            }
            foreach (string str in ADForestPartitionInfo.ConstructPartitionList(cmdletSessionInfo.ADRootDSE, partitionList, false))
            {
                ADObject identityObj = new ADObject(str);
                try
                {
                    identityObj = factory.GetExtendedObjectFromIdentity(identityObj, cmdletSessionInfo.DefaultPartitionPath, this._propertiesRequested);
                }
                catch (Exception exception)
                {
                    if (!(exception is ADIdentityNotFoundException) && !(exception is ADReferralException))
                    {
                        throw exception;
                    }
                    continue;
                }
                if (this._propertiesRequested.Contains <string>("msDS-NCReplInboundNeighbors"))
                {
                    foreach (ADReplicationPartnerMetadata metadata in base._factory.GetExtendedObjectFromDirectoryObject(identityObj, "msDS-NCReplInboundNeighbors", "DS_REPL_NEIGHBOR"))
                    {
                        base.WriteObject(metadata);
                    }
                }
                if (this._propertiesRequested.Contains <string>("msDS-NCReplOutboundNeighbors"))
                {
                    foreach (ADReplicationPartnerMetadata metadata2 in base._factory.GetExtendedObjectFromDirectoryObject(identityObj, "msDS-NCReplOutboundNeighbors", "DS_REPL_NEIGHBOR"))
                    {
                        base.WriteObject(metadata2);
                    }
                }
            }
        }
        protected bool GetADReplicationAttributeMetadataProcessCSRoutine()
        {
            ADObjectFactory <ADObject> aDObjectFactory = new ADObjectFactory <ADObject>();
            ADObject item = this._cmdletParameters["Object"] as ADObject;

            this.SetPipelinedSessionInfo(item.SessionInfo);
            CmdletSessionInfo cmdletSessionInfo = this.GetCmdletSessionInfo();

            this._factory.SetCmdletSessionInfo(cmdletSessionInfo);
            aDObjectFactory.SetCmdletSessionInfo(cmdletSessionInfo);
            item = aDObjectFactory.GetExtendedObjectFromIdentity(item, cmdletSessionInfo.DefaultPartitionPath, this._propertiesRequested, this._showDeleted);
            foreach (ADReplicationAttributeMetadata extendedObjectFromDirectoryObject in this._factory.GetExtendedObjectFromDirectoryObject(item, "msDS-ReplAttributeMetaData", "DS_REPL_ATTR_META_DATA"))
            {
                base.WriteObject(extendedObjectFromDirectoryObject);
            }
            foreach (ADReplicationAttributeMetadata aDReplicationAttributeMetadatum in this._factory.GetExtendedObjectFromDirectoryObject(item, "msDS-ReplValueMetaData", "DS_REPL_VALUE_META_DATA"))
            {
                base.WriteObject(aDReplicationAttributeMetadatum);
            }
            return(true);
        }