Skip to main content

Audit - GPO Redirection Settings

Summary

This script will audit the registry settings associated with any group policy redirection settings, populating EPM - Data Collection - 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. Please reference CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute for more information.
WorkingDirectoryHolds a working directory to be combined with the project name as the directory to save the .json file. Please reference CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute for more information.
TableNameHolds the name of the table to be updated or created.
JsonFileNameThe name of the json file to create. Please reference CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute for more information.
SQLStartStatementThe SQL start statement. Please reference CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute for more information.
SQLTailStringThe SQL tail string. Please reference CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute for more information.
DataPointNamesThe names of the data points in the created .json file. Please reference CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute for more information.
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 CWM - Automate - 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 CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute.
  7. Log success and exit.

Output

  • Script log