Grant user Logon as a service right

G

Guest

How do I grant a local user the "logon as a service" right programmatically? I have an unattended install of MSDE and am trying to configure the SqlAgent service to run under a different account than LocalSystem... I create a user during the install and re-configure the SqlAgent service to use the new user, but the logon fails because the user doesn't have the Log on as a service right.
 
M

Marina Roos

Have a look at the local securitypolicy. Drill down to user rights. There
you can add this user to the logon as service.

Marina

Jim said:
How do I grant a local user the "logon as a service" right
programmatically? I have an unattended install of MSDE and am trying to
configure the SqlAgent service to run under a different account than
LocalSystem... I create a user during the install and re-configure the
SqlAgent service to use the new user, but the logon fails because the user
doesn't have the Log on as a service right.
 
G

Guest

I understand how to do it via the local security policy and the snap-in... I'm really trying to do it programmatically as part of my install so end users don't need to perform the task manually. I've read something about templates, but really have no idea how to create one. Is there any good documentation on this and can I import only the specific entries I want, or do I have to import an entire policy?
 
S

Steven L Umbach

You can create a new/custom template that has only one entry such as it sounds you
need. This can be done with the mmc security templates snapin. Security templates are
incremental. You could then use the secedit command to implement the template in a
script. --- Steve

http://www.brienposey.com/kb/working_with_windows_2000_security_templates,_part_1.asp


Jim said:
I understand how to do it via the local security policy and the snap-in... I'm
really trying to do it programmatically as part of my install so end users don't need
to perform the task manually. I've read something about templates, but really have
no idea how to create one. Is there any good documentation on this and can I import
only the specific entries I want, or do I have to import an entire policy?
 
B

Bobby McMillan [MSFT]

Take a look at this. It may prove helpful.


279664 How to Set Logon User Rights with the Ntrights.exe Utility
http://support.microsoft.com/?id=279664



--------------------
From: =?Utf-8?B?Smlt?= <[email protected]>
References: <[email protected]>
Subject: Re: Grant user Logon as a service right
Date: Sun, 30 Nov 2003 13:36:05 -0800
I understand how to do it via the local security policy and the
snap-in... I'm really trying to do it programmatically as part of my
install so end users don't need to perform the task manually. I've read
something about templates, but really have no idea how to create one. Is
there any good documentation on this and can I import only the specific
entries I want, or do I have to import an entire policy?
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top