Quantcast
Channel: VMware Communities : All Content - vSphere Management SDK
Viewing all articles
Browse latest Browse all 1860

How to get Groups for a User?

$
0
0

Hi,

 

I need to retrieve User Groups that a user belongs to. I''ll use the groups to lookup the authorization rights for the user.

 

I'm trying the following:

 

     String domain = "MYDOMAIN";

     String searchStr = "";

     String belongsToGroup = null;

     String belongsToUser = "testuser";

     Boolean exactMatch = true;

     Boolean findUsers = false;

     Boolean findGroups = true;

 

     UserSearchResult[]  res = service.retrieveUserGroups(sic.getUserDirectory(),

          domain, searchStr, belongsToGroup, belongsToUser,

          exactMatch, findUsers, findGroups);

 

However, I'm getting the error:

 

AxisFault

faultCode: ServerFaultCode

faultSubcode:

faultString: The operation is not supported on the object.

faultActor:

faultNode:

faultDetail:

     NotSupportedFault:null

 

The retrieveUserGroups() works fine, unless I'm trying to specify the 'belongsToUser' variable.

 

When using MOB, I'm getting:

 

Method Invocation Result: NotSupported

 

 

Is using the retrieveUserGroups() function the correct way to get the user groups?

 

What is the reason for the error?


Viewing all articles
Browse latest Browse all 1860

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>