Hi,
I'm using Orchestrator to get a user from a container.
But I don't know in which subcontainer (or sub-subcontainer) the user is in.
I have this line that returns the user when you are in the correct container:
var ad_user = System.getModule("com.vmware.library.microsoft.activeDirectory").getUserFromContainer(container,username) ;
But I want the code to search through all subcontainers as well.
Can anybody help me?
Kind regards,
Jonathan
Try the nifty search on the ActiveDirectory object. You can also use it to search "ComputerAD", "UserGroup", "Group", and "OrganizationalUnit".
adObjectArray = ActiveDirectory.search("User",queryString);
Try the nifty search on the ActiveDirectory object. You can also use it to search "ComputerAD", "UserGroup", "Group", and "OrganizationalUnit".
adObjectArray = ActiveDirectory.search("User",queryString);
That's it!
Sometimes things can be easy
Thanks for the help!
And for even better results, use the newer .searchExactMatch method The sample below assumes that there is an input named "userName" of type string that is to be searched for. This helps differentiate between: jdoe and jdoe2
var users = ActiveDirectory.searchExactMatch("User" , userName,1);
if (users != null) var user = users[0];