How to defrag drives with PowerShell in Windows Server 2012?

optimizeBesides repairing disks, defragmenting them is another common server maintenance task. Here is the guide lines for defragmenting drives using PowerShell.

  1. Open PowerShell window
  2. You may want to examine whether disks are fragmented or not, so execute Optimize-Volume D –Analyze –Verbose, where D is your drive letter
  3. You will see the result at the end of report. If necessary to defrag, then run Optimize-Volume D –Verbose 
  4. Wanting to run this command on a remote computer, put –CimSession “Remote Computer Name”, without quotation marks, after the command
  5. At the end, for more information and help, run Get-Help Optimize-Volume, as I did in the above picture
Advertisements

2 Responses to How to defrag drives with PowerShell in Windows Server 2012?

  1. I pay a quick visit day-to-day a few blogs and blogs to read posts, however this webpage gives feature based writing.

  2. Vlad Precup says:

    Nice,

    Very good explanation and Works perfect.

    Thanks for making the world better and I invite you to visit my webpage and maybe follow

    http://www.itremotesolutions.com

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: