active-directory - 如何在笔记目录中使用 LDAP 通过可分辨名称获取 Exchange 服务器的用户
问题描述
我正在尝试从使用设置字段server
的注释中的交换中获取用户的可分辨名称,因此除了在字段中添加的用户之外,没有人可以访问该特定文档。我尝试过其他类型的名称,例如或但那个剂量不工作。如何获取交换用户的名称?LDAP
bearbeiter
bearbeiter
cannonical
abbreviated
Distinguished name(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;
}
}
解决方案
推荐阅读
- php - 为什么 AJAX 不执行函数?使用 HREF
- reactjs - 如何将json数据传递给ejs前端
- xcode - 如何在 Xcode 中打开颜色选择器?
- laravel - Laravel Mix npm 在服务器上运行开发错误 ELIFECYCLE
- python - 用于多个图像的 Opencv BFMatcher
- python - 在熊猫数据框中删除多个条件的行
- javascript - Express.js vs Spring 谁是最好的
- android - Android改造解析List中的嵌套json响应
- php - PHP 查询缺少第一行
- javascript - 窗口innerWidth,innerHeight问题