System.DirectoryServices.DirectoryEntry myDE = new System.DirectoryServices.DirectoryEntry(strPath);      
  
myDirectoryEntry.Properties["name"].Value=OUName; 还有好多 Properties["instanceType"].
还有下面代码中的
if(tempEntry.SchemaClassName.ToString() == "user")    
{    
if(tempEntry.Properties["sAMAccountName"].Value.ToString().ToLower()=="karlluo")    
{    
tempEntry.UsePropertyCache=true;    
tempEntry.Properties["st"].Value="yyyyyyyyyyyyyyyy";    
//newEntry.Properties["userPrincipalName"].Value="userID";    
tempEntry.CommitChanges();    
红色部分都不太明白,MSDN中也找不到相关介绍.请问谁有这方面的介绍,我上网去搜(baidu google都没有).高手求助,谢谢
不胜感激

解决方案 »

  1.   

    Properties就是获取楼主定义DirectoryEntry对象的Active Directory属性
    所以字符串里值表明对应的AD的属性,就类同你操作数据集时表明对应字段。
    你这段代码是根据SchemaClassName(DirectoryEntry 对象的架构类的名称)和sAMAccountName(创建用户的用户名)
    去判断是否满足条件,满足则改变相关属性,更新此DirectoryEntry对象