第3季 · WS2025 · WDS

WDS 无人值守安装实战(WS2025收官)

【第3季第4篇】Windows Server 2025 WDS 无人值守安装:系列收官 —— 多系统统一部署与 Secure Boot

系列:爱依航 · Windows Server 2025 运维系列

本篇主题:WDS 无人值守安装实战(WS2025 最终版)

环境:WDS 服务器 IP 192.168.10.12


开篇:这是系列的最后一篇

从 WS 2019 到 WS 2022,再到 WS 2025,三季十二篇,爱依航的 Windows Server 运维系列到这里就完整了。

WS 2025 WDS 是整个系列的集大成者:结合了 WS 2019 的基础架构、WS 2022 的多系统支持,以及 WS 2025 的最新启动镜像和安全模型。


Part 1 · WS 2025 WDS 完整部署


# 安装 WDS 角色
Install-WindowsFeature -Name WDS -IncludeManagementTools

# 初始化 WDS 服务器
wdsutil /initialize-server /reminst:"D:\RemoteInstall" /Standalone

# 配置 WDS 服务器属性
Set-WdsServer -ShowBootPrograms $true -UseExistingAnswerFile $true

# 启用 PXE 响应
Set-WdsServer -PxeResponsePolicy "Known" -PxeResponseDelay 0

WS 2025 WDS 启动镜像特点

项目 说明
------ ------
Windows PE 版本 PE 10.0.26100(与 Windows 11 24H2 同内核)
架构 x64 / ARM64 双架构支持
驱动支持 内置 NVMe、Rapid Storage、USB4 驱动
Secure Boot 完整支持 UEFI Secure Boot
WinRE 基于 WinPE 2024,硬件兼容性显著提升

Part 2 · 添加 WS 2025 安装镜像


# 创建镜像存储目录
New-Item -Path "D:\RemoteInstall\Images\WS2025" -ItemType Directory -Force

# 导入 WS 2025 启动镜像
Import-WdsBootImage `
  -ImagePath "\\fileserver\images\ws2025\sources\boot.wim" `
  -ImageName "Windows Server 2025 Boot Image" `
  -NewImageName "WS2025 x64 Boot" `
  -UnattendFile "D:\RemoteInstall\WdsClientUnattend\Autounattend.xml"

# 创建 WS 2025 镜像组
Add-WdsInstallImageGroup -Name "WS2025-Server"

