Flow/Scripting/LDAPAccess

From Observer GigaFlow Support | VIAVI Solutions Inc.
Revision as of 11:26, 23 January 2017 by Kevin Wilkie (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

//Querying LDAP.

//Query for distinguishedName and displayName attributes for objects of objectClass=user
var results = actions.getLDAP("distinguishedName,displayName","(&(objectClass=user))")
if (results!=null){
    for (var i=0;i<results.size();i++){
        var attributes = results.get(i);
        if (attributes){
            var attributeDistinguishedName =attributes.get('distinguishedName');
            var attributeDisplayName =attributes.get('displayName');
            if (attributeDistinguishedName ){
            log.warn(attributeDistinguishedName.getID()+' '+attributeDistinguishedName.get());
            }
            if (attributeDisplayName ){
                log.warn(attributeDisplayName.getID()+' '+attributeDisplayName.get());
            }
        }
    }
}else{
    log.warn("No results");
}