Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mccbryan3/a36e74bb7be67090b39f46e35111108e to your computer and use it in GitHub Desktop.
Save mccbryan3/a36e74bb7be67090b39f46e35111108e to your computer and use it in GitHub Desktop.
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