Active directory 如何使用notes目录中的LDAP按可分辨名称获取Exchange server用户
我正在尝试使用Active directory 如何使用notes目录中的LDAP按可分辨名称获取Exchange server用户,active-directory,ldap,lotus-notes,lotus-domino,distinguishedname,Active Directory,Ldap,Lotus Notes,Lotus Domino,Distinguishedname,我正在尝试使用LDAP设置bearbeiter字段,从notes中的exchangeserver获取用户的可分辨名称,因此,除了添加在bearbeiter字段中的用户之外,没有人可以访问该特定文档。我尝试过其他类型的名称,如cannonical或缩写,但不起作用。如何获取exchange用户的可分辨名称(DN)名称 public String lookup(String searchedName) throws NotesException { Vector<String>
LDAP
设置bearbeiter
字段,从notes中的exchangeserver
获取用户的可分辨名称,因此,除了添加在bearbeiter
字段中的用户之外,没有人可以访问该特定文档。我尝试过其他类型的名称,如cannonical
或缩写
,但不起作用。如何获取exchange用户的可分辨名称(DN)
名称
public String lookup(String searchedName) throws NotesException {
Vector<String> result = new Vector<String>();
String result = null;
try {
Session sess = DominoUtils.getCurrentSession();
Directory dir = sess.getDirectory();
dir.setSearchAllDirectories(true);
Vector<String> itemsToFetch = new Vector<String>();
itemsToFetch.add("FullName");
itemsToFetch.add("Mail");
Vector<String> namesToLookup = new Vector<String>();
namesToLookup.add(searchedName);
DirectoryNavigator dirnav = dir.lookupNames("($Users)",namesToLookup, itemsToFetch, true);
int count = 0;
while (dirnav.isNameLocated()) {
while (dirnav.isMatchLocated()) {
Vector<String> iv = dirnav.getNthItemValue(1);
String notesid =iv.get(0) ;
result=notesid;
dirnav.findNextMatch();
count += 1;
}
dirnav.findNextName();
}
dirnav.recycle();
dir.recycle();
sess.recycle();
return result;
} catch (Exception e) {
System.out.println("In Catch, error in lookup function inside DirectoryDelegatesPickerEws java class "+e.getStackTrace());
return result;
}
}
公共字符串查找(String searchedName)引发NotesException{
向量结果=新向量();
字符串结果=null;
试一试{
Session sess=dominutils.getCurrentSession();
Directory dir=sess.getDirectory();
目录设置搜索目录(正确);
Vector itemsToFetch=新向量();
itemsToFetch.add(“全名”);
itemsToFetch.add(“邮件”);
向量名称tolookup=新向量();
namestookup.add(searchedName);
DirectoryNavigator dirnav=dir.lookupNames($Users),namestookup,itemsToFetch,true);
整数计数=0;
而(dirnav.isNameLocated()){
while(dirnav.isMatchLocated()){
向量iv=dirnav.getNthItemValue(1);
字符串notesid=iv.get(0);
结果=notesid;
dirnav.findNextMatch();
计数+=1;
}
dirnav.findNextName();
}
dirnav.recycle();
dir.recycle();
sess.recycle();
返回结果;
}捕获(例外e){
System.out.println(“在Catch中,DirectoryDelegatesPickerEws java类内的查找函数出错”+e.getStackTrace());
返回结果;
}
}
向我们展示一些代码,显示您已经尝试过的内容