Skip to main content

Test AD Health and Repair

Overview

This script automates health checks, self-healing, and conditional service restarts for Active Directory Domain Controllers. It helps administrators quickly identify and remediate AD issues, ensuring domain controller reliability and service continuity.

Sample Run

Play Button > Run Automation > Script
SampleRun1

Search and select Test Ad Health and Repair SampleRun2

Set the required arguments and click the Run button to run the script.
Run As: System
Preset Parameter: <Leave it Blank>
SelfHeal: Initiates self-healing actions if AD issues are detected.Leave it blank to disable self-healing for the AD health issue fix, or set any value, such as 1, to enable the self-healing feature.
RestartAllADService: Restarts all core AD-related services if issues are detected and SelfHeal is enabled.Leave it blank for no action, or set it to any value to allow all AD services to restart. Note: The SelfHeal parameter must be enabled for this feature to operate.
ServicesToRestart: Specify one or more AD-related services to restart if issues are detected and SelfHeal is enabled. Ex: DNS, Netlogon. Note: The SelfHeal parameter must be enabled for this feature to operate.

SampleRun3

Run Automation: Yes
RunAutomation

Dependencies

Agnostic - Test-ADHealthAndRepair

Parameters

NameRequiredAccepted ValuesDefaultTypeDescription
SelfHealFalse1String/TextInitiates self-healing actions if AD issues are detected.Leave it blank to disable self-healing for the AD health issue fix, or set any value, such as 1, to enable the self-healing feature.
RestartAllADServiceFalse1String/TextRestarts all core AD-related services if issues are detected and SelfHeal is enabled.Leave it blank for no action, or set it to any value to allow all AD services to restart. Note: The SelfHeal parameter must be enabled for this feature to operate.
ServicesToRestartFalseDNS, NetlogonString/TextSpecify one or more AD-related services to restart if issues are detected and SelfHeal is enabled. Ex: DNS, Netlogon. Note: The SelfHeal parameter must be enabled for this feature to operate.

Automation Setup/Import

Step 1

Navigate to Administration > Library > Automation
Step1

Step 2

Locate the Add button on the right-hand side of the screen, click on it and click the New Script button.
Step2

The scripting window will open.
ScriptingScreen

Step 3

Configure the Create Script section as follows:

Name: Test AD Health and Repair
Description: This script automates health checks, self-healing, and conditional service restarts for Active Directory Domain Controllers. It helps administrators quickly identify and remedy AD issues, ensuring domain controller reliability and service continuity.
Categories: ProVal
Language: PowerShell
Operating System: Windows
Architecture: All
Run As: System
Script

PowerShell And Variables

Test-AdHealthAndRepair

Saving the Automation

Click the Save button in the top-right corner of the screen to save your automation.
SaveButton

You will be prompted to enter your MFA code. Provide the code and press the Continue button to finalize the process.
MFA

Output

  • Activity Details
  • Refer to the logs: "C:\ProgramData_automation\Script\Test-ADHealthAndRepair\Test-ADHealthAndRepair-log.txt"
  • Refer to the error logs: "C:\ProgramData_automation\Script\Test-ADHealthAndRepair\Test-ADHealthAndRepair-error.txt"