SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Logon Error While Running A .bat Script Using 24X7

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Logon Error While Running A .bat Script Using 24X7
Author Message
bhandari8677



Joined: 27 Jan 2010
Posts: 8
Country: United States

Post Logon Error While Running A .bat Script Using 24X7 Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
bhandari8677



Joined: 27 Jan 2010
Posts: 8
Country: United States

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
bhandari8677



Joined: 27 Jan 2010
Posts: 8
Country: United States

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
bhandari8677



Joined: 27 Jan 2010
Posts: 8
Country: United States

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.