How to unblock multiple files in multiple folders in Windows Server 2012 R2

Posted: 1 October 2015 in Microsoft
Tags: , , , , , ,

Let’s take this scenario. You’ve uploaded a new version of software to the Server. You didn’t push the “Unblock” putton in file Properties… . The application upgraded itself, and for now you’ve a thousands of files in hundreds of folders which are “Blocked”, but can be readable… how can you repair this? With PowerShell 3!

dir c:\mydir -Recurse | Unblock-File

Debug:

dir c:\mydir -Recurse | Unblock-File -WhatIf

Easy, huh?

Advertisements

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