可使用以下方法管理服务器核心服务器:
- 使用 Windows Admin Center
- 使用在 Windows 10 上运行的远程服务器管理工具
- 使用 Windows PowerShell 本地或远程管理
- Remotely using Server Manager
- Remotely using an MMC snap-in
- 远程使用远程桌面服务
还可在本地添加硬件和管理驱动程序,只要从命令行执行此操作即可。
使用服务器核心时,请记住下面一些重要限制和提示:
- 如果关闭所有命令提示符窗口,并想要打开新的命令提示符窗口,可以从任务管理器执行此操作。 Press CTRL+ALT+DELETE, select Start Task Manager, select More Details > File > Run, and then type cmd.exe. (Type Powershell.exe to open a PowerShell command window.) Alternatively, you can sign out and then sign back in.
- 任何试图启动 Windows 资源管理器的命令或工具都无法工作。 For example, running start . from a command prompt doesn't work.
- Server Core 不支持 HTML 呈现和 HTML 帮助。
- 服务器核心支持安静模式下的 Windows Installer,这使你能够从 Windows Installer 文件安装工具和实用工具。 When installing Windows Installer packages on Server Core, use the /qb option to display the basic user interface.
- To change the time zone, run Set-Date.
- To change international settings, run control intl.cpl.
- Control.exe doesn't run on its own. You must run it with either Timedate.cpl or Intl.cpl.
- Winver.exe isn't available in Server Core. Use Systeminfo.exe to obtain version information.
使用 Windows Admin Center 管理服务器核心
Windows Admin Center 是基于浏览器的管理应用,可用于本地管理 Windows Server,而无需依赖 Azure 或云。 Windows Admin Center 让你可以完全控制服务器基础结构的各个方面,用于在未连接到 Internet 的专用网络上进行管理。 可以在 Windows 10 计算机、网关服务器或具有桌面体验的 Windows Server 安装上安装 Windows Admin Center。 安装后,可以连接到要管理的 Server Core 系统。
使用服务器管理器远程管理服务器核心
服务器管理器是 Windows Server 中的管理控制台,可帮助你从桌面预配和管理基于 Windows 的本地和远程服务器。 服务器管理器不需要对服务器进行物理访问,也不需要启用与每台服务器的远程桌面协议(RDP)连接。 服务器管理器支持远程多服务器管理。
To enable your local server to be managed by Server Manager running on a remote server, run the Windows PowerShell cmdlet Configure-SMRemoting.exe –Enable.
使用 Microsoft 管理控制台进行管理
可远程使用 Microsoft 管理控制台 (MMC) 的多个管理单元来管理服务器核心服务器。
若要使用 MMC 管理单元来管理作为域成员的服务器核心服务器,请执行以下操作:
- 启动 MMC 管理单元,如“计算机管理”。
- 右键单击管理单元,然后选择“连接到另一台计算机”。
- Type the computer name of the Server Core server, then select OK. 现在可使用 MMC 管理单元来管理服务器核心服务器,就像管理任何其他电脑或服务器一样。
To use an MMC snap-in to manage a Server Core server that isn't a domain member:
通过在远程计算机上的命令提示符下键入以下命令,建立替代凭据以用来连接到服务器核心计算机:
cmdkey /add:<ServerName> /user:<UserName> /pass:<password>
If you want to be prompted for a password, omit the /pass option.
出现提示时,请键入指定用户名的密码。 如果 Server Core 服务器上的防火墙未配置为允许连接 MMC 管理单元,请按照以下步骤将 Windows 防火墙配置为允许 MMC 管理单元。 然后,继续执行步骤 3。
On a different computer, start an MMC snap-in, such as Computer Management.
在左侧窗格中,右键单击管理单元,然后选择“连接到另一台计算机”。 (例如,在“计算机管理”示例中,你右键单击“计算机管理(本地)”。)
In Another computer, type the computer name of the Server Core server, then select OK. 你现在可以使用 MMC 管理单元来管理服务器核心服务器,像管理运行 Windows Server 操作系统的任何其他计算机一样。
若要将 Windows 防火墙配置为允许 MMC 管理单元连接
若要允许连接所有 MMC 管理单元,请运行以下命令:
Enable-NetFirewallRule -DisplayGroup "Windows Remote Management"
若要仅允许特定 MMC 管理单元连接,请运行以下命令:
Enable-NetFirewallRule -DisplayGroup "<RuleGroup>"
其中,RuleGroup 是以下项之一,具体取决于要连接的管理单元:<>
MMC snap-in | Rule group |
---|---|
Event Viewer | 远程事件日志管理 |
Services | 远程服务管理 |
Shared Folders | 文件和打印机共享 |
任务计划程序 | 性能日志和警报,文件和打印机共享 |
Disk Management | 远程卷管理 |
具有高级安全性的 Windows Defender 防火墙 | Windows Defender 防火墙远程管理 |
Note
某些 MMC 管理单元没有允许其通过防火墙进行连接的相应规则组。 但是,启用事件查看器、服务或共享文件夹的规则组将允许大多数其他管理单元进行连接。
此外,某些管理单元在可以通过 Windows 防火墙连接之前需要进行进一步配置:
- Disk Management: You must first start the Virtual Disk Service (VDS) on the Server Core computer. 你还必须在运行 MMC 管理单元的计算机上正确配置磁盘管理规则。
- IP 安全监视器:你必须首先启用此管理单元的远程管理。 在命令提示符下,键入
cscript c:\windows\system32\scregedit.wsf /im 1
- 可靠性和性能:此管理单元不需要任何进一步的配置,但在使用它监视服务器核心计算机时,只能监视性能数据。 可靠性数据不可用。
使用远程桌面服务进行管理
You can use Remote Desktop to manage a Server Core server from remote computers.
需要运行以下命令,然后才能访问服务器核心:
cscript C:\Windows\System32\Scregedit.wsf /ar 0
此命令使远程桌面管理模式能够接受连接。
在本地添加硬件和管理驱动程序
若要将硬件添加到服务器核心服务器,请按照硬件供应商提供的说明安装新硬件。
如果硬件不是即插即用的,需要手动安装驱动程序。 为此,请将驱动程序文件复制到服务器上的临时位置,然后运行以下命令:
pnputil –i –a <driverinf>
Where driverinf is the file name of the .inf file for the driver.
根据提示重新启动计算机。
若要查看安装了哪些驱动程序,请运行以下命令:
sc query type= driver
Note
若要命令能成功完成,你必须保留等号后的空格。
若要禁用设备驱动程序,请运行以下命令:
sc delete <service_name>
Where service_name is the name of the service that you got when you ran sc query type= driver.