Administrator / Copy User

Document ID : KB000106830
Last Modified Date : 16/07/2018
Show Technical Document Details
Introduction:
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.
Background:
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.
Environment:
CA Harvest SCM all versions and platforms
 
Instructions:
You will need to take 2 steps to accomplish this. First is to get the list of user groups you need, and second is to assign those groups to the new userid. 

To generate the list of user groups, you will need to use SQL. Here is an example statement that would do the trick: 

SELECT DISTINCT HARUSERGROUP.USERGROUPNAME 
FROM HARUSER 
INNER JOIN HARUSERSINGROUP ON HARUSER.USROBJID = HARUSERSINGROUP.USROBJID 
INNER JOIN HARUSERGROUP ON HARUSERGROUP.USRGRPOBJID = HARUSERSINGROUP.USRGRPOBJID 
WHERE HARUSER.USERNAME = 'harvest' /* <--- The userid assigned to the list of groups you want goes here */ 

Once you have the list of user groups, you will need to use the "HUSRMGR" command line utility to assign the new user to the same list of groups. Here is where you can read about this command: 

https://docops.ca.com/ca-harvest-scm/13-0/en/command-reference/get-started-with-ca-harvest-scm-commands/husrmgr-command-user-manager 

This command lets you add new users as well as update existing users according to a data entry file you will construct.