

C-LANG Statements › USER Statement—Specify a User ID
USER Statement—Specify a User ID
The USER statement specifies the user ID the agent job runs under.
Supported Job Types
This statement is required for the following job types:
This statement is optional for the following job types:
Syntax
This statement has the following format for HP Integrity NonStop jobs:
USER group.user_ID
This statement has the following format for Windows and File Trigger jobs that monitor or access files on remote Windows systems:
USER domain\user_ID
This statement has the following format for all other job types that it applies to:
USER user_ID
- group
-
Specifies the group that the user ID is in.
Limits: Maximum of 8 characters, case-sensitive; cannot contain delimiters (such as spaces)
- domain
-
Specifies the domain that the user ID is in.
- user_ID
-
Specifies the user ID to use when running the job.
Limits for HP Integrity NonStop jobs: Maximum of 8 characters, case-sensitive; cannot contain delimiters (such as spaces).
Limits for i5/OS jobs: Maximum of 10 characters, case-sensitive; cannot contain delimiters (such as spaces).
Limits for all other job types that USER applies to: Up to 128 characters; case-sensitive; cannot contain delimiters (such as spaces).
Notes:
- The USER statement overrides the default user ID defined on the scheduling manager.
- If you do not specify the USER statement and a default user ID is defined on the scheduling manager, the agent runs the job under the default user ID. If a default user ID is not defined on the scheduling manager, the agent runs the job under the default user ID defined on the agent. If a default user ID is not defined on the agent, the agent runs the job under the user ID that is running the agent.
- Each user ID requires a corresponding password. The password is encrypted and stored separately from the user ID. For more information on defining passwords and other security requirements, refer to your scheduling manager's documentation.
UNIX Jobs:
- The USER statement is required when running a binary file with the CMDNAME statement. The USER statement is optional with the SCRIPTNAME statement.
- If you use the agent security file to restrict the running of jobs to specific users, use the USER statement to define the user IDs you want the jobs to run under.
- If you run the agent as root and specify the USER statement, the agent can run the command or script with the user's environment and permissions. The environment is passed unchanged, as if the agent logged in as the specified user.
- If you run the agent as root, by default the parameter oscomponent.initialworking directory is set to the agent directory. To run a script or command, grant OTHER execution permission for the agent directory and the root home directory. Otherwise, you will get error message indicating that permission is denied.
Windows Jobs:
- To run Windows jobs under different user IDs, the agent must run as a Windows service under the local system account. For more information about configuring the agent to run as a Windows service, see the CA Workload Automation Agent for UNIX, Linux, or Windows Implementation Guide.
- To run a job under a Windows user ID and password, you must define user ID and password pairs on the scheduling manager.
i5/OS Jobs:
- To use the USER statement, the agent must run under a profile that has *USE authority to the profile in the USER statement.
- If you specify the USER statement and no libraries have been specified with the LIBL statement, the agent defaults to using the default library list in the job's job description. However, you can specify that the job use the user's job description instead.
Database Trigger Jobs:
- The user that a Database Trigger job runs under must be authorized to create triggers on the database or schema the table belongs to.
- For Microsoft SQL Server, the user that a Database Trigger job runs under must own the database table identified by the TABLE_NAME statement.
Example: Specify a User ID in a Windows Job
This example runs sort.exe on the NT401 system under the user1 user ID:
AGENT NT401
USER user1
CMDNAME c:\payroll\sort.exe
Example: Specify a User ID on a Remote Windows Computer
This example runs calc.exe on the CYBNT server. CYBUSER is a user ID in the CYBDOM domain. CYBUSER is defined on the scheduling manager and has access permission to the public folder.
AGENT NT30
CMDNAME \\CYBNT\public\calc.exe
USER CYBDOM\CYBUSER
Example: Specify a User ID in a UNIX Job
This example runs the test1.ksh script on the UNIX_LA system under the user1 user ID:
AGENT UNIX_LA
SCIPTNAME /mfg/test1.ksh
USER user1
Example: Specify a User ID in an i5/OS Job
This example runs the MFGPROG program on the AS401 system under the user1 user ID:
AGENT AS401
CLPNAME MFGPROG
USER user1
Example: Specify a User ID in an HP Integrity NonStop Job
This example runs a command on an HP Integrity NonStop system under user ID "glsys", which is part of the "prod" group:
AGENT PROAGENT
COMMAND $C35.PROD.GETDEF
USER prod.glsys
Copyright © 2013 CA Technologies.
All rights reserved.
 
|
|