mikebai.com

  • Home
  • dev
  • DotNET
  • M365
  • 搞笑
  • 杂七杂八
  • FocusDict
個人BLOG
it developer
  1. Main page
  2. M365
  3. Main content

Change the PowerShell MachinePolicy Execution Policy

2019-04-19 124hotness 0likes 0comments

FROM: https://absolute-sharepoint.com/2014/03/change-powershell-machinepolicy-execution-policy-windows-server-2012r2.html

Background

Last week I wanted to try the new SharePoint 2013 SP1 and, as I never install SharePoint without using PowerShell scripts, I tried using the awesome AutoSPInstaller to install my SharePoint. When Windows Server 201 R2 came out, the twitter sphere said that nothing changed except the Execution Policy was “RemoteSigned”. AutoSPInstaller has a Launch.bat file that makes sure the Main.ps1 launches in “ByPass” mode.

However, the way AutoSPInstaller works is that it includes two other PowerShell files where the functions are stored. When those get included, the ByPass mode is not in effect anymore, and PowerShell goes back to the Machine Policy, which by default is Remote Signed. It’s a good security measure, but we need to get this fixed!

Also for the sake of Google indexing the error for other people, here is the error text:

File cannot be loaded. The file is not digitally signed. You cannot run this script on the current system.

So, I tried to change the execution policy from Powershell with the following command:

Tag: Nothing
Last updated:2019-04-19

mikebai

This person is a lazy dog and has left nothing

Like
< Last article
Next article >

COPYRIGHT © 2025 mikebai.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang