VMware Cloud Community
orian
Hot Shot
Hot Shot

Get All Users

Hi,

How can I get all disabled users from active directory with VMWare Orchestrator?

My Workflow get as an input AD:AdHost object.

I have multiple active directory connected to my Orchestrator.

Thanks!

0 Kudos
1 Reply
iiliev
VMware Employee
VMware Employee

Hi,

Try the following

var searchResult = host.getLdapClient().search(host.hostConfiguration.ldapBase,

  LdapSearchScope.SUB,

  LdapDereferencePolicy.ALWAYS,

  0, 0,

  "(&(objectClass=user)(useraccountcontrol:1.2.840.113556.1.4.803:=2))" );

var result = searchResult.getSearchEntries();

for (var e in result) {

  System.log(entries[e].getParsedDN().toNormalizedString());

}

It uses the generic LDAP client to execute a LDAP query that finds disabled users and then prints their DNs (LDAP query is taken from http://windowsitpro.com/windows/how-can-i-specify-only-users-are-enabled-ldap-query)

0 Kudos