Windows PowerShell implements script security to keep unwanted scripts from running in your environment. You have the option of signing your scripts with a digital signature to ensure that scripts that run are from a trusted source.
The policy has five (Unrestricted, RemoteSigned, AllSigned, Restricted, Default, Bypass, and Undefined) different states to be set in five different scopes (MachinePolicy, UserPolicy, Process, CurrentUser, and LocalMachine).
A short description of the different states and what they can or can't do follows:
- Undefined - There is no execution policy set for the current scope
- Restricted - No script, be it local, remote, or downloaded can be executed
- AllSigned - All script that is run required to be digitally signed
- RemoteSigned - All remote (UNC) or downloaded scripts required to be digitally signed
- Bypass - Nothing is blocked and there are no warnings or prompts
- Unrestricted - All scripts are allowed to be executed
And the following is a description of the different scopes:
- MachinePolicy - The execution policy set by a Group Policy applies to all users
- UserPolicy - The execution policy set by a Group Policy applies to the current user
- Process - The execution policy applies to the current Windows PowerShell process
- CurrentUser - The execution policy applies to the current user
- LocalMachine - The execution policy applies to all users of the computer
Windows PowerShell implements script security to keep unwanted scripts from running in your environment. You have the option of signing your scripts with a digital signature to ensure that scripts that are run are from a trusted source.
It is possible to manage Exchange 2016 through PowerShell remoting on a workstation or server without Exchange Tools installed. In this case, you'll need to make sure your script execution policy is set to either RemoteSigned or Unrestricted. To set the execution policy, use the following command:
Set-ExecutionPolicy RemoteSigned
Make sure you do not change the execution policy to AllSigned on machines where you'll be using the Exchange cmdlets. This will interfere with importing the commands through a remote PowerShell connection, which is required for the Exchange Management Shell cmdlets to run properly.