-1

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.

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.