2

First, the computers are of around 21 Win 7 Machines and 29 Win XP machines. The DC is a Win2k8 server and the Mail server is Win2k3

I need to force a remote defragmentation on roughly 50 computers. They have been complaining of slow performance and were recently plagued with a virus. It is impractical to physically go there and start 50 of these as it would have to be after hours. Is there a way to remotely send a command to each PC that will either create a scheduled tasks to kick it off or just force a defrag all together?

  • 2
    Ryan Riles nailed the answer, but if you have a bunch of virus-infected computers, you should consider re-imaging them. Only way to be sure you got it all. And your image should have less fragmentation too, so it's killing two birds with one stone. – HopelessN00b Aug 15 '12 at 16:39

2 Answers2

7

There are going to be a number of different ways to accomplish this, but the first thing that comes to mind is to write a script to use PsExec to run defrag.exe on each PC.

Ryan Ries
  • 55,011
  • 9
  • 138
  • 197
1

For Windows 7 why are you bothering to force a defrag? Windows 7 by default defrags all hard drives on a periodic schedule.

Brent Pabst
  • 6,059
  • 2
  • 23
  • 36