close

相信很多人第一次使用,或是被迫使用 Windows Server Core,都會遇到不知道從哪邊著手吧?本篇將簡單介紹如何簡單的操作 Server Core

1. 電腦基本設定 - sconfig (Server Configuration)

第一次剛進入 Server Core 時,可以先從 sconfig 開始,這個工具涵蓋了你剛安裝電腦時常用的設定

2. 安裝/移除功能 Install-WindowsFeature

在不知道功能名稱時,可先利用 Get-WindowsFeature 這個命令查詢可安裝的功能,確定需要安裝的功能後,再利用 Install-WindowsFeature <FeatureName>[,<FeatureName>] 安裝新功能。

當然,有安裝就有移除:Remove-WindowsFeature <FeatureName>[,<FeatureName>]


3. 管理防火牆 - netsh advfirewall firewall

啟用防火牆:

netsh advfirewall set currentprofile state on

停用防火牆:

netsh advfirewall set currentprofile state off

建立規則示範:

netsh advfirewall firewall add rule name="HTTP" dir=in action=allow protocol=TCP localport=80

netsh advfirewall firewall add rule name="HTTPS" dir=in action=allow protocol=TCP localport=443

netsh advfirewall firewall add rule name="FTP" dir=in action=allow protocol=TCP localport=20,21

netsh advfirewall firewall add rule name="K8S-NodePort" dir=in action=allow protocol=TCP localport=30000-32767

netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow

netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes

netsh advfirewall firewall set rule group="remote desktop" new enable=Yes

詳細使用方式可 Google 查詢更多

4. 帳戶/群組管理 NET USER & NET LOCALGROUP

透過 net user /? 可以查詢到使用者的相關設定
NET USER username [password | *] [options]] [/DOMAIN]      修改密碼
                 username {password | *} /ADD [options] [/DOMAIN] 新增使用者
                 username [/DELETE] [/DOMAIN] 刪除使用者
                 username [/TIMES:{times | ALL}] 設定帳戶到期日
                 username [/ACTIVE: {YES | NO}]  設定停用/啟用

透過 NET LOCALGROUP /? 可以查詢到使用者的相關設定
NET LOCALGROUP groupname [/COMMENT:"text"]] [/DOMAIN]
                               groupname {/ADD [/COMMENT:"text"] | /DELETE}  [/DOMAIN] 新增/移除群組
                               groupname name [...] {/ADD | /DELETE} [/DOMAIN] 加入/移除使用者

5. 查詢 Event Log

列出可用的紀錄清單 - Get-Eventlog -List

查詢特定清單內容 - Get-Eventlog <LogName> [-after (get-date).addhours(-1)]

更多資訊:Read the Event Logs on Windows Server Core

6. 如果你還是對文字管理不習慣,可以使用以下方式管理,或是直接重灌成桌面體驗模式

1. 透過 mmc 遠端管理
2. 將 伺服器管理工具 安裝在 Windows 10 上管理遠端伺服器 - Remote Server Administration Tools for Windows 10
3. 透過瀏覽器管理 - Windows Admin Center

你可能需要執行下面的指令啟用遠端管理功能:

Enable-PSRemoting -Force
Configure-SMRemoting -Enable

7. 更多透過 PowerShell 管理的模組及指令可以查閱官方的 PowerShell Module Browser

 

arrow
arrow
    全站熱搜

    AwEi 發表在 痞客邦 留言(0) 人氣()