Пример #1
0
 private void Refresh(ADRootDSE rootDSE)
 {
     if (rootDSE != null)
     {
         if (rootDSE.SessionInfo != null)
         {
             if (this._forestId.Equals(rootDSE.SubSchemaSubEntry, StringComparison.OrdinalIgnoreCase))
             {
                 object[] objArray = new object[1];
                 objArray[0] = this._forestId;
                 DebugLogger.LogInfo("ADForestPartitionInfo", "Refreshing PartitionList of Forest: {0}", objArray);
                 List <string> strs        = new List <string>();
                 ADSessionInfo sessionInfo = rootDSE.SessionInfo;
                 if (rootDSE.ServerType == ADServerType.ADDS && sessionInfo.ConnectedToGC)
                 {
                     sessionInfo = sessionInfo.Copy();
                     sessionInfo.SetEffectivePort(LdapConstants.LDAP_PORT);
                 }
                 using (ADObjectSearcher aDObjectSearcher = new ADObjectSearcher(sessionInfo))
                 {
                     aDObjectSearcher.SchemaTranslation = false;
                     aDObjectSearcher.SearchRoot        = string.Concat("CN=Partitions,", rootDSE.ConfigurationNamingContext);
                     aDObjectSearcher.Properties.Add("nCName");
                     aDObjectSearcher.Filter = ADOPathUtil.CreateFilterClause(ADOperator.Eq, "objectClass", "crossRef");
                     foreach (ADObject aDObject in aDObjectSearcher.FindAll())
                     {
                         if (aDObject["nCName"] == null || aDObject["nCName"].Count <= 0)
                         {
                             continue;
                         }
                         strs.Add((string)aDObject["nCName"][0]);
                     }
                     this._forestPartitionList = new ReadOnlyCollection <string>(strs);
                 }
                 return;
             }
             else
             {
                 throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, StringResources.ForestIdDoesNotMatch, new object[0]));
             }
         }
         else
         {
             throw new ArgumentNullException("rootDSE.SessionInfo");
         }
     }
     else
     {
         throw new ArgumentNullException("rootDSE");
     }
 }
Пример #2
0
		protected ADSession(ADSessionInfo info)
		{
			this._handleLock = new object();
			this._info = info.Copy();
			this._storeAccess = ADServiceStoreAccessFactory.GetObject();
		}
Пример #3
0
 public ADSchema(ADSessionInfo sessionInfo)
 {
     this._sessionInfo = sessionInfo.Copy();
     this.Init();
 }
Пример #4
0
		public ADSchema(ADSessionInfo sessionInfo)
		{
			this._sessionInfo = sessionInfo.Copy();
			this.Init();
		}
Пример #5
0
 protected ADSession(ADSessionInfo info)
 {
     this._handleLock  = new object();
     this._info        = info.Copy();
     this._storeAccess = ADServiceStoreAccessFactory.GetObject();
 }