Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
arr_groups = new Array()
System.log(nameStartsWith)
System.log("Running active Directory Search")
var groups = ActiveDirectory.search("UserGroup", nameStartsWith)
var arr_ExceptionList = exceptionList.split(",")
for (var i in groups) {
if(arr_ExceptionList.indexOf(groups[i].name) == -1) {
arr_groups.push(groups[i].name)
}
}
return arr_groups
@mccbryan3
Copy link
Author

mccbryan3 commented Feb 19, 2020

vRO - Get AD Groups in and Array to present in a dropdown with Exceptions

Usage of this script as an action in vRo:

This is an action script in vRo that should have two inputs as string.

image

Usage of this action in vRa blureprint custom form:

This should be set as a action based field in vRa and configured as pictured below.

Two examples below showing no exceptions with the "none" as a place holder and the other with multiple groups seperated by comma with no spaces.

The nameStartsWith fieled is the beginning of your group name. The exceptionList is a string that will be split by the comma in the action script to create an array of group names.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment