如何使用Notes目录中的LDAP通过LDAP的专有名称获取Exchange服务器的用户

时间:2019-01-30 10:43:06

标签: active-directory ldap lotus-notes lotus-domino distinguishedname

我正在尝试使用server来设置LDAP字段,以便从票据中的交换人bearbeiter获取可分辨的用户名,因此除该用户外,没有人可以访问该特定文档是在bearbeiter字段中添加的。我尝试过其他类型的名称,例如cannonicalabbreviated,但没有用。我如何获得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;
    }
  }

0 个答案:

没有答案