VMware Cloud Community
UofS
Enthusiast
Enthusiast

ActiveDirectory.searchrecursively() Type error

I am trying to just search my AD from the root recursively to return a user object.

I have a global workflow var of type AD:ActiveDirectory set to be the root of my AD but I still get an error.

I have found this article:

http://communities.vmware.com/thread/343539

but all I get when using this idea is:

TypeError: Cannot find function searchRecursively in object DynamicWrapper (Instance) : [AD_OrganizationalUnit]-[class ch.dunes.ad.object.OU] -- VALUE : OU:DC=domainname,DC=ca. (Workflow:AMQP ImportLDAPUser PolicyWF / Set AD Group and User (item3)#35)

Am I not doing this correctly?

Dion

0 Kudos
1 Reply
UofS
Enthusiast
Enthusiast

It seems the search() function was what I needed as it seems to recursively search OUs and Groups:

var ADusers = ad.search('User', user.name);

for(var i in ADusers){

    System.log("ImportUser: comparing user: " + ADusers[i].accountName + "=" + user.name);

    if(ADusers[i].accountName == user.name ){

        System.log("ImportUser: selected user=" + ADusers[i].accountName);

        userToAdd.push(ADusers[i]);

    }

}

0 Kudos