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

The PTC Community email address has changed to community-mailer@ptc.com. Learn more.

extracting user from groups and the roles

extracting user from groups and the roles

We ar eunable to extract user by roles and groups. When checked with PTC, ptc said, there is no option available with PTC at the moment. This is very useful functionality.

10 Comments
ScottMorris
17-Peridot

Are you looking for a way to remove a user from all the groups they are members of and all the teams they are members of? That would be awesome.

  • You can see all the groups they are in from the Participant Manager, but removing them is manual
  • You can generate a report to find all the containers they are a member of and in what roles, but removing them is manual

Interested to hear if anyone has an automated way to doing either of these two functions.

vishwas2
3-Visitor

Hi Scott,

 

Thanks for response.

 

I am also curious to know generate a report to find all the containers they are a member of and in what roles. Is there a way? But PTC say its not possible. Here is the case number CS22167

tswett
12-Amethyst

We have run into the same issue here, we had to report on who we have in a custom group driving enabling functionality.  I had to go directly to WDS and copy the contents of the group out to a text field, but having the ability to export the table in the group like other tables would be great. Also with the upcoming 11.1 licensing group structure and needs to look into the groups there for licensing costs, this functionality would be heavily used.

d_graham
17-Peridot

Guys,

 

What you want is very doable.

To test this I wrote a Java script that will either:

1) List the Groups, Teams and Roles a specified user is in

or

2) Remove the specified user from the Groups, Teams and Roles.

 

I didn't get fancy so right now the script is run from a Windchill shell and results are displayed in the shell. Could certainly write results to a file too.

For example, java ext.util.ReportUserUsage joe.smith -remove

The -remove argument would trigger the script to remove the user.  If -remove is not entered the user's usage is simply reported.

 

This could also be setup to be run from the Windchill GUI rather than a Windchill shell.

 

Windchill shell output looks like this:

 

C:\ptc\Windchill_11.2\Windchill>java ext.tools.ReportUserUsage Administrator
*** 13 groups found that Administrator is in.


Group Name: PRODUCT MANAGER
Group's Container's name: GENERIC_COMPUTER
Container Class: wt.pdmlink.PDMLinkProduct

 

Group Name: 4051_ORG
Group's Container's name: GOLF_CART
Container Class: wt.pdmlink.PDMLinkProduct

 

Group Name: PRODUCT MANAGER
Group's Container's name: Test Product
Container Class: wt.pdmlink.PDMLinkProduct

 

Group Name: 4051_ORG
Group's Container's name: Test Product
Container Class: wt.pdmlink.PDMLinkProduct

 

Group Name: SHARED TEAM MANAGER
Group's Container's name: Organization 1
Container Class: wt.inf.container.OrgContainer

 

Group Name: 4051_ORG
Group's Container's name: Organization 1
Container Class: wt.inf.container.OrgContainer

 

Group Name: SHARED TEAM MANAGER
Group's Container's name: Organization 1
Container Class: wt.inf.container.OrgContainer

 

Group Name: 4051_ORG
Group's Container's name: Organization 1
Container Class: wt.inf.container.OrgContainer

 

Group Name: APPROVER
Group's Container's name: Test Product
Container Class: wt.pdmlink.PDMLinkProduct

 

Group Name: MEMBERS
Group's Container's name: Test Product
Container Class: wt.pdmlink.PDMLinkProduct

 

Group Name: PRODUCT MANAGER
Group's Container's name: GOLF_CART
Container Class: wt.pdmlink.PDMLinkProduct

 

Group Name: PRODUCT MANAGER
Group's Container's name: Drive System
Container Class: wt.pdmlink.PDMLinkProduct

 

Group Name: PRODUCT MANAGER
Group's Container's name: ProductView Demo
Container Class: wt.pdmlink.PDMLinkProduct


*** 2 roles found that Administrator is in.


Role: REVIEWER
RoleHolder: Test Design Team
RoleHolder Class: wt.team.TeamTemplate
RoldeHolder's Container's Name: Test Product
Container Class: wt.pdmlink.PDMLinkProduct

 

Role: ENGINEER
RoleHolder: Test Design Team
RoleHolder Class: wt.team.TeamTemplate
RoldeHolder's Container's Name: Test Product
Container Class: wt.pdmlink.PDMLinkProduct

 

C:\ptc\Windchill_11.2\Windchill>

 

tswett
12-Amethyst

@d_graham - We can have our developers do something like this, no problem, but the situation is that almost all tables in WC you can export the contents.. The one used for administrators that would may need to report on said groups, would have to develop a tool to do it.  The code and the actions are there, just not setup for that table.

d_graham
17-Peridot

If you want to view the Groups, Roles, Teams and the associated username this can be done using QueryBuilder which includes the ability to export list to file.

 

Is that what you're looking for?

 

David_Graham_0-1587219474882.png   

David_Graham_0-1587223286465.png

 

 

oulyanin
6-Contributor

If information you want is users-group relations at Organisation/Site level then you really can't get it from QueryBuilder because it stored in WindchillDS and not in DB. 

@d_graham - it's sad bud QueryBuilder can't list groups/users relations created at Org/Site level.

That would be a very useful feature.

Marco_Tosin
20-Turquoise

As I wrote several times in the community, at the moment the only way to have the correspondence between users and groups to which they belong is to use Java methods.

The mode is explained in one of the various links in this document

https://community.ptc.com/t5/Windchill-Tips/Resource-for-reporting/td-p/448738

I have used it for several years and it works very well, just organize the correct membership of users to the various groups, which in turn are included in the roles to regulate access.

When a new user arrives in the company, I ask from which user the ACLs must be copied then, through a report built using the Java method, I check in which groups the user is present as a reference for the new one, which I insert in the same groups.

However, I seem to have read that, from version 12, Windchill DS will be abandoned and all its data will be inserted in the Windchill DB, so the problems should finally be solved.

d_graham
17-Peridot

@oulyanin you are correct re: the OOTB tables and columns, however, it is possible to do it using "Java method" option in QueryBuilder.

I wrote a method that simple gets all groups and then loops through to see if the user in question is a member.  If yes, than add the group's name to a String and return the String.

Results look like this for user Administrator:

Note: I included the group's container name.

d_graham_0-1591387098607.png

 

 

GauravAmrutkar
17-Peridot

If you are looking for exporting Group Membership Hierarchy, then starting Windchill 11.1 M020

  • The Export List to CSV action has been added to the Members table on group information page using which you can export group members table to CSV file with membership hierarchy.
  • For more details, refer Export Group Membership Hierarchy topic from WHC

I have also updated this idea link to an article for reference

Hope this is helpful

 

Thanks

Gaurav