Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Overnight ExecutionPolicy changed 'by itself' from RemoteSigned to Restricted. How to prevent/respond?

$
0
0

With lots of help from you guys I've finally got a script that--until sometime last night--was running properly for several days now and sending out information emails every morning and evening. Last evening's email was fine but this morning the script did not run at all because, as I discovered, at some time overnight the Execution Policy was changed to Restricted from its previous RemoteSigned.

What could have caused this? My area is a small backwater of a large institution with tens of thousands of PCs being administrated pretty much automatically so maybe some other pesky sysadim script could have run something to 'correct' any security risks like allowing scripts to run?

Regardless of what caused it, I 'fixed' it by running the following: 

Invoke-Command Server2  {Set-ExecutionPolicy RemoteSigned -Force -Scope LocalMachine}
How to deal with this? Is there a log file somewhere which might show when/how the policy was changed? I doubt there is a good way to prevent the execution policy from being changed? Does the above cmtlet have to be run pretty much constantly in order to guarantee that scripts can run on Server2?

HomeCookN


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>