Author |
Message |
bhandari8677
Joined: 27 Jan 2010 Posts: 8 Country: United States |
|
Logon Error While Running A .bat Script Using 24X7 |
|
I created a job in 24X7 that will execute a .bat script and I am using Run As Another User which I have filled in a service account that has administrative rights on the server. I am receiving the error: Exit code: -1. Logon failed. Return code: 1385 - Logon failure: the user has not been granted the requested logon type at this computer. Not sure what additional right I need to grant the service account since it is already in the Administrator group?
|
|
Mon Feb 01, 2010 3:46 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
Hi,
It is a common mistake to assume that the Administrator account has all possible privileges by default. It does not.
In order to be able to run processes as another user, it needs the following:
Act as part of the operation system
Create process token
Modify process token
|
|
Mon Feb 01, 2010 4:55 pm |
|
 |
bhandari8677
Joined: 27 Jan 2010 Posts: 8 Country: United States |
|
|
|
The first line of the .bat script that I am having trouble using 24x7 to execute deletes a file on another Windows 2003 server from a network shared folder which has been setup. I am using the run as a service account option in my 24x7 job properties and the service account has rights to the network share on the other server, what additional permission/rights must the service account have on both Windows servers for this to work? I keep getting the Return code:1385 - Logon failure: the user has not been granted the requested logon type at this computer.
Should all we need to do is grant the service account the rights you mentioned below on both servers (the 24x7 server and the server with the shared folder)?
In order to be able to run processes as another user, it needs the following:
Act as part of the operation system
Create process token
Modify process token
|
|
Tue Feb 02, 2010 10:22 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
Only on the server running the service.
By the way, please ensure the remote files in your batch file are referenced using UNC names. No drive mappings please. Existing mappings are not available to services.
|
|
Tue Feb 02, 2010 10:27 am |
|
 |
bhandari8677
Joined: 27 Jan 2010 Posts: 8 Country: United States |
|
|
|
I can login to the 24x7 Windows server as the service account and open the 24x7 console after shutting down the service and cleanly perform a run now on the job that executes the .bat script I am having trouble with, however this only works if I have the job properties set to run as current user. But when I try using run as the exact same service account that I am logged in as and click run now it fails with the 1385 error.
|
|
Tue Feb 02, 2010 11:12 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
Please verify the account used to run the job has "logon as a batch job privilege".
If you have already changed the privileges, please don't forget to restart the system in order for the privileges to take effect.
|
|
Tue Feb 02, 2010 11:51 am |
|
 |
bhandari8677
Joined: 27 Jan 2010 Posts: 8 Country: United States |
|
|
|
The service account was missing "logon as a batch job privilege" and now everything is working as expected. Thanks for your help.
|
|
Tue Feb 02, 2010 12:16 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
Good news Thank you.
Just in case, this privileges is needed for the user account running the job. So if your service account is A and job user is B, you should grant this privilege to B. All the admin privileges go to A.
|
|
Tue Feb 02, 2010 2:16 pm |
|
 |
|