In Powershell, how to retrieve existing policy settings (Win8.1/server 2012 r2 core)

2.3k views Asked by At

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!

1

There are 1 answers

3
briantist On

Boe Prox has written a module for this called PoshPrivilege.

Using this module, you would use the following:

Get-Privilege -Privilege SeServiceLogonRight