cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Get the total number of members of a group

TG_10272716
10-Marble

Get the total number of members of a group

Hello

 

I am trying to get the total number of members of a WTGroup in Windchill via code, so the sum of all users in a group and all its subgroups. Actually I need to check if the group size is bigger than a specified limit.

 

I tried to use .members() but it always fails with a PrincipalRepairFailedException error (Cannot process user because a related disconnected participant exists in the database). I have tried using OrganizationServicesHelper.members() or group.members() but it all leads to the same error.

 

Does anyone know how to solve this issue. I do not need to know the user names and attributes, I just need to find the total amount or if the member amount of a group is greater than a specified limit.

 

Best regards

ACCEPTED SOLUTION

Accepted Solutions

Hi @TG_10272716 

I do not know the API that can collect information with disconnected users. Iam sure that some exists but I never needed. 

 

generally if Active Directory is used it is very important to allow access to only windchill users by filtering a AD group

also the maintenance of active users is important

if someone who has access to WHC leave a company admin needs to care of the user in windchill. (disable, workflow check, checkout work and so on.)

 

So based on the best practice your trouble should not appear.

 

if you do not retract access from AD to just real windchill users that can be real problem with licensing. 

 

Just my opinion.

 

PetrH

View solution in original post

3 REPLIES 3

Hi @TG_10272716 

 

The issue is that the API tries to get information about users. 

If the user is disconnected you should repair the user. 

This is my advice keep all your used users connected. 

 

PetrH 

Hello @HelesicPetr

Thank you for your reply. Our problem however is that it is hardly possible to keep all users connected. And it would require a lot of work to fix all disconnected users and then its just a matter of time until it happens again.

 

Is there a more stable approach? Can you somehow tell the API to ignore disconnected users or do you know another API that can be used instead?

 

Best regards

Hi @TG_10272716 

I do not know the API that can collect information with disconnected users. Iam sure that some exists but I never needed. 

 

generally if Active Directory is used it is very important to allow access to only windchill users by filtering a AD group

also the maintenance of active users is important

if someone who has access to WHC leave a company admin needs to care of the user in windchill. (disable, workflow check, checkout work and so on.)

 

So based on the best practice your trouble should not appear.

 

if you do not retract access from AD to just real windchill users that can be real problem with licensing. 

 

Just my opinion.

 

PetrH

Announcements
Top Tags