用member属性,添加一个DirectoyInfo进去。我这里没代码,有空给你找找

解决方案 »

  1.   

      to liangxf0022(小新)  
     
     是不是添加 DirectoyInfo  属性 就添加拉一个组?
      

  2.   

    在Ad   user   and   computer中,右键单击域名-->单击属性,在对话框中的“域模式",可以看到你现在的域模式是“混合模式",需要单击“本机模式"按钮,这样,你就可以创建“Universal   Group"   不知道对不对试下看
      

  3.   

    对,在Member中创建一个对象就在实际的LDAP中创建了一个群组。你可以试试
      

  4.   

    to  liangxf0022(小新   能不能来个详细点的类子。。
      

  5.   

    /// <summary>
            /// 创建新的用户
            /// 向组织单位里添加用户
            /// </summary>
            /// <param name="ldapDN">DN 位置。例如:OU=共享平台 或 CN=Users</param>
            /// <param name="commonName">公共名称,组织单位对象下username表示名称</param>
            /// <param name="sAMAccountName">帐号,sAMAccountName设置的是用户的登陆名称</param>
            /// <param name="password">密码</param>
            /// <returns></returns>
            public static DirectoryEntry CreateNewUsers(string ldapDN, string commonName, string sAMAccountName, string password)
            {
                DirectoryEntry entry = GetDirectoryObject();
                DirectoryEntry subEntry = entry.Children.Find(ldapDN);            impersonate.BeginImpersonate();
                DirectoryEntry deUser = subEntry.Children.Add("CN=" + commonName, "user");
                
                deUser.Properties["sAMAccountName"].Value = sAMAccountName;
                deUser.CommitChanges();
                impersonate.StopImpersonate();            ADCommandData.EnableUser(commonName);
                ADCommandData.SetPassword(commonName, password);
               
                deUser.Close();
                return deUser;
            }
            #endr
    这个是创建用户~~  那组的是什么情况???
      

  6.   

    ms-help://MS.MSDNQTR.2003FEB.2052/netdir/ad/example_code_for_creating_a_group.htm
      

  7.   

    to hdt(倦怠)   我看啦啊 ~是VB 的  哦哦 小弟看不懂哦。。 。能不能用 2005的作一个小程序给小弟看看 ~~~~~~谢谢。。
      

  8.   

    谢谢  [email protected] 谢谢  哥们
      

  9.   

    就是创建一个简单的祖 就 OK拉我用代码作的 也不抱错 .但是在AD里面就是找不到组哦..郁闷..
           DirectoryEntry entry = new DirectoryEntry("LDAP://DC=ADTest,DC=com", "administrator", "wh5010117", AuthenticationTypes.Secure);
            entry.Children.Add("NewGroup", "Group");
            entry.Properties["Description"].Add("Test");
            entry.CommitChanges();
    这样就没有感觉~
      

  10.   

    代码很简单,就直接贴了DirectoryEntry dom = new DirectoryEntry(.............);
    DirectoryEntry ou = dom.Children.Find("OU=Consulting");
    DirectoryEntry mgr = ou.Children.Add("CN=Managers","group");
    mgr.Properties["groupType"].Value = ActiveDs.ADS_GROUP_TYPE_ENUM.ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP | 
    ActiveDs.ADS_GROUP_TYPE_ENUM.ADS_GROUP_TYPE_SECURITY_ENABLED;
    mgr.CommitChanges();
      

  11.   

    to  hdt(倦怠) 我去试试 感觉好像不行2~
      

  12.   

    to  hdt(倦怠) 大哥mgr.Properties["groupType"].Value = ActiveDs.ADS_GROUP_TYPE_ENUM.ADS_GROUP_TYPE_DOMAIN_LOCAL_GROUP | 
    ActiveDs.ADS_GROUP_TYPE_ENUM.ADS_GROUP_TYPE_SECURITY_ENABLED;在我的程序里面我应该怎么做???
      

  13.   

    DirectoryEntry entry = new DirectoryEntry("LDAP://DC=ADTest,DC=com", "administrator", "wh5010117", AuthenticationTypes.Secure);
       DirectoryEntry ou = entry.Children.Find("OU=北京中科领航");
            DirectoryEntry mgr = ou.Children.Add("CN=Managers", "group");
            mgr.Properties["groupType"].Value = - 2147483644;
            entry.CommitChanges();
    好像还是不行哦
      

  14.   

    DirectoryEntry entry = new DirectoryEntry("LDAP://DC=ADTest,DC=com", "administrator", "wh5010117", AuthenticationTypes.Secure);
       DirectoryEntry ou = entry.Children.Find("OU=北京中科领航");
            DirectoryEntry mgr = ou.Children.Add("CN=Managers", "group");
            mgr.Properties["groupType"].Value = - 2147483644;
            entry.CommitChanges();
    好像还是不行哦
      

  15.   

    DirectoryEntry entry = new DirectoryEntry("LDAP://DC=ADTest,DC=com", "administrator", "wh5010117", AuthenticationTypes.Secure);
       DirectoryEntry ou = entry.Children.Find("OU=北京中科领航");
            DirectoryEntry mgr = ou.Children.Add("CN=Managers", "group");
            mgr.Properties["groupType"].Value = - 2147483644;
            entry.CommitChanges();
    这样一来   应该可以创建成功..但是.. . 在AD 里面确实找不到哦。. 好郁闷哦。.~