windows powershell

Configure Data Deduplication on Windows Server 2012 R2

In this tutorial we will show you a fast and easy way to configure Data Deduplication via Powershell.

At first we need to add role for deduplication:

Import-Module ServerManager
Add-WindowsFeature -name FS-Data-Deduplication
Import-Module Deduplication

Now we need to enable deduplication (this time on E: drive).

Enable-DedupVolume E: -UsageType Default

If you are planning to make deduplication for Hyper-V machines storages, run this command:

Enable-DedupVolume E: -UsageType HyperV

Now we need to set the minimum age for files (days before the deduplication starts).

Set-Dedupvolume E: -MinimumFileAgeDays 20

If you want, you can add a folder for deduplication

Set-DedupVolume –Volume "E:" -ExcludeFolder "E:\temp"

Now set the minimum size for file:

Set-DedupVolume –Volume "E:" -MinimumFileSize "32768"

At this step we need to disable deduplication for files in use:

Set-DedupVolume –Volume "E:" -OptimizeInUseFiles:$False
Set-DedupVolume –Volume "E:" -OptimizePartialFiles:$False

To get the list of deduplication processes run the following command:


To get deduplication schedule run:


If you want to add a new task, run this command — New-DedupSchedule

Here is an example on how to add new optimization task:

New-DedupSchedule –Name "ThroughputOptimization" –Type Optimization –Days on,Tues,Wed,Thurs,Fri,Sunday –Start 00:00 –DurationHours 8 -Priority Normal

Now let`s take a closer look on this example:

Name — new task name
Type — task type (Optimization/GarbageCollection/Scrubbing)
Scrubbing — recovers damaged data
GarbageCollection — free up some space
Optimization — deduplication and data compression
Days in what days should the task run?
Start at what time?
DurationHours how many hours the task will be on run

READ ALSO  Change Password in Office 365 via Powershell

To view current deduplication status run command:


You must get something like this:

Enabled   UsageType    SavedSpace    SavingsRate   Volume
——-           ———             ———-             ————           ——
True          Default          76.94 GB             66 %             E:

In this example, deduplication reduced space from 65GB to 354MB.

And that`s great efficiency! Easy set ups, guys!

You may also like:

Add Calendar Permissions in Office 365 via Powersh... This is a tutorial on adding calendar permissions in Office 365 for your users via Powershell. You can add permissions onto a specific mailbox, or you...
Grant Full Access to All Mailboxes in Exchange 200... This is a short tutorial on how to add full access to all mailboxes in Exchange 2007 and 2010 for a an additional user. This can come in handy when sa...
How to copy files with BITS using PowerShell If you use local (and global) networks, you might know that files between systems are transferring by using SMB, FTP or HTTP protocols. The problem wi...
Windows Server 2012 Mailbox Role Process Execution... If you are trying to install Exchange 2010 on Windows Server 2012 and are receiving the error "Mailbox Role Process Failed.... Process execution faile...
How to Get List of Installed Programs in Windows 1... In this simple guide we will show you two different ways of how to get list of all installed programs in Windows 10, 8 or Windows 7 using built-in com...