#Meant for testing againts Group members withiin an OU are properly registered by the LDAP plugincoded below. # Not too much trouble to refactor : "Has groups/authorities: *** " to pertain to any valid ldap query strings. String[] names = ["a group name","a user name","a name that does not exist"]; for (name in names) { println("Checking the name '" + name + "'...") try { println(" It is a USER: " + Jenkins.instance.securityRealm.loadUserByUsername(name)) println(" Has groups/authorities: " + Jenkins.instance.securityRealm.loadUserByUsername(name).getAuthorities()) } catch (Exception e) { try { println(" It is a GROUP: " + Jenkins.instance.securityRealm.loadGroupByGroupname(name)) println("") continue } catch (Exception e1) { println(" It is NOT a group, reason: " + e1.getMessage()) } println(" It is NOT a user, reason: " + e.getMessage()) } println(""); }