Skip to main content

Audit - GPO Redirection Settings

Summary

This script will audit the registry settings associated with any group policy redirection settings, populating Custom Table - plugin_proval_gpo_redirection_audit with the returned data.

Sample Run

Sample Run

Dependencies

Variables

NameDescription
ProjectNameHolds a project name and is used when creating a .json file for any potential overflowed variable.
WorkingDirectoryHolds a working directory to be combined with the project name as the directory to save the .json file.
TableNameHolds the name of the table to be updated or created.
JsonFileNameThe name of the json file to create.
SQLStartStatementThe SQL start statement.
SQLTailStringThe SQL tail string.
DataPointNamesThe names of the data points in the created .json file.
psoutThe return from the PowerShell script to gather the redirected folder data.

Process

  1. Set up any static variables that are needed for any dependent scripts or current script steps.
  2. Create the table if necessary.
  3. Execute PowerShell
    1. Set up static variables (current user locations, local machine locations, classes).
    2. Cycle through the local machine settings, populating myinfo with class information.
    3. Cycle through all current user locations, populating myinfo with class information.
    4. Create a .json file.
  4. Check the return from the target for any common PowerShell issues by running the Script - PowerShell Response - All Errors - Check script.
  5. If the finishstatus variable is set to false, log an error and exit with an error.
  6. Insert the data into the table using Script - OverFlowedVariable - SQL Insert - Execute.
  7. Log success and exit.

Output

  • Script log