Today I tried running a PowerShell script from a UNC path on a Windows 2003 server machine. Although I set the execution policy to “Unrestricted”, a security warning came up asking me whether I really wanted to execute the script:
I found the solution to this problem here: Running Scripts Downloaded from the Internet in comment 2466436. All I had to do is add the server to which the UNC path points to the “Local Intranet” zone:
You can use ExecutionPolicy Bypass if you really want to run unrestricted.
@T: Ouch, I guess I need to use get-help more often 😉 You’re absolutely right!
Ich habe dies auch in meiner zweiteiligen Reihe PowerShell Module Zentral im Unternehmen beschrieben.
http://www.admin-source.de/BlogDeu/117/powershell-snapins-und-module-zentral-im-unternehmen-teil-1
http://www.admin-source.de/BlogDeu/153/powershell-snapins-und-module-zentral-im-unternehmen-teil-2
Hallo Peter, danke für den Tipp. Das werde ich mir mal anschauen.