PowerShell script exchange
Post Reply
jhellermann
Influencer
Posts: 24
Liked: 4 times
Joined: May 10, 2016 12:05 pm
Full Name: JEllermann
Contact:

Deduplication - Microsoft-PowerShell-Script

Post by jhellermann » 3 people like this post

Since I do not have sufficient deduplication settings from Microsoft, I have written a Function with Microsoft-PowerShell-Script.
There is a timer running for 16 hours (57600 seconds).
At the beginning the deduplication is started with the entered parameters and after expiration it ends.
The script starts as a task at a specific time. I also use it for garbage collection.
I can not start with the default settings under 2012R2.
Only adjust the parameters for deduplication and seconds. That's it.
Maybe it is useful for someone.


Code: Select all

### Start Deduplication Volume F+G ###

Start-DedupJob -Type Optimization -Volume F:,G: -Priority High -Memory 80

#### Start Countdown ###

Function Start-Countdown 
{ 
    Param(
        [Int32]$Seconds = 57600,
        [string]$Message = "Deduplication Volume F+G"
    )
    ForEach ($Count in (1..$Seconds))
    {   Write-Progress -Id 1 -Activity $Message -Status "Waiting for $Seconds seconds, $($Seconds - $Count) left" -PercentComplete (($Count / $Seconds) * 100)
        Start-Sleep -Seconds 1
    }
    Write-Progress -Id 1 -Activity $Message -Status "Completed" -PercentComplete 100 -Completed
}

Start-Countdown -Seconds 57600 -Message "Deduplication Volume F+G"

Stop-DedupJob -Type Optimization -Volume F:
Stop-DedupJob -Type Optimization -Volume G:
JEllermann
RonPeters19
Lurker
Posts: 1
Liked: never
Joined: Aug 21, 2019 11:53 am
Full Name: Ronpeters
Contact:

Re: Deduplication - Microsoft-PowerShell-Script

Post by RonPeters19 »

Thanks for sharing!
Post Reply

Who is online

Users browsing this forum: No registered users and 10 guests