Using powershell, how do I grant “Log on as service” to an account?

后端 未结 8 863
感情败类
感情败类 2020-12-15 17:40

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

8条回答
  •  执念已碎
    2020-12-15 18:19

    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.

提交回复
热议问题