CHKDSK All Drives - NinjaOne
Purpose
This solution automates CHKDSK checks across fixed drives on Windows devices managed through NinjaOne. It uses an automation script, custom fields, and compound conditions to control execution on eligible Windows servers and workstations.
The cPVAL ChkDsk Deployment custom field controls deployment eligibility, while the cPVAL ChkDsk Autofix custom field determines whether the script should attempt to schedule repairs when disk issues are detected.
Associated Content
Compound Conditions
| Content | Type | Function |
|---|---|---|
| ChkDsk - All Drives - Servers | Compound Condition | Targets eligible Windows servers for automated CHKDSK execution. |
| ChkDsk - All Drives - Workstations | Compound Condition | Targets eligible Windows workstations for automated CHKDSK execution. |
Automation
| Content | Type | Function |
|---|---|---|
| CHKDSK - Run All Drives | Script | Checks all fixed drives and initiates repair scheduling when issues are detected and autofix is enabled. |
Custom Fields
| Content | Type | Function |
|---|---|---|
| cPVAL ChkDsk Autofix | Custom Field | Controls whether the script attempts to schedule CHKDSK repairs when disk issues are detected. |
| cPVAL ChkDsk Deployment | Custom Field | Controls deployment eligibility according to the configured settings. |
Implementation
Step 1: Create the Custom Fields
Create the following custom fields in NinjaOne:
Configure the custom fields according to the intended deployment and repair behavior.
Step 2: Import the Automation Script
Import the following automation script into NinjaOne:
Ensure that the script is configured to use the required custom fields.
Step 3: Configure the Compound Conditions
Create and configure the appropriate compound conditions:
Verify that the compound conditions use the intended custom field criteria and target only eligible Windows devices.
Step 4: Validate the Configuration
Before deploying the solution broadly:
- Verify that both custom fields are configured correctly.
- Confirm that the server and workstation compound conditions target the intended devices.
- Test the automation script on a suitable device.
- Confirm that the script reports detected disk issues and follows the configured autofix setting.
FAQ
Q: What is the purpose of this solution?
A: It automates CHKDSK checks across fixed drives on eligible Windows servers and workstations managed through NinjaOne.
Q: Which devices are targeted by the automation?
A: The solution uses separate compound conditions for Windows servers and workstations. Only devices that meet the configured criteria are targeted.
Q: What is the purpose of the cPVAL ChkDsk Deployment custom field?
A: It controls deployment eligibility according to the configured settings and compound condition criteria.
Q: What is the purpose of the cPVAL ChkDsk Autofix custom field?
A: It determines whether the script attempts to schedule CHKDSK repairs when disk issues are detected.
Q: Does CHKDSK automatically repair disk issues?
A: The script first performs a read-only CHKDSK check on all fixed drives. If issues are detected, it checks the cPVAL ChkDsk Autofix custom field.
- Enabled: The script attempts to run
chkdsk /Fon the affected fixed drives to schedule repairs. Depending on the drive and its usage, a reboot may be required to complete the repair. - Disabled: The script reports the detected issues without initiating repairs.
Refer to the automation script's output and logs to determine the results of the check and any repair actions.
Changelog
2026-10-19
- Initial version of the document.