加油
努力

Windows Server 2019 核心版如何进行基本配置?

Windows Server 2019 核心版(Server Core)是一个最小化的安装选项,不包含图形用户界面(GUI),因此配置主要通过命令行、PowerShell 或远程管理工具完成。以下是进行基本配置的步骤:


一、初始设置

1. 设置管理员密码(首次登录)

首次启动后,系统会提示你设置本地管理员账户(Administrator)的密码。

Enter current password for administrator:
New password:
Confirm new password:

二、网络配置

1. 查看网络接口信息

ipconfig /all

2. 设置静态 IP 地址(示例)

假设你要为名为 “Ethernet” 的网卡设置 IP:

# 使用 PowerShell(推荐)
New-NetIPAddress -InterfaceAlias "Ethernet" -IPAddress 192.168.1.100 -PrefixLength 24 -DefaultGateway 192.168.1.1
Set-DnsClientServerAddress -InterfaceAlias "Ethernet" -ServerAddresses 8.8.8.8, 8.8.4.4

注:InterfaceAlias 可通过 Get-NetAdapter 查看。

3. 更改计算机名

# 命令行方式
wmic computersystem where name="%computername%" call rename name="SRV-CORE01"

或使用 PowerShell:

Rename-Computer -NewName "SRV-CORE01"

重启生效:

Restart-Computer

三、加入域(可选)

1. 加入 Active Directory 域

Add-Computer -DomainName "example.com" -Credential exampleadministrator -Restart

系统将使用指定账户加入域并自动重启。


四、启用远程管理

由于核心版无 GUI,推荐通过远程方式管理。

1. 启用 WinRM(用于 PowerShell 远程)

Enable-PSRemoting -Force

2. 配置防火墙允许远程管理

netsh advfirewall firewall set rule group="Windows Remote Management" new enable=yes

3. 允许远程桌面(可选)

reg add "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f

然后启用防火墙规则:

netsh advfirewall firewall set rule group="Remote Desktop" new enable=yes

五、安装角色和功能

使用 Install-WindowsFeature 命令安装所需服务。

示例:安装文件服务器角色

Install-WindowsFeature -Name File-Services -IncludeManagementTools

示例:安装 Web 服务器(IIS)

Install-WindowsFeature -Name Web-Server -IncludeManagementTools

示例:安装 .NET Framework 3.5(某些应用需要)

Install-WindowsFeature -Name NET-Framework-Core -Source D:sourcessxs

注意:需提供 Windows Server 安装介质中的 sxs 文件夹路径。


六、更新系统

1. 检查并安装更新

# 安装 PSWindowsUpdate 模块(需先有网络)
Install-Module -Name PSWindowsUpdate -Force
Import-Module PSWindowsUpdate
Get-WindowsUpdate
Install-WindowsUpdate

或使用 wuauclt(旧方法):

wuauclt /detectnow

但建议使用 PowerShell 模块更可靠。


七、时间与区域设置

1. 设置时区

Set-TimeZone -Name "China Standard Time"

常见时区名:

  • "China Standard Time"(北京时间)
  • "Eastern Standard Time"

2. 同步时间

w32tm /resync

八、远程管理建议工具

虽然核心版本身无 GUI,但可通过以下方式远程管理:

  • Windows Admin Center:浏览器管理界面。
  • PowerShell RemotingEnter-PSSession -ComputerName SRV-CORE01
  • Remote Server Administration Tools (RSAT):在客户端安装后使用 MMC 管理。
  • Microsoft Management Console (MMC):加载相应插件远程连接。

九、其他常用命令

功能 命令
查看系统信息 systeminfo
重启系统 shutdown /r /t 0Restart-Computer
关机 shutdown /s /t 0
查看已安装功能 Get-WindowsFeature
查看事件日志 Get-EventLog -LogName System -Newest 10

总结

Windows Server 2019 核心版的基本配置流程如下:

  1. 设置密码和计算机名
  2. 配置网络(IP、DNS、网关)
  3. 加入域(如需要)
  4. 启用远程管理(WinRM、RDP)
  5. 安装所需角色和功能
  6. 更新系统并设置时间和时区
  7. 使用远程工具进行后续管理

核心版的优势是安全、资源占用少,适合运行特定服务(如 DNS、DHCP、文件服务器等)。

如需进一步操作,建议熟悉 PowerShell 和 Get-Help <cmdlet> 命令获取帮助。

云服务器