ECS支援Windows Server半年渠道鏡像,本文介紹如何管理由該鏡像建立的Windows Server半年渠道執行個體。
鏡像簡介
- Windows Server Version 1809 資料中心版
- Windows Server Version 1709 資料中心版
執行個體管理工具簡介
Windows Server半年渠道執行個體不再包含資源管理員、控制台、Windows Explorer、不支援*.msc 功能如devmgmt.msc 等。Windows Server半年渠道執行個體支援使用Sconfig、Server Manager、PowerShell和Windows Admin Center等工具管理伺服器。
由於Windows Server半年渠道執行個體使用Server Core模式,本文推薦您使用功能更為完善的PowerShell和Windows Admin Center。更多詳情,請參見微軟文檔如何管理 Server Core 模式伺服器。
PowerShell遠端管理
- 遠端連線Windows執行個體。詳情請參見使用軟體串連Windows執行個體。
- 在命令列裡輸入
PowerShell
開啟PowerShell。 - 在執行個體PowerShell中運行以下命令:
Enable-PSRemoting -Force Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC" -RemoteAddress Any
- 在執行個體所在安全性群組中添加規則允許存取HTTP 5985連接埠和HTTPS 5986連接埠。詳情請參見添加安全性群組規則。
- 在用戶端電腦命令列裡輸入
PowerShell
開啟PowerShell。 - 在用戶端PowerShell中運行以下命令:
Set-Item WSMan:localhost\client\trustedhosts -value 172.16.1XX.183 -Force
说明172.16.1XX.183
代表只授信您的執行個體,您也可以使用*
表示授信所有電腦。 - 在用戶端PowerShell中運行
Enter-PSSession '172.16.1XX.183' -Credential:'administrator'
並按提示輸入執行個體密碼。
現在您可以在用戶端電腦管理您的Windows執行個體了。
Windows Admin Center
Windows Admin Center是一個基於瀏覽器的圖形管理工具,可以在Server Core運行環境中取代伺服器管理和MMC。我們假設您的執行個體公網IP為172.16.1XX.183,您可以按以下任一方法安裝Windows Admin Center。
- 通過命令列安裝Windows Admin Center
- 遠端連線Windows執行個體。詳情請參見使用軟體串連Windows執行個體。
- 在執行個體所在安全性群組中添加規則允許存取HTTP 5985連接埠和HTTPS 5986連接埠。詳情請參見添加安全性群組規則。
- 在命令列裡輸入
PowerShell
開啟PowerShell。 - 在執行個體PowerShell中運行以下命令:
Enable-PSRemoting -Force Set-NetFirewallRule -Name "WINRM-HTTP-In-TCP-PUBLIC" -RemoteAddress Any
- 運行以下命令下載Windows Admin Center。
wget -Uri http://download.microsoft.com/download/E/8/A/E8A26016-25A4-49EE-8200-E4BCBF292C4A/HonoluluTechnicalPreview1802.msi -UseBasicParsing -OutFile c:\HonoluluTechnicalPreview1802.msi msiexec /i c:\HonoluluTechnicalPreview1802.msi /qn /L*v log.txt SME_PORT=443 SSL_CERTIFICATE_OPTION=generate
- 運行
cat log.txt
命令查看下載進度,當記錄檔出現下列資訊,說明Windows Admin Center已經成功安裝。MSI (s) (14:44) [09:48:37:885]: Product: Project 'Honolulu'(技術預覽版) -- Installation completed successfully. MSI (s) (14:44) [09:48:37:885]: Windows Installer 已安裝產品。產品名稱: Project 'Honolulu'(技術預覽版)。產品版本: 1.1.10326.0。產品語言: 1033。製造商: Microsoft Corporation。安裝成功或錯誤狀態: 0。
- 通過瀏覽器安裝Windows Admin Center
前提條件
通過瀏覽器安裝Windows Admin Center需要在用戶端計算中完成,請確保您已經通過配置PowerShell管理執行個體。更多詳情,請參見PowerShell 遠端管理。
操作步驟
- 下載並安裝Windows Admin Center。
- 完成安裝後,開啟https://localhost/。
- 單擊添加,在彈窗中添加執行個體的IP地址。
現在,您可以通過Microsoft Edge或者Chrome使用Windows Admin Center的用戶端電腦管理執行個體。
常見問題
如何複製檔案到Windows Server半年渠道執行個體?
- 通過RDP應用
- 遠端連線Windows執行個體。詳情請參見使用軟體串連Windows執行個體。
- 在用戶端電腦上,複製目標檔案。
- 在執行個體CMD環境中輸入
notepad
。 - 單擊粘貼。 ,在開啟對話方塊裡,選擇檔案要複製的目標目錄,按右鍵選擇
- 通過PowerShell遠程
- 啟動目標Windows執行個體。
- 在用戶端電腦上開啟CMD,輸入
PowerShell
進入PowerShell。 - 通過PowerShell遠端管理目標執行個體。詳情請參見PowerShell遠端管理。
- 在用戶端電腦上運行以下命令:
$session = New-PSSession -ComputerName 172.16.1XX.183 Copy-Item -ToSession $session -Path C:\1.txt -Destination c:\2.txt
说明 C:\1.txt是用戶端電腦的檔案位置,C:\2.txt是要拷貝到的Windows執行個體目錄。
- 通過Windows Admin Center
- 啟動目標Windows 執行個體。
- 配置Windows Admin Center工具。詳情請參見Windows Admin Center。
- 開啟Windows Admin Center,點擊被管理的執行個體,單擊檔案,選中檔案後單擊上傳。
如何從內部關閉或者重啟Windows Server半年渠道執行個體?
- 通過RDP應用
- 遠端連線Windows執行個體。詳情請參見使用軟體串連Windows執行個體。
- 在CMD中輸入
sconfig
,根據需要選擇13
重啟執行個體或者14
停止執行個體並斷行符號。
- 通過PowerShell
- 遠端連線Windows執行個體。詳情請參見使用軟體串連Windows執行個體。
- 在CMD中輸入
PowerShell
進入PowerShell。 - 選擇並輸入以下命令列重啟或者停止執行個體。
shutdown -r -t 00 ::命令列 在0秒後重啟 shutdown -s -t 00 ::命令列 在0秒後關機 Stop-Computer -Force # Powershell 立即關機 Restart-Computer -Force # Powershell 立即重啟
- 通過PowerShell遠端管理
- 啟動目標 Windows 執行個體。
- 在用戶端電腦上開啟CMD,輸入
PowerShell
進入PowerShell。 - 通過PowerShell遠端管理目標執行個體。詳情請參見PowerShell遠端管理。
- 在用戶端電腦上選擇性運行以下PowerShell命令:
Enter-PsSession –ComputerName 172.16.1XX.183 Restart-Computer -Force #重啟 Stop-Computer -Force #關機
- 通過Windows Admin Center
- 啟動目標Windows執行個體。
- 配置Windows Admin Center工具。詳情請參見Windows Admin Center。
- 開啟Windows Admin Center,點擊被管理的執行個體,單擊概述,選擇性單擊重啟或者關機。
如何安裝 IIS 服務?
-
通過RDP應用
- 遠端連線Windows執行個體。詳情請參見使用軟體串連Windows執行個體。
- 在CMD中輸入
PowerShell
進入PowerShell。 - 運行以下命令安裝IIS:
Import-Module ServerManager Add-WindowsFeature Web-Server, Web-CGI, Web-Mgmt-Console
-
通過PowerShell遠端管理
- 啟動目標 Windows 執行個體。
- 在用戶端電腦上開啟CMD,輸入
PowerShell
進入 PowerShell。 - 通過PowerShell遠端管理目標執行個體,詳情請參見PowerShell遠端管理。
- 在用戶端電腦上運行以下PowerShell命令:
Enter-PsSession –ComputerName 172.16.1XX.183 Import-Module ServerManager Add-WindowsFeature Web-Server, Web-CGI, Web-Mgmt-Console
-
通過Windows Admin Center
- 啟動目標Windows執行個體。
- 配置Windows Admin Center工具,詳情請參見Windows Admin Center。
- 開啟Windows Admin Center,選中被管理的執行個體,單擊角色和功能,單擊Web 服務器,選擇您需要的功能後單擊是。
如何重建立立不小心在 RDP 會話中關閉了的命令列視窗?
- 通過mstsc串連的情況下按Ctrl + Alt + End按鍵組合,其他情況按Ctrl + Alt + Del按鍵組合。
- 在出現的介面選擇工作管理員並斷行符號。
- 在工作管理員中,依次單擊cmd後單擊確定。 檔案,輸入
參考連結
- 微軟Windows Server半年渠道概述:Windows Server 半年渠道概述。
-
微軟引入Windows Server Version 1709:Introducing Windows Server, version 1709
-
微軟遠端連線排錯:About Remote Troubleshooting