I am trying to write a groovy script to returns all users and the groups they belong to
Below is a groovy to retrive userIDs. However, there is not function you can call to get groupids based on a user . There is however a function you can call to get Roles for the user but not groups.
import com.quest.nitro.service.security.auth.*;
def secSvc = server.get(SecurityService);
userList = secSvc.findAllUsers();
def userInfo = new StringBuilder();
def userID= ;
for(user in userList)
{
userID = $user.id;
userRole = secSvc.getCurrentRoles();
userInfo.append(userID + );
userInfo.append(userRole + \n);
}
return userInfo;
will return the user id and the assigned roles for that user
© 2021 Quest Software Inc. ALL RIGHTS RESERVED. Feedback Terms of Use Privacy