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
Dependencies
- CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute
- CWM - Automate - Script - PowerShell Response - All Errors - Check
Variables
Name | Description |
---|---|
ProjectName | Holds 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. |
WorkingDirectory | Holds 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. |
TableName | Holds the name of the table to be updated or created. |
JsonFileName | The name of the json file to create. Please reference CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute for more information. |
SQLStartStatement | The SQL start statement. Please reference CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute for more information. |
SQLTailString | The SQL tail string. Please reference CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute for more information. |
DataPointNames | The names of the data points in the created .json file. Please reference CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute for more information. |
psout | The return from the PowerShell script to gather the redirected folder data. |
Process
- Set up any static variables that are needed for any dependent scripts or current script steps.
- Create the table if necessary.
- Execute PowerShell
- Set up static variables (current user locations, local machine locations, classes).
- Cycle through the local machine settings, populating
myinfo
with class information. - Cycle through all current user locations, populating
myinfo
with class information. - Create a .json file.
- Check the return from the target for any common PowerShell issues by running the CWM - Automate - Script - PowerShell Response - All Errors - Check script.
- If the
finishstatus
variable is set to false, log an error and exit with an error. - Insert the data into the table using CWM - Automate - Script - OverFlowedVariable - SQL Insert - Execute.
- Log success and exit.
Output
- Script log