2

Is it possible in Powershell (using Get-WmiObject or similar) to retrieve existing policy setting on local, single win 8.1 or server 2012 R2 core machine?

In SecPol the policy I want to retrieve the setting for is "Local Policies" -> "User Rights Assignment" -> "Log on as a service"

I already know I can use secedit /export to dump the data into a config file, was wondering if there was a more direct way such as Get-WmiObject that would just return the object and property in question to stdout.

thanks!

lockarm
  • 21
  • 2

1 Answers1

0

Boe Prox has written a module for this called PoshPrivilege.

Using this module, you would use the following:

Get-Privilege -Privilege SeServiceLogonRight
briantist
  • 45,546
  • 6
  • 82
  • 127
  • Thx for answering! Is it possible to perform that w/o the installation of any additional modules and such? – lockarm Jun 03 '15 at 20:46
  • Well, you could look at [the source code for the module](https://github.com/proxb/PoshPrivilege) to see how he did it, but I suspect you're not going to want to go through all that. To my knowledge there is no existing direct cmdlet. If there are WMI calls, I am not aware of them. – briantist Jun 03 '15 at 20:49
  • Thank you for your answer in any case! I ended up just grepping for the string I wanted to check from the .cfg file I exported using secedit. – lockarm Jun 05 '15 at 00:15