Windows Server 2016

PowerShell is King – A Data Deduplication script that runs the Optimization,Garbage Collection and Scrubbing in a single sweep, including progress

I use Windows Server 2016 on all my lab machines, therefore I also use Data Deduplication to save space. But I don’t run it in the background, i run it basically when I need space.

The PowerShell script. (

Function Wait-VIADedupJob
while ((Get-DedupJob).count -ne 0 )
Start-Sleep -Seconds 30

foreach($item in Get-DedupVolume){
$item | Start-DedupJob -Type Optimization -Priority High -Memory 80
$item | Start-DedupJob -Type GarbageCollection -Priority High -Memory 80 -Full
$item | Start-DedupJob -Type Scrubbing -Priority High -Memory 80 -Full


Categories: Windows Server 2016

Tagged as:

2 replies »

  1. Any reason not to use the -Wait parameter on the Start-DedupJob commands? You get that oh so pretty Powershell progress bar at the top.

Leave a Reply

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

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

Facebook photo

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

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.