Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting "Log on as a service" and "Allow logon locally" with ADSI

I am trying to create a powershell script to automate user creation which is working great using ADSI. However I need to set the following properties and I am not sure how (or if ADSI can even do this):

  • Log on as a service
  • Allow logon locally

Any ideas how to do this?

like image 217
Robert MacLean Avatar asked Jun 01 '09 09:06

Robert MacLean


1 Answers

The solution to working with GPO's in PowerShell is via a COM+ object called GPMgmt.GPM which is part of the Group Policy Management Console feature. The best article for information I could find on this is: http://technet.microsoft.com/en-us/magazine/cc162355.aspx

I have yet to be able to figure out how to set those specific values though.

like image 95
Robert MacLean Avatar answered Sep 28 '22 00:09

Robert MacLean