如何使用 ActiveDirectory 库从 LDAP AD 组获取所有用户?

How to get all users from LDAP AD group using ActiveDirectory library?

我有这个功能 https://www.npmjs.com/package/activedirectory2#getUsersForGroup 但是当我用一个存在的组的 CN 调用它时,它 returns 什么都没有。 该组存在并且有用户,但该函数未返回任何用户。

ad.authenticate(config.USERNAME, config.PASSWORD, function(err, auth) {
  if (err) {
    console.log('ERROR: '+JSON.stringify(err));
    return;
  }

  if (auth) {
    console.log('Authenticated!');


    let groupName = 'ORG-Application-ContactCentre-ORG-RSV-BusAdmin';
    ad.findGroup(groupName, function(err, group) {
    if (err) {
        console.log('ERROR: ' +JSON.stringify(err));
        return;
    }

    if (! group) console.log('Group: ' + groupName + ' not found.');
    else console.log(JSON.stringify(group));
    });

    ad.getUsersForGroup(groupName, function(err, users) {
    if (err) {
        console.log('ERROR: ' +JSON.stringify(err));
        return;
    }

    if (! users) console.log('Group: ' + groupName + ' not found.');
    else {
        console.log(JSON.stringify('Users: ',users));
    }
    });
  }
  else {
    console.log('Authentication failed!');
  }
});

如有任何想法,我们将不胜感激。

我使用了错误的域组件,所以库没问题,现在一切正常。