tags:

views:

1513

answers:

2

I'm trying to use powershell to configure the account credentials, but I need to grant the account "Log on as a service" right in order for it to work. How can I do this in powershell?

A: 

PowerShell doesn't have any native means of doing this, which means you'd probably be looking at either WMI or ADSI - you're more likely to find examples in VBScript, which has been around longer, although personally I don't think I've ever figured out how to programmatically assign user rights. Doesn't mean it can't be done, though, but you'll probably be looking outside the realm of PowerShell specifically.

Don Jones
+1  A: 

Here's a link that you could also do within PSH. http://www.derkeiler.com/Newsgroups/microsoft.public.windowsxp.security_admin/2003-12/2865.html.

The problem is that there aren't really any public APIs for managing these settings, so you're a bit stuck using command-line tools provided in ResKits.

Don Jones
Thank you. I ended up using ntrights to do this.ntrights.exe +r SeServiceLogonRight -u <username/groupname>http://support.microsoft.com/?kbid=279664
Jesse Weigert