2016年8月16日 星期二

PowerShell 執行 ps1 檔時出現「系統上已停用指令碼執行」錯誤

當我們使用 PowerShell 執行自定 script 檔,卻出現「檔案無法載入,因為這個系統已停用指令碼執行」的訊息,表示在目前作業系統中的執行原則 ( Excution Policy ) 預設狀態為 Restricted,也就是不允許執行。

可透過一些指令進行執行原則變更,首先請用管理員權限打開 PowerShell,執行以下指令:
$ Set-ExecutionPolicy RemoteSigned

讓系統接受所有自訂或是信任來源的腳本檔案,這樣 ps1 檔就能帳常執行啦。

2016年8月15日 星期一

SCOM , Unable to install agent

Problem
==========
The client has been disconnected from the server. Please call ManagementGroup.Reconnect() to reestablish the connection.

Cause
=========
Agents in pending management

Action Plan
===========

Removed the agents in pending management 

pending management via powershell   Get-SCOMPendingManagement