Enthusiast
Enthusiast

Retrieving vRA users

We have over 300 groups and a lot more users mapped to vRA. I am trying to get the groups and the users in those groups.

var groups = authGroupService.getGroups("myTenant");

for each (var item in groups){

    var conditions = [];

        conditions[0] = vCACCAFEFilterParam.equal("tenantName", vCACCAFEFilterParam.string('myTenant'));

        conditions[1] = vCACCAFEFilterParam.startsWith("group", item);

    var filter = [];

        filter[0] = vCACCAFEFilterParam.and(conditions);

    var query = vCACCAFEOdataQuery.query().addFilter(filter);

        query.setTop(PAGE_LIMIT);

        query.setSkip(0);

    var odataRequest = new vCACCAFEPageOdataRequest(query);

   

    System.log("========= Group Name ========   " + item.getName() );

    members = authGroupService.getUsersInGroup( odataRequest,item )

    for each (var user in members){

        System.log(item.getName() + "::" + user.getName() + "::" + user.getPrincipalId().getName()+"@"+user.getPrincipalId().getDomain());

    }

};

I get the error 403.

it works fine without the pagination but I do not get all the groups and the users. I am pretty sure my query is incorrect. Any help is appreciated. Thanks

0 Kudos
0 Replies