当前位置: 代码迷 >> J# >> 请问 怎么登录 活动目录中的LDAP服务,获取活动目录信息
  详细解决方案

请问 怎么登录 活动目录中的LDAP服务,获取活动目录信息

热度:529   发布时间:2013-02-25 00:00:00.0
请教 如何登录 活动目录中的LDAP服务,获取活动目录信息
请各位高手;帮帮忙!!!!!!

   我想通过程序链接到活动目录,取到活动目录信息,并修改活动目录中的用户密码。

------解决方案--------------------------------------------------------
不懂,好象以前的帖有,你查查用户密码,帮你up
------解决方案--------------------------------------------------------
DirectoryEntry usr = new DirectoryEntry("LDAP://CN=John Smith, DC=Fabrikam,DC=COM");
usr.Invoke("ChangePassword", new object[] {"secre@t!!!","mynewsecre@t!#*"});

see

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/netds/invoking_active_directory_methods.asp
------解决方案--------------------------------------------------------
正好 最近 研究 这个 :


    DirectoryEntry obDirEntry = null;
    try
    {
        obDirEntry = new DirectoryEntry("WinNT://" + strDoamin);
        DirectoryEntries entries = obDirEntry.Children;
        DirectoryEntry obUser = entries.Add(strLogin, "User");
        obUser.Properties["FullName"].Add("Amigo");
        object obRet = obUser.Invoke("SetPassword", strPwd);
        obUser.CommitChanges();
    }
    catch (Exception ex)
    {
        Trace.Warn(ex.Message);
    }

------解决方案--------------------------------------------------------
see

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netdir/netds/invoking_active_directory_methods.asp
------解决方案--------------------------------------------------------
mark