I am using ldapjs and explore complete library and could not be able to find how to create OU. Kindly share with example and code explanation.
Asked
Active
Viewed 53 times
1 Answers
0
Resolve my query by the following code
async createOU(oRequest) {
const ouName = oRequest.ouName
let DN = 'ou=' + ouName + ',' + this.dc;
let entry = {
objectclass: ADConstant.AD_PARAMS.OU_GROUP,
};
return new Promise(async (resolve, reject) => {
this.ADConnnection.add(DN, entry, (err, res) => {
if (err) {
reject(err);
} else {
resolve(true);
}
});
await this.closeConnection()
});
};
for reference follow the link: https://github.com/ldapjs/node-ldapjs/issues/827

Muhammad Umar Khan
- 11
- 9