If you have been frustrated by the warning message on Windows computers “This file came from another computer and might be blocked to help protect this computer.”, you are not alone. The warning might pop up when you try to open a file that you downloaded from the Internet. It can cause a decent amount of frustration because of the way it is implemented.

You are here: Home / Articles / Tech Solutions / How to ‘Unblock’ multiple files at a time with PowerShell
How to ‘Unblock’ multiple files at a time with PowerShell

If you have been frustrated by the warning message on Windows computers “This file came from another computer and might be blocked to help protect this computer.”, you are not alone. The warning might pop up when you try to open a file that you downloaded from the Internet. It can cause a decent amount of frustration because of the way it is implemented.

If you right-click on a single file and choose Properties, you can see the Security section at the bottom of the window.

“This file came from another computer and might be blocked to help protect this computer.”

You can disable the setting through Group Policy by enabling the setting ‘Do not preserve zone information in file attachments’ found under User Configuration -> Administrative Templates -> Windows Components -> Attachment Manager. I don’t recommend this as I prefer to keep security warnings in place. I previously dealt with this several years ago when a script had problems running a blocked file where the solution was to add a UNC path of the file to the Trusted Sites Intranet zone.

There is native PowerShell functionality that will allow us to unblock multiple files at a time. The command is:

dir -Path [directory path] -Recurse | Unblock-File

To unblock all the files in a folder do the following:

  1. Start powershell in Administrator Mode on the server.
  2. Call the above command using the correct [directory path]
  3. Check individual DLL or EXE files to make sure they are no longer blocked.
Revision: 2
Last modified: Oct 31, 2019

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment