Powershell security warning popup

In our environment we had folder redirection on by GPO and when I would open PowerShell I would get this Security Warning error.

Security warning

Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this

script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run ?

[D] Do not run [R] Run once [S] Suspend [?] Help (default is “D”):

After doing a lot of research I found these solutions:

Without a GPO:
Configure Network Share as a Trusted Zone (for network scripts):

Control Panel > Internet Options: Open Internet Options, navigate to the “Security” tab, and add the network share (e.g., \\networkshare) to the “Local intranet” security zone.

Add to Trusted Sites: Alternatively, you can add the network share to the trusted sites list using the file:// protocol (e.g., file://\\networkshare). I did this option in our GPO

With GPO:
I added the fqdn of the server that my profile was being redirected to under:
Computer Configuration > Policies > Administrative Templates > Windows Components > Internet Explorer > Internet Control Panel > Security Page
Enable Site to Zone Assignment List
Add:
Value name: file://server_fqdn
Value: 1

Then open command prompt and run gpupdate /force and reopen PowerShell. Popup should disappear

Greg,
Welcome to the forum. :wave:t3:

Do you have any question? Or did you just want to share this with the world? :wink:

And please … When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.

Thanks in advance

Guide to Posting Code - Redux <---- Click :point_up_2:t4: :wink:

( !! Sometimes the preformatted text button hides behind the settings gear symbol. :wink: )

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.