用java如何获取AD域的用户和组的信息, 用java获取AD域中的用户以及组的所有信息 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 哎,可怜啊,这个难搞哦,给你一段参考(不过这是C#的):myLDAPPath = "LDAP://你的域名"; DirectoryEntry mySearchRoot = new DirectoryEntry(myLDAPPath); DirectorySearcher myDirectorySearcher = new DirectorySearcher(mySearchRoot); #region all informations myDirectorySearcher.Filter = ("(objectClass=user)"); //user表示用户,group表示组 foreach (SearchResult mySearchResult in myDirectorySearcher.FindAll()) { if (mySearchResult != null) { // Get the properties of the 'mySearchResult'. ResultPropertyCollection myResultPropColl; myResultPropColl = mySearchResult.Properties; Console.WriteLine("The properties of the 'mySearchResult' are :"); foreach (string myKey in myResultPropColl.PropertyNames) { string tab = " "; Console.WriteLine(myKey + " = "); foreach (Object myCollection in myResultPropColl[myKey]) { Console.WriteLine(tab + myCollection); } } mySearchRoot.Dispose(); } } 这代码 一开始变量是string是都没写 我还解析呢 才看到字符串 加了个string 难搞,又不稳定我的解决方法是用.net输出webservice,然后java访问webservice.net读取ad输出webservice 就简单又稳定 sax解析xml多重节点 求助啊!!关于dtree 注册页面(后面有检验的那种)如何实现 java ee 编程思想 世界编程大赛头名程序源代码 eclipse中tomcat启动问题 请教一下各位Websphere V6.1是否支持EJB3? servlet的manager 下打不开文件目录 如何学习hibernate,请高人指教 jsp跳转输出数据问题 请教高手一个问题!!!!!!!!!!!! struts2下载问题(下载路径动态配置在xml中)
DirectorySearcher myDirectorySearcher = new DirectorySearcher(mySearchRoot); #region all informations myDirectorySearcher.Filter = ("(objectClass=user)"); //user表示用户,group表示组
foreach (SearchResult mySearchResult in myDirectorySearcher.FindAll())
{
if (mySearchResult != null)
{
// Get the properties of the 'mySearchResult'.
ResultPropertyCollection myResultPropColl;
myResultPropColl = mySearchResult.Properties;
Console.WriteLine("The properties of the 'mySearchResult' are :"); foreach (string myKey in myResultPropColl.PropertyNames)
{
string tab = " ";
Console.WriteLine(myKey + " = ");
foreach (Object myCollection in myResultPropColl[myKey])
{
Console.WriteLine(tab + myCollection);
}
}
mySearchRoot.Dispose();
}
}
我的解决方法是用.net输出webservice,然后java访问webservice
.net读取ad输出webservice 就简单又稳定