When creating a new user that will be replacing or joining an existing user and the existing user is a member of multiple ( 100+) user groups, it would be beneficial to be able to create a user based on another user's access.
To use the Administrator Tool to accomplish this would be time consuming and error-prone. It would help to have a more efficient way to accomplish this task.
CA Harvest SCM all versions and platforms
The Harvest Administrator Tool does not include a "right-click" option that creates a new user using an existing user as a template. However, this can be done using the Harvest command line utilites.
SELECT DISTINCT 'testuser2' AS USR, /* <--- The new user's userid */The important point about the above query is that you will want to change "testuser2" to the new user's userid on the first line of the query, and change "testuser1" to the previously existing userid whose groups you want to copy on the next to last line of the query.
'' AS PWD,
'' AS FULLNAME,
'' AS PHONE,
'' AS EXT,
'' AS FAX,
'' AS EADDR,
'' AS USRNOTE,
HARUSERGROUP.USERGROUPNAME
FROM HARUSER
INNER JOIN HARUSERSINGROUP ON HARUSER.USROBJID = HARUSERSINGROUP.USROBJID
INNER JOIN HARUSERGROUP ON HARUSERGROUP.USRGRPOBJID = HARUSERSINGROUP.USRGRPOBJID
WHERE HARUSER.USERNAME = 'testuser1' /* <--- The userid assigned to the list of groups you want goes here */
AND HARUSERGROUP.USERGROUPNAME != 'Public' /* all users belong to the Public group. No need to include it in the result */
hsql -b <your brokername> -usr <your userid> -pw <your password> -t -nh -f <filename of the above query> > <output filename>
hsql -b example-broker -usr harvest -pw ******* -t -nh -f getgroups.sql > getgroups.out
husrmgr -b <your broker name> -usr <your userid> -pw <your password> -ow getgroups.out
husrmgr -b example-broker -usr harvest -pw ******* -ow getgroups.out
After executing the above steps, checking the new user's properties in the Administrator Tool, the new groups will be found. For example: