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 it to 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 1, 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

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 it to 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 1, 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

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"
  • Custom field - cPVAL AD Health Repair Result