Hi Guys,
Having a head scratching moment using the AD plugin and the search method of the ActiveDirectory object in orchestrator.
In my environment it is highly possible that there will be Organizational Units with the same name located in different parts of the domain tree.. So to search and get an accurate object you would need to search by something unique, like the DN. However it only appears that you can search for an OU by name, which returns an array of objects.
One way to mitigate this would be to have ouName and ouDistinguishedName as inputs to the workflow.. but this seems silly.
Is there a way to search AD by DN to return a specific object or will I have to impliment logic to match the output of var adSearch = ActiveDirectory.search("OrganizationalUnit",ouName); to an input string that contains the DN?
Hope someone can shed some light
Cheers
Here you go: Add Computer to OU by String / getOUByName
Seems a frequent request lately so I've shared it to the community
Hi,
Like you I was hoping the ability existed to query by DN, but does not appear to be the case. To avoid any potential complications with a similar issue, I did a query on the name and returned a set/array of objects. From there, I looped through each to compare DN from the AD returned object to verify I had the correct one and then broke out of the loop and moved on. Pretty simple but not the most efficient.
If you need some sample code I can did something up.
Cheers
Here you go: Add Computer to OU by String / getOUByName
Seems a frequent request lately so I've shared it to the community
Thanks to you both for your replies!
Burke- I'll be testing out your action tomorrow AM! Thanks.