# 导入 WS 2025 安装镜像
Import-WdsInstallImage `
  -ImagePath "\\fileserver\images\ws2025\sources\install.wim" `
  -ImageGroup "WS2025-Server" `
  -FileName "install.wim"

Part 3 · WS 2025 应答文件模板(KMS 激活版)

WS 2025 支持线上激活,应答文件中配置 KMS 客户端安装密钥即可:


# WS 2025 各版本 KMS 密钥
@"
Standard:    WXGM-NDMKT-BWMMK-3KG8C-2QTKG
Datacenter: CB7KF-BWN84-R7R2Y-793K2-8XDDG
"@

WS 2025 应答文件(生产可用):


<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
  <settings pass="windowsPE">
    <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64"
      publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
      xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <UILanguage>zh-CN</UILanguage>
      <SetupUILanguage>
        <UILanguage>zh-CN</UILanguage>
      </SetupUILanguage>
      <InputLocale>zh-CN</InputLocale>
      <SystemLocale>zh-CN</SystemLocale>
      <UserLocale>zh-CN</UserLocale>
    </component>
    <component name="Microsoft-Windows-Setup" processorArchitecture="amd64"
      publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <DiskConfiguration>
        <Disk wcm:action="add">
          <CreatePartitions>
            <CreatePartition wcm:action="add"><Order>1</Order><Size>100</Size><Type>Primary</Type></CreatePartition>
            <CreatePartition wcm:action="add"><Order>2</Order><Extend>true</Extend><Type>Primary</Type></CreatePartition>
          </CreatePartitions>
          <ModifyPartitions>
            <ModifyPartition wcm:action="add"><Order>1</Order><PartitionID>1</PartitionID><Label>EFI</Label><Format>FAT32</Format><Active>true</Active></ModifyPartition>
            <ModifyPartition wcm:action="add"><Order>2</Order><PartitionID>2</PartitionID><Label>OS</Label><Letter>C</Letter><Format>NTFS</Format></ModifyPartition>
          </ModifyPartitions>
          <DiskID>0</DiskID>
          <WillWipeDisk>true</WillWipeDisk>
        </Disk>
      </DiskConfiguration>
      <ImageInstall>
        <OSImage>
          <InstallFrom>
            <MetaData wcm:action="add">
              <Key>/IMAGE/NAME</Key>
              <Value>Windows Server 2025 SERVERSTANDARD</Value>
            </MetaData>
          </InstallFrom>
          <InstallTo>
            <DiskID>0</DiskID>
            <PartitionID>2</PartitionID>
          </InstallTo>
        </OSImage>
      </ImageInstall>
      <UserData>
        <AcceptEula>true</AcceptEula>
      </UserData>
    </component>
  </settings>
  <settings pass="specialize">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64"
      publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS"
      xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
      <ComputerName>WS2025-NEW</ComputerName>
      <JoinDomain>iehang.cn</JoinDomain>
      <TimeZone>China Standard Time</TimeZone>
    </component>
  </settings>
  <settings pass="oobeSystem">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64"
      publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <OOBE>
        <HideEULAPage>true</HideEULAPage>
        <NetworkLocation>Work</NetworkLocation>
        <ProtectYourPC>1</ProtectYourPC>
      </OOBE>
      <UserAccounts>
        <AdministratorPassword>
          <Value>请使用强密码</Value>
          <PlainText>false</PlainText>
        </AdministratorPassword>
      </UserAccounts>
    </component>
  </settings>
</unattend>

Part 4 · Secure Boot 与 UEFI PXE 启动配置

WS 2025 WDS 完整支持 UEFI Secure Boot,这是现代服务器的标配。

检查 Secure Boot 支持状态


# 查看 WDS 服务器引导配置
Get-WdsBootImage | Select Name,Architecture,SecureBoot

# 检查 UEFI 引导程序
Get-WdsBootImage -ImageId (Get-WdsBootImage)[0].ImageId | Format-List

# 查看 PXE 提供程序
Get-WdsServer | Select-Object Name,BootPrograms,IsValid

常见 Secure Boot PXE 故障

故障表现: UEFI 客户端 PXE 启动时报 Secure Boot 签名验证失败。

原因: 自定义的 boot.wim 未经签名,或 WDS 未正确配置 UEFI 引导文件。

解决方法:


# 确认使用 WS 2025 原生 boot.wim(已包含正确签名)
# 不要使用从 WS 2016/2019 复制过来的旧 boot.wim

# 验证引导程序
Get-WdsBootProgram -Architecture x64 | Select Name,Path,Enabled

# 如需重新注册 UEFI 引导程序
wdsutil /set-server /bootprogram:UEFI x64 boot\x64\wdsmgfw.efi /architecture:x64

Part 5 · 三季系列总结对比

对比项 WS 2019 WS 2022 WS 2025
------- -------- -------- --------
AD 安全默认 基础 LDAP 签名强制 DoH + LDAP 通道绑定强制
DNS 新功能 基础 DNS DNS Policy + RRL DoH + Geo-Resolution
DHCP Failover 支持 增强 Policy IPv6 DHCP 增强 + Azure Arc
WDS PE 版本 PE 1803 PE 21H2 PE 26100
Secure Boot ✅ 完整
最低支持客户端 Win7+ Win10+ Win10/11+
建议升级场景 现有 WS 2016 新建/升级 最新硬件 + 高安全要求

收官

三个系统,十二篇文章,AD / DNS / DHCP / WDS 四个核心组件,全部覆盖。

这是爱依航的 Windows Server 运维系列,从零搭建到日常排障,从 WS 2019 到 WS 2025,帮你把企业基础架构跑起来、跑稳定、跑安全。


系列完整目录