How to search Active Directory using vRealize Orchestrator

Variable adHost is set to the AD:adHost you want to search

Or use “Server.findAllForType(“AD:AdHost”)” and use a loop to search each domain.

Search for Computer Name

vmName = “NST-CORE-01”;
adComputers = ActiveDirectory.search(“ComputerAD”,vmName,adHost);
System.log(adComputers.length);

Search for Organizational Unit

ouName = “Finance”;
adOUs = ActiveDirectory.search(“Organizational Unit”,
ouName, adHost);
System.log(adOUs.length);

Search for User

user = “bmacinnes”;
adUsers = ActiveDirectory.search(“User”,user,adHost);
System.log(adUsers.length);


Posted

in

by

Tags:

Comments

2 responses to “How to search Active Directory using vRealize Orchestrator”

  1. Nathan M Avatar
    Nathan M

    Was having difficulty with the OU logic when I figured that Organizational Unit was actually one word for the code. When I merged it together to be OrganizationalUnit, the logic worked for me.

  2. Chris Avatar
    Chris

    Allready had an headache to get all users that match a specific string. Thanks to you i finally got a step further on my project.

    Only “bad” stuff, if i copy&paste your code, vRO can not use the quotes from the website. Needed to replace that. (May someone else can use this as a hint)

    Have a amazing day.

    Chris

Leave a Reply

Your email address will not be published. Required fields are marked *