defrag through group policy

15 pts.
Tags:
Defragmentation
Group Policy
Is there a way to set network computers to defrag at a specified time through group policy?

Answer Wiki

Thanks. We'll let you know when a new response is added.

for /f %%a in (c:\list.txt) do psexec -s -d \\%%a defrag c: && shutdown -s -f

Save this as a .bat file. Download psexec from sysinternals

http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

Create a directory on your desktop, put the extracted psexec.exe and you .bat file in this directory. Create a list of machine names you want to defrag, an AD dsquery output or manual list creation. Name this file list.txt. Double click .bat file or add it to scheduled tasks for later in evening.

Here is the VB code to defrag

http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true

Now to make it run as admin or system

http://www.joeware.net/freetools/tools/cpau/index.htm

is how to do this, push out its install through GP, then use it to create a job file, and run the job file as a shutdown script

==============
You cannot set a defragmentation command using the group policy service of the Windows Operating System. You can only defrag a networked client by creating a software with the codes capable of defragging network hard drives.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Jaideep Khanduja
    running defrag for all computes at the same time on the network may effect your network. better, do it in batches at different timings. Also you have to see about the users that it is not their peak working time on computer when you run it on their PC.
    9,385 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following