Windows Server 2008 R2 WinRM 設定流程分享

by Eddie 31. December 2014 11:23

這幾天在安裝測試機時,

有一個需求是要設定WinRM讓公司的同仁可以遠端下PowerShell來操作電腦,

本來看了微軟的Technet設定方式覺得很簡單,應該很快就可以設定完成,

不過後面才發現其實還有不少的設定是Technet沒有提到的,

所以這邊就來分享給大家整個的設定流程。

 

1. 在要設定WinRM的Server中,開啟本機群組原則管理員。

    clip_image001

2. 展開電腦設定→系統管理範本→Windows 元件

    →Windows 遠端管理(WinRM)→WinRM Service。

    clip_image002

3. 選擇其中的「Allow Automatic Configuration of listeners」

clip_image003

4. 勾選「Enabled」並在下面的IPv4 Filter以及IPv6 Filter的欄位中,

    輸入允許傳送指令的IP,輸入完成後點選「OK」完成設定。

    clip_image004

5. 接下來開啟Windows Firewall With Advanced Security

    →Inbound Rules→滑鼠右鍵選擇New Rules。

    clip_image005

6. 在 Rule Type中,點選「Predefined」並在下方的下拉式選單中,

    選擇「Remote Event Log Management」。

    clip_image006

7. 點選「Next」之後,在Predefined Rules的畫面中確認三個防火牆規則都有被勾選起來後,

    按下「Next」完成設定

    clip_image007

8. 開啟Server Manager在 Server Summary點選「Configure Server Manager Remote Management」

    clip_image009

9. 勾選「Enable remote management of this Sever from other computers」之後點選「OK」。

    clip_image010

10. 檢查下列的8條防火牆規則是否都開啟。

    Remote Service Management (NP-In)

    Remote Service Management (RPC)

    Remote Service Management (RPC-EPMAP)

    Remote Event Log Management (NP-In)

    Remote Event Log Management (RPC)

    Remote Event Log Management (RPC-EPMAP)

    Windows Firewall Remote Management (RPC)

    Windows Firewall Remote Management (RPC-EPMAP)

11. 開啟PowerShell(建議以系統管理員身分執行),

    並輸入「Set-ExecutionPolicy -ExecutionPolicy RemoteSigned」之後輸入Y完成設定。

    clip_image011

12. 之後在輸入「Configure-SMRemoting.ps1 -force –enable」

    會顯示此台機器已準備好使用WinRM。

    clip_image012

上述的流程就是在Technet上的設定方式,真正要完成設定還需要做下列步驟。

13. 在PowerShell中輸入「Enable-PSRemoting –Force」。

    clip_image013

14. 再輸入「Set-Item wsman:\localhost\client\trustedhosts *」

    並在下面的權限設定中選擇Y來完成設定。

    clip_image014

15. 最後輸入「Restart-Service WinRM」來重新啟動WinRM的服務。

    clip_image015

16. 可以再其他電腦上開啟PowerShell,

    輸入「Enter-PSSession -ComputerName COMPUTER -Credential USER」來測試。

    clip_image017

參考文章

1. Remote Management with Server Manager

2. Enable and configure Windows PowerShell Remoting using Group Policy

3. PowerShell - Remote Setting

Tags: ,

Windows Server

Add comment




  Country flag
biuquote
  • Comment
  • Preview
Loading






關於我們

這裡是由一群熟悉 Microsoft IT 技術的工程師所共同分享技術文章的部落格,除了定期分享工作上的技術經驗,我們也提供專業的技術顧問諮詢服務,有任何疑難雜症都歡迎與我們聯絡!

  • 陳冠龍(Owen)
  • 02-2322-2480 # 33
  • 陳昌賢(Mars)
  • 02-2322-2480 # 16
  • 有任何的建議或問題,請來信 [email protected]

※ 學習資源:
    2016/3/9 - 你所不知道的 Microsoft Azure 雲端採購技巧
    (講者:多奇數位技術總監 - Will 保哥)

最新消息

企業上雲端會是未來趨勢

微軟主打 2 種公有雲平台

Office 365 & Azure

有興趣皆可來電 or E-Mail 詢問

Calendar

<<  March 2024  >>
MoTuWeThFrSaSu
26272829123
45678910
11121314151617
18192021222324
25262728293031
1234567

View posts in large calendar