Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking to make a user from the command line with minimal rights to run a service. cmd.exe or powershell.exe are both options, but cmd.exe is preferable. So far I got this:

net user /add testUser227e5910-d1ac-11df-bd3b-0800200c9a66
net localgroup Users testUser /delete

The next step is to grant this user the right of "Log On As a Service". I can't seem to figure out how to do this. This is for a blog article, so I want a solution that applies to Windows XP, 2003, 2008, 2008R2, Vista and Windows 7.

share|improve this question
Maybe possible using those commands in remote computer ? – Kiquenet Oct 16 '14 at 21:22

You need to install ntrights from the Windows resource kit :

ntright +r SeServiceLogonRight -u testUser

share|improve this answer
I'd prefer something that was built in, but if no one provides a better answer I'll mark that right. – Justin Dearing Oct 7 '10 at 13:33
There is nothing built in - if there was Microsoft wouldn't provide this in the resource kit ;-) – Geraint Jones Oct 7 '10 at 21:47
Ok I can't install that on windows 2008 or Windows 7. What do I do there? – Justin Dearing Oct 9 '10 at 2:58
You can use the 2003 version :… – Geraint Jones Oct 9 '10 at 3:15
I'm about to write my own command line utility to do this. Either that or I'll just implement this feature request in mongod, the program that lead me down this rabbit hole. – Justin Dearing Oct 9 '10 at 11:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.