How to Run chkdsk from Windows Server on All Computers in a Windows Domain
Windows is special. This we all know. One of its most especially special tendencies is that it does not automatically run a file system check every so often. It’s easy enough to automate that on a single machine but what about an entire domain? Here’s a way I’ve thrown together to do just that.
First, download pstools from http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx and install it somewhere. For me my path is c:\bin\PsTools. Be sure to replace the path in the following command with where you install it.
Next, open your favorite Windows text editor (plain old notepad will do in this case) and type c:\bin\PsTools\psexec.exe \\* -d -u yourdomain\youradminaccoutname -p youradminpassword cmd /C “echo Y|chkdsk /F” Obviously replace “yourdomain”, “youradminaccountname”, and “youradminpassword” with the appropriate information for your setup.
Save it as a .bat file somewhere (c:\bin\chkdsk_whole_domain.bat in my case). Then you can go to the server’s Windows system scheduler and have it run whenever you like. Now all of the workstation computers will run chkdsk on their next reboot. That’s one less task you have to do manually!
