Skip to content

The Parse-Secpol script is a PowerShell tool tailored to extract and analyze local Security Policy (secpol) settings, offering a comprehensive view of a system's security configurations. This script performs a two-fold function: first, exporting secpol settings to a temporary file, and second, parsing the contents to produce a custom object.

Notifications You must be signed in to change notification settings

ItamarSafri/Parse-Secpol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Parse-Secpol

Overview

The Parse-Secpol PowerShell script is designed to export and parse local Security Policy (secpol) settings, providing valuable insights into the security configurations of a system. This script exports the secpol settings to a temporary file, parses the contents, and outputs the results as a custom object. Additionally, it allows for exporting the parsed data to a CSV file for further analysis.

Usage

Parse-Secpol -Path "C:\temp" -ExportPath "C:\Reports"

  • Path: Specifies the temporary path for the secpol export. Default is "C:\temp".
  • ExportPath: Specifies the export path for a CSV report. It must be a valid existing folder. If not specified, the script only parses the secpol settings without exporting to CSV.

Important Note

To run this script successfully, ensure that you have local admin privileges.

How It Works

  1. Exports the secpol settings to a temporary file (secpol.cfg).
  2. Parses the contents of the secpol file.
  3. Creates a custom object to store the parsed data.
  4. Iterates through the parsed data and populates the custom object.
  5. Optionally exports the parsed data to a CSV file if the export path is specified.
  6. Cleans up the temporary secpol file.

Examples

  • Parse secpol settings and export to CSV:

Parse-Secpol -Path "D:\Temp" -ExportPath "D:\Reports"

  • Parse secpol settings without CSV:

Parse-Secpol -Path "D:\Temp"

About

The Parse-Secpol script is a PowerShell tool tailored to extract and analyze local Security Policy (secpol) settings, offering a comprehensive view of a system's security configurations. This script performs a two-fold function: first, exporting secpol settings to a temporary file, and second, parsing the contents to produce a custom object.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published