SlideShare a Scribd company logo
1 of 60
Download to read offline
Windows 标准化部署工具使用详解
2017.05 | 苏繁
Windows 10 Upgrade Ready Part 3
课程安排
1. Windows 10 v1703
• BCDBOOT.exe
• MBR2GPT.exe
• PNPUTIL.exe
• SYSPREP.exe
• DISM.exe and IMAGEX.exe
2. Windows ADK v1703
• Windows System Image Manager(SIM)
• Windows Imaging and Configuration Designer(ICD)
• Windows Preinstallation Environment(Windows PE)
• User State Migration Tool(USMT)
BCDBoot.exe
• BCDBoot 是用于管理系统分区文件的命令行工具,可在以下方案
中使用此工具:
• 部署新电脑时设置系统分区上的启动文件。
• 设置 Windows 以启动到 VHD 文件。
• 修复系统分区
• 设置或修复双启动电脑上的启动菜单。
• BCDBoot.exe 位于 %WINDIR%System32
• BCDBoot 支持 Windows 7 及之后的系统版本
• 从C:Windows拷贝支持BIOS和UEFI的简体中文启动文件到F:
• Bcdboot c:windows /s F: /f ALL /l zh-cn
MBR2GPT.exe
• 用于 MBR 到 GPT 就地转换,可将基于 BIOS 启动的 Windows 10
v1703 无损转换为 UEFI 启动。
• 支持在线模式,命令行参考:
Mbr2gpt.exe /convert /allowfullos
• 需确保当前系统分区少于4个。
Pnputil.exe
• Pnputil 可用于管理驱动程序存储区,使用 Pnputil 将驱动程序包
添加、删除到存储区或列出存储区内的驱动程序。
• 常用命令行:
• Pnputil -a c:driversusbcam.inf ->添加驱动
• Pnputil -i -a c:drivers*.inf ->添加和安装驱动
• Pnputil -e ->枚举所有第三方程序包
• Pnputil -f -d oem0.inf ->强制删除程序包 oem0.inf
• 在 Windows 10 v1703 中 Pnputil 参数得到增强和改进
Sysprep.exe
• Sysprep 系统准备工具,要将 Windows 映像部署到不同的电脑,
必须使用系统准备工具对当前映像进行一般化处理。
• 参考命令行:
• Sysprep /quiet /generalize /oobe /shutdown /unattend:unattend.xml
参考资料:
https://msdn.microsoft.com/zh-cn/library/hh825084.aspx
DISM.exe and ImageX.exe
• DISM 和 ImageX 都是 Windows 部署映像服务和管理工具。
• DISM 从Windows 8 开始完全替代 ImageX,并内置于系统中。
• DISM 提供全局、脱机和在线,三种模式参数。
参考资料:
https://msdn.microsoft.com/zh-cn/library/hh825258.aspx
https://msdn.microsoft.com/zh-cn/library/hh825079.aspx
https://msdn.microsoft.com/zh-cn/library/hh825236.aspx
https://msdn.microsoft.com/zh-cn/library/hh824821.aspx
DISM优势
• 捕获和应用 Windows 映像
• 在 .wim 文件中附加和删除映像
• 将 .wim 文件拆分成几个小文件
• 添加、删除和枚举程序包
• 添加、删除和枚举驱动程序
• 启用或禁用 Windows 功能
• 应用 Unattend.xml 的 offlineServicing 部分的更改
• 配置国际设置
• 将 Windows 映像升级到其他版本
• 准备 Windows PE 映像
DISM 映像服务常用参数
• 将 Windows 映像从 .wim 文件装载到指定目录
• Dism /mount-image /imagefile:e:sourcesinstall.wim /index:1 /mountdir:c:mountoffline
• 卸载 .wim文件并提交或放弃装载映像时所作的更改
• Dism /unmount-image /mountdir:c:mountoffline /commit (or /discard)
• 查看 Windows 映像 .wim 信息
• Dism /get-wiminfo /wimfile:e:sourcesinstall.wim
• 将某个分区或目录的映像捕获到新的 .wim 文件
• Dism /capture-image /imagefile:d:backupwin10x64.wim /capturedir:c: /name:Drive-C-Win10x64
• 将映像 .wim 应用于指定分区或目录位置
• Dism /apply-image /imagefile:e:sourcesinstall.wim /index:1 /applydir:c:
• 将附加映像添加到 .wim 文件中
• Dism /append-image /imagefile:d:backupwin10x64.wim /capturedir:f: /name:Drive-F
DISM 驱动和程序服务常用参数
• 向映像添加驱动
• Dism /image:c:testoffline /add-driver /driver:d:drivers /recurse
• 显示映像的所有驱动信息
• Dism /online /get-drivers
• 删除映像中的驱动
• Dism /image:c:testoffline /remove-driver /driver:oem1.inf
• 向映像添加程序包
• Dism /image:c:testoffline /add-package /packagepath:d:msufilename.msu
• 显示映像中特定功能状态
• Dism /online /get-features |more
• 启用映像中的特定功能
• Dism /online /enable-feature /featurename:telnetclient
DISM 其他常用参数 - Windows 10
• 导出默认应用程序关联
• Dism /online /export-defaultappassociations:c:appassoc.xml
• 导入默认应用程序关联
• Dism /online /import-defaultappassociations:c:appassoc.xml
• 删除默认应用程序关联
• Dism online /remove-defaultappassociations
• 修复损坏的系统组件库,并阻止访问WU
• Dism /online /cleanup-image /restorehealth /source:c:testmountwindows /limitaccess
• 清理映像组件库
• Dism /online /cleanup-image /startcomponentcleanup /resetbase
WSIM
• WSIM,Windows 系统映像管理器可在图形界面下创建和管理无
人参与的 Windows 安装程序应答文件。
• 应为 x86 和 x64 的系统映像生成对应的无人应答文件。
• 无人应答文件需要进行验证和测试。
参考资料:
https://msdn.microsoft.com/zh-cn/library/hh824914.aspx
https://msdn.microsoft.com/zh-cn/library/hh824845.aspx
Windows 7 安装步骤
使用 WSIM 处理自动化安装
• 将应答文件命名为AutoUnattend.xml 存储到 UFD
• 需要自动化处理的两个阶段:
• [Windows PE]
• 语言和区域 Microsoft-Windows-International-Core-WinPE | SetupUILanguage
• 安装 Windows Microsoft-Windows-Setup | ImageInstall | OSImage
• 许可条款 Microsoft-Windows-Setup | UserData | AcceptEula
• 准备磁盘 Microsoft-Windows-Setup | DiskConfiguration | Disk
• [OobeSystem]
• 用户名 Microsoft-Windows-Shell-Setup | AutoLogon
• 计算机名 [Specialize] Microsoft-Windows-Shell-Setup | ComputerNanme
• 用户密码 Microsoft-Windows-Shell-Setup | UserAccounts | AdministratorPassword
• 产品密钥 [Windows PE] Microsoft-Windows-Setup | UserData | ProductKey
• 系统保护 Microsoft-Windows-Shell-Setup | OOBE | ProtectYourPC
• 时区 Microsoft-Windows-Shell-Setup | TimeZone
• 网络位置 Microsoft-Windows-Shell-Setup | OOBE | NetworkLocation
参考资料:
https://msdn.microsoft.com/zh-cn/library/hh825162.aspx
https://msdn.microsoft.com/zh-cn/library/hh825198.aspx
AutoUnattend.xml
WPE
• WPE - Windows 预安装环境,一个基于 Windows 内核的具有优先服
务的最小 Win32 操作系统,可用于Windows 的安装、部署服务、系
统管理服务、Windows恢复等场景。
• WPE 包含在 Windows AIK/ADK 中,可根据用户需求进行自定义。
• 支持多种磁盘格式
• 支持网络共享访问
• 支持 32位或64位
• 提供有限的 Windows 组件和功能支持
• 支持从各种媒介启动,包括:CD、DVD、UFD、HDD、WDS
• Windows PE 默认以 RAM 方式启动
参考资料:
https://technet.microsoft.com/zh-cn/library/cc766093(v=ws.10).aspx
https://msdn.microsoft.com/zh-cn/windows/hardware/commercialize/manufacture/desktop/winpe-intro
WPE 相关操作• 创建自定义 WPE 环境
• Copype amd64 C:winpe_amd64
• 创建 UFD 引导 或 ISO
• Makewinpemedia /ufd C:winpe_amd64 U:
• Makewinpemedia /iso C:winpe_amd64 C:winpe_amd64winpe_amd64.iso
• 装载和卸载已更改的 WPE 启动映像
• Dism /mount-image /imagefile:”c:winpe_amd64mediasourcesboot.wim” /index:1 /mountdir:”c:winpe_amd64mount”
• Dism /unmount /mountdir:”c:winpe_amd64mount” /commit
• 为 WPE 添加驱动
• Dism /add-driver /image:”c:winpe_amd64mount” /driver:”c:driversdriver.inf”
• 为 WPE 添加组件或语言支持
• Dism /add-package /image:”c:winpe_amd64mount” /packagepath:"C:Program Files (x86)Windows Kits10Assessment and Deployment
KitWindows Preinstallation Environmentamd64WinPE_OCsWinPE-PowerShell.cab“
• Dism /add-package /image:”c:winpe_amd64mount” /packagepath:"C:Program Files (x86)Windows Kits10Assessment and Deployment
KitWindows Preinstallation Environmentamd64WinPE_OCszh-cnlp.cab“
• Dism /image:”c:winpe_amd64mount” /set-allintl:zh-cn
• 替换 WPE 背景图片
• 替换”c:winpe_amd64mountwindowssystem32winpe.jpg”
• 设置 WPE 以高性能模式运行
• 修改“c:winpe_amd64mountwindowssystem32startnet.cmd”
• 在 winpeinit 下增加一行 powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
WICD
• WICD - Windows映像和配置设置器,用于简化 Windows 映像的自定义和预配。
• WICD 支持 Windows 10
• 使用场景:
如果你是一位: 并对以下内容感兴趣: 使用:
系统组装商或
OEM
在新的桌面和移动设备上配置并应用 Windows 映像
使用 Windows ICD 创建完整映像媒体(USB、
网络、USB Tethering)
小型组织 自定义新的桌面和移动设备 使用 Windows ICD 创建设置包
在新的桌面设备上配置并应用 Windows 映像
使用 Windows ICD 创建完整映像媒体(USB、
网络、USB Tethering)
中型组织 在新的或现有的桌面设备上创建和部署自定义 Windows 映像
用于创建和部署自定义映像(USB、网络、
Windows 部署服务 (WDS) 或预启动执行环境
(PXE))的 Microsoft 部署工具包
在新的桌面设备上配置并应用 Windows 映像 使用 Windows ICD 创建设置包
自定义移动设备 使用 Windows ICD 创建设置包
大型组织 在新的或现有的桌面映像上创建和部署自定义 Windows 映像
使用 MDT 和/或配置管理器创建和部署自定义
映像(USB、网络、WDS/PXE/多播)
自定义新的桌面和移动设备 使用 Windows ICD 创建设置包
USMT
• USMT - 用户状态迁移工具,可提供高度自定义的用户配置文件迁移体验。
• 包含两个组件:ScanState, LoadState
• 支持多种迁移定义:MigApp.xml、MigUser.xml、MigDocs.xml、Config.xml
以及自定义名称的 .xml 文件。
• 不要同时使用 MigUser.xml 和 MigDocs.xml
• 非标用户配置使用 MigDocs.xml 可获得更好的体验。
• 迁移前后不要运行程序,LoadState 后应注销。
参考资料:
https://msdn.microsoft.com/zh-cn/library/hh824805.aspx
https://msdn.microsoft.com/zh-cn/library/hh825256.aspx
https://msdn.microsoft.com/zh-cn/library/hh825026.aspx
https://msdn.microsoft.com/zh-cn/library/hh824928.aspx
https://msdn.microsoft.com/zh-cn/library/hh825093.aspx
USMT 相关操作
• 迁移计算机
• 源计算机:
• scanstate servermigrationmystore /config:config.xml /i:migdocs.xml /i:migapp.xml /v:13 /l:scan.log
• 目标计算机:
• loadstate servermigrationmystore /config:config.xml /i:migdocs.xml /i:migapp.xml /v:13 /l:load.log
• 迁移两个域账户(User1 和 User2)
• 源计算机:
• scanstate servershareusmtmystore /ue:** /ui:contosouser1 /ui:corpuser2 /i:migdocs.xml /i:migapp.xml /o
• 目标计算机:
• Loadstate servershareusmtmystore /i:migdocs.xml /i:migapp.xml
• 从压缩 USMT 迁移存储中提取文件
• Usmtutils /extract d:usmtstore.img d:extstore
谢谢
Q/A
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解
Windows 标准化部署工具使用详解

More Related Content

What's hot

Secureboot Survival Guide
Secureboot Survival GuideSecureboot Survival Guide
Secureboot Survival Guidelcplcp1
 
開機隨身碟
開機隨身碟開機隨身碟
開機隨身碟maolins
 
Adm2.2 presentation cht
Adm2.2 presentation chtAdm2.2 presentation cht
Adm2.2 presentation chtFreddie Huang
 
How to Install Ubuntu Linux 20.04
How to Install Ubuntu Linux 20.04How to Install Ubuntu Linux 20.04
How to Install Ubuntu Linux 20.04Shau-Hung Hsieh
 
(2021-03).UT-商品-企業-訊息-技EDM-2021-3-Dell EMC Avamar VM保護備份
(2021-03).UT-商品-企業-訊息-技EDM-2021-3-Dell EMC Avamar VM保護備份(2021-03).UT-商品-企業-訊息-技EDM-2021-3-Dell EMC Avamar VM保護備份
(2021-03).UT-商品-企業-訊息-技EDM-2021-3-Dell EMC Avamar VM保護備份裝機安 Angelo
 
HPE SimpliVity install mgmt guide 201907-01 (Taiwan-Chinese) ;HPE SimpliVity ...
HPE SimpliVity install mgmt guide 201907-01 (Taiwan-Chinese) ;HPE SimpliVity ...HPE SimpliVity install mgmt guide 201907-01 (Taiwan-Chinese) ;HPE SimpliVity ...
HPE SimpliVity install mgmt guide 201907-01 (Taiwan-Chinese) ;HPE SimpliVity ...裝機安 Angelo
 

What's hot (7)

Secureboot Survival Guide
Secureboot Survival GuideSecureboot Survival Guide
Secureboot Survival Guide
 
Construct 2
Construct 2Construct 2
Construct 2
 
開機隨身碟
開機隨身碟開機隨身碟
開機隨身碟
 
Adm2.2 presentation cht
Adm2.2 presentation chtAdm2.2 presentation cht
Adm2.2 presentation cht
 
How to Install Ubuntu Linux 20.04
How to Install Ubuntu Linux 20.04How to Install Ubuntu Linux 20.04
How to Install Ubuntu Linux 20.04
 
(2021-03).UT-商品-企業-訊息-技EDM-2021-3-Dell EMC Avamar VM保護備份
(2021-03).UT-商品-企業-訊息-技EDM-2021-3-Dell EMC Avamar VM保護備份(2021-03).UT-商品-企業-訊息-技EDM-2021-3-Dell EMC Avamar VM保護備份
(2021-03).UT-商品-企業-訊息-技EDM-2021-3-Dell EMC Avamar VM保護備份
 
HPE SimpliVity install mgmt guide 201907-01 (Taiwan-Chinese) ;HPE SimpliVity ...
HPE SimpliVity install mgmt guide 201907-01 (Taiwan-Chinese) ;HPE SimpliVity ...HPE SimpliVity install mgmt guide 201907-01 (Taiwan-Chinese) ;HPE SimpliVity ...
HPE SimpliVity install mgmt guide 201907-01 (Taiwan-Chinese) ;HPE SimpliVity ...
 

Similar to Windows 标准化部署工具使用详解

How to Install Debian GNU/Linux
How to Install Debian GNU/LinuxHow to Install Debian GNU/Linux
How to Install Debian GNU/LinuxShau-Hung Hsieh
 
06.web sphere培训 实践
06.web sphere培训 实践06.web sphere培训 实践
06.web sphere培训 实践littlecong
 
尚观Linux研究室 linux驱动程序全解析
尚观Linux研究室   linux驱动程序全解析尚观Linux研究室   linux驱动程序全解析
尚观Linux研究室 linux驱动程序全解析hangejnu
 
Configuration tutorial for pytorch environment under windows.pdf
Configuration tutorial for pytorch environment under windows.pdfConfiguration tutorial for pytorch environment under windows.pdf
Configuration tutorial for pytorch environment under windows.pdfshuaihaohan135
 
icecream / icecc:分散式編譯系統簡介
icecream / icecc:分散式編譯系統簡介icecream / icecc:分散式編譯系統簡介
icecream / icecc:分散式編譯系統簡介Kito Cheng
 
Docker tutorial
Docker tutorialDocker tutorial
Docker tutorialazole Lai
 
2, installation
2, installation2, installation
2, installationted-xu
 
開發工具與環境建置
開發工具與環境建置開發工具與環境建置
開發工具與環境建置Shengyou Fan
 
如何利用Microsoft visual source safe進行版本控管
如何利用Microsoft visual source safe進行版本控管如何利用Microsoft visual source safe進行版本控管
如何利用Microsoft visual source safe進行版本控管冠智 廖
 
Adobe flash builder 4.7 自述
Adobe flash builder 4.7 自述Adobe flash builder 4.7 自述
Adobe flash builder 4.7 自述Ben Murray
 
02.uliweb开发入门
02.uliweb开发入门02.uliweb开发入门
02.uliweb开发入门modou li
 
Install oracle ebs r12.1.1 on OEL5.6 x86(include demo)
Install oracle ebs r12.1.1 on OEL5.6 x86(include demo)Install oracle ebs r12.1.1 on OEL5.6 x86(include demo)
Install oracle ebs r12.1.1 on OEL5.6 x86(include demo)acqua young
 
Apache+php+mysql在Linux下的安装与配置
Apache+php+mysql在Linux下的安装与配置Apache+php+mysql在Linux下的安装与配置
Apache+php+mysql在Linux下的安装与配置wensheng wei
 
DAE 新变化介绍
DAE 新变化介绍DAE 新变化介绍
DAE 新变化介绍Tianwei Liu
 
Glass 刷機實錄
Glass 刷機實錄Glass 刷機實錄
Glass 刷機實錄Johnny Sung
 
CI2.x 加入連線 redis 的功能
CI2.x 加入連線 redis 的功能CI2.x 加入連線 redis 的功能
CI2.x 加入連線 redis 的功能Onnie Fong
 
Linux系统工程师教程
Linux系统工程师教程Linux系统工程师教程
Linux系统工程师教程yiditushe
 
開發人員不可不知的 Windows Container 容器技術預覽
開發人員不可不知的 Windows Container 容器技術預覽開發人員不可不知的 Windows Container 容器技術預覽
開發人員不可不知的 Windows Container 容器技術預覽Will Huang
 
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩Wen-Tien Chang
 

Similar to Windows 标准化部署工具使用详解 (20)

How to Install Debian GNU/Linux
How to Install Debian GNU/LinuxHow to Install Debian GNU/Linux
How to Install Debian GNU/Linux
 
06.web sphere培训 实践
06.web sphere培训 实践06.web sphere培训 实践
06.web sphere培训 实践
 
尚观Linux研究室 linux驱动程序全解析
尚观Linux研究室   linux驱动程序全解析尚观Linux研究室   linux驱动程序全解析
尚观Linux研究室 linux驱动程序全解析
 
Configuration tutorial for pytorch environment under windows.pdf
Configuration tutorial for pytorch environment under windows.pdfConfiguration tutorial for pytorch environment under windows.pdf
Configuration tutorial for pytorch environment under windows.pdf
 
icecream / icecc:分散式編譯系統簡介
icecream / icecc:分散式編譯系統簡介icecream / icecc:分散式編譯系統簡介
icecream / icecc:分散式編譯系統簡介
 
Docker 101
Docker 101Docker 101
Docker 101
 
Docker tutorial
Docker tutorialDocker tutorial
Docker tutorial
 
2, installation
2, installation2, installation
2, installation
 
開發工具與環境建置
開發工具與環境建置開發工具與環境建置
開發工具與環境建置
 
如何利用Microsoft visual source safe進行版本控管
如何利用Microsoft visual source safe進行版本控管如何利用Microsoft visual source safe進行版本控管
如何利用Microsoft visual source safe進行版本控管
 
Adobe flash builder 4.7 自述
Adobe flash builder 4.7 自述Adobe flash builder 4.7 自述
Adobe flash builder 4.7 自述
 
02.uliweb开发入门
02.uliweb开发入门02.uliweb开发入门
02.uliweb开发入门
 
Install oracle ebs r12.1.1 on OEL5.6 x86(include demo)
Install oracle ebs r12.1.1 on OEL5.6 x86(include demo)Install oracle ebs r12.1.1 on OEL5.6 x86(include demo)
Install oracle ebs r12.1.1 on OEL5.6 x86(include demo)
 
Apache+php+mysql在Linux下的安装与配置
Apache+php+mysql在Linux下的安装与配置Apache+php+mysql在Linux下的安装与配置
Apache+php+mysql在Linux下的安装与配置
 
DAE 新变化介绍
DAE 新变化介绍DAE 新变化介绍
DAE 新变化介绍
 
Glass 刷機實錄
Glass 刷機實錄Glass 刷機實錄
Glass 刷機實錄
 
CI2.x 加入連線 redis 的功能
CI2.x 加入連線 redis 的功能CI2.x 加入連線 redis 的功能
CI2.x 加入連線 redis 的功能
 
Linux系统工程师教程
Linux系统工程师教程Linux系统工程师教程
Linux系统工程师教程
 
開發人員不可不知的 Windows Container 容器技術預覽
開發人員不可不知的 Windows Container 容器技術預覽開發人員不可不知的 Windows Container 容器技術預覽
開發人員不可不知的 Windows Container 容器技術預覽
 
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
A brief introduction to Vagrant – 原來 VirtualBox 可以這樣玩
 

Windows 标准化部署工具使用详解

  • 1. Windows 标准化部署工具使用详解 2017.05 | 苏繁 Windows 10 Upgrade Ready Part 3
  • 2. 课程安排 1. Windows 10 v1703 • BCDBOOT.exe • MBR2GPT.exe • PNPUTIL.exe • SYSPREP.exe • DISM.exe and IMAGEX.exe 2. Windows ADK v1703 • Windows System Image Manager(SIM) • Windows Imaging and Configuration Designer(ICD) • Windows Preinstallation Environment(Windows PE) • User State Migration Tool(USMT)
  • 3. BCDBoot.exe • BCDBoot 是用于管理系统分区文件的命令行工具,可在以下方案 中使用此工具: • 部署新电脑时设置系统分区上的启动文件。 • 设置 Windows 以启动到 VHD 文件。 • 修复系统分区 • 设置或修复双启动电脑上的启动菜单。 • BCDBoot.exe 位于 %WINDIR%System32 • BCDBoot 支持 Windows 7 及之后的系统版本 • 从C:Windows拷贝支持BIOS和UEFI的简体中文启动文件到F: • Bcdboot c:windows /s F: /f ALL /l zh-cn
  • 4. MBR2GPT.exe • 用于 MBR 到 GPT 就地转换,可将基于 BIOS 启动的 Windows 10 v1703 无损转换为 UEFI 启动。 • 支持在线模式,命令行参考: Mbr2gpt.exe /convert /allowfullos • 需确保当前系统分区少于4个。
  • 5. Pnputil.exe • Pnputil 可用于管理驱动程序存储区,使用 Pnputil 将驱动程序包 添加、删除到存储区或列出存储区内的驱动程序。 • 常用命令行: • Pnputil -a c:driversusbcam.inf ->添加驱动 • Pnputil -i -a c:drivers*.inf ->添加和安装驱动 • Pnputil -e ->枚举所有第三方程序包 • Pnputil -f -d oem0.inf ->强制删除程序包 oem0.inf • 在 Windows 10 v1703 中 Pnputil 参数得到增强和改进
  • 6. Sysprep.exe • Sysprep 系统准备工具,要将 Windows 映像部署到不同的电脑, 必须使用系统准备工具对当前映像进行一般化处理。 • 参考命令行: • Sysprep /quiet /generalize /oobe /shutdown /unattend:unattend.xml 参考资料: https://msdn.microsoft.com/zh-cn/library/hh825084.aspx
  • 7. DISM.exe and ImageX.exe • DISM 和 ImageX 都是 Windows 部署映像服务和管理工具。 • DISM 从Windows 8 开始完全替代 ImageX,并内置于系统中。 • DISM 提供全局、脱机和在线,三种模式参数。 参考资料: https://msdn.microsoft.com/zh-cn/library/hh825258.aspx https://msdn.microsoft.com/zh-cn/library/hh825079.aspx https://msdn.microsoft.com/zh-cn/library/hh825236.aspx https://msdn.microsoft.com/zh-cn/library/hh824821.aspx
  • 8. DISM优势 • 捕获和应用 Windows 映像 • 在 .wim 文件中附加和删除映像 • 将 .wim 文件拆分成几个小文件 • 添加、删除和枚举程序包 • 添加、删除和枚举驱动程序 • 启用或禁用 Windows 功能 • 应用 Unattend.xml 的 offlineServicing 部分的更改 • 配置国际设置 • 将 Windows 映像升级到其他版本 • 准备 Windows PE 映像
  • 9. DISM 映像服务常用参数 • 将 Windows 映像从 .wim 文件装载到指定目录 • Dism /mount-image /imagefile:e:sourcesinstall.wim /index:1 /mountdir:c:mountoffline • 卸载 .wim文件并提交或放弃装载映像时所作的更改 • Dism /unmount-image /mountdir:c:mountoffline /commit (or /discard) • 查看 Windows 映像 .wim 信息 • Dism /get-wiminfo /wimfile:e:sourcesinstall.wim • 将某个分区或目录的映像捕获到新的 .wim 文件 • Dism /capture-image /imagefile:d:backupwin10x64.wim /capturedir:c: /name:Drive-C-Win10x64 • 将映像 .wim 应用于指定分区或目录位置 • Dism /apply-image /imagefile:e:sourcesinstall.wim /index:1 /applydir:c: • 将附加映像添加到 .wim 文件中 • Dism /append-image /imagefile:d:backupwin10x64.wim /capturedir:f: /name:Drive-F
  • 10. DISM 驱动和程序服务常用参数 • 向映像添加驱动 • Dism /image:c:testoffline /add-driver /driver:d:drivers /recurse • 显示映像的所有驱动信息 • Dism /online /get-drivers • 删除映像中的驱动 • Dism /image:c:testoffline /remove-driver /driver:oem1.inf • 向映像添加程序包 • Dism /image:c:testoffline /add-package /packagepath:d:msufilename.msu • 显示映像中特定功能状态 • Dism /online /get-features |more • 启用映像中的特定功能 • Dism /online /enable-feature /featurename:telnetclient
  • 11. DISM 其他常用参数 - Windows 10 • 导出默认应用程序关联 • Dism /online /export-defaultappassociations:c:appassoc.xml • 导入默认应用程序关联 • Dism /online /import-defaultappassociations:c:appassoc.xml • 删除默认应用程序关联 • Dism online /remove-defaultappassociations • 修复损坏的系统组件库,并阻止访问WU • Dism /online /cleanup-image /restorehealth /source:c:testmountwindows /limitaccess • 清理映像组件库 • Dism /online /cleanup-image /startcomponentcleanup /resetbase
  • 12. WSIM • WSIM,Windows 系统映像管理器可在图形界面下创建和管理无 人参与的 Windows 安装程序应答文件。 • 应为 x86 和 x64 的系统映像生成对应的无人应答文件。 • 无人应答文件需要进行验证和测试。 参考资料: https://msdn.microsoft.com/zh-cn/library/hh824914.aspx https://msdn.microsoft.com/zh-cn/library/hh824845.aspx
  • 14. 使用 WSIM 处理自动化安装 • 将应答文件命名为AutoUnattend.xml 存储到 UFD • 需要自动化处理的两个阶段: • [Windows PE] • 语言和区域 Microsoft-Windows-International-Core-WinPE | SetupUILanguage • 安装 Windows Microsoft-Windows-Setup | ImageInstall | OSImage • 许可条款 Microsoft-Windows-Setup | UserData | AcceptEula • 准备磁盘 Microsoft-Windows-Setup | DiskConfiguration | Disk • [OobeSystem] • 用户名 Microsoft-Windows-Shell-Setup | AutoLogon • 计算机名 [Specialize] Microsoft-Windows-Shell-Setup | ComputerNanme • 用户密码 Microsoft-Windows-Shell-Setup | UserAccounts | AdministratorPassword • 产品密钥 [Windows PE] Microsoft-Windows-Setup | UserData | ProductKey • 系统保护 Microsoft-Windows-Shell-Setup | OOBE | ProtectYourPC • 时区 Microsoft-Windows-Shell-Setup | TimeZone • 网络位置 Microsoft-Windows-Shell-Setup | OOBE | NetworkLocation 参考资料: https://msdn.microsoft.com/zh-cn/library/hh825162.aspx https://msdn.microsoft.com/zh-cn/library/hh825198.aspx
  • 16. WPE • WPE - Windows 预安装环境,一个基于 Windows 内核的具有优先服 务的最小 Win32 操作系统,可用于Windows 的安装、部署服务、系 统管理服务、Windows恢复等场景。 • WPE 包含在 Windows AIK/ADK 中,可根据用户需求进行自定义。 • 支持多种磁盘格式 • 支持网络共享访问 • 支持 32位或64位 • 提供有限的 Windows 组件和功能支持 • 支持从各种媒介启动,包括:CD、DVD、UFD、HDD、WDS • Windows PE 默认以 RAM 方式启动 参考资料: https://technet.microsoft.com/zh-cn/library/cc766093(v=ws.10).aspx https://msdn.microsoft.com/zh-cn/windows/hardware/commercialize/manufacture/desktop/winpe-intro
  • 17. WPE 相关操作• 创建自定义 WPE 环境 • Copype amd64 C:winpe_amd64 • 创建 UFD 引导 或 ISO • Makewinpemedia /ufd C:winpe_amd64 U: • Makewinpemedia /iso C:winpe_amd64 C:winpe_amd64winpe_amd64.iso • 装载和卸载已更改的 WPE 启动映像 • Dism /mount-image /imagefile:”c:winpe_amd64mediasourcesboot.wim” /index:1 /mountdir:”c:winpe_amd64mount” • Dism /unmount /mountdir:”c:winpe_amd64mount” /commit • 为 WPE 添加驱动 • Dism /add-driver /image:”c:winpe_amd64mount” /driver:”c:driversdriver.inf” • 为 WPE 添加组件或语言支持 • Dism /add-package /image:”c:winpe_amd64mount” /packagepath:"C:Program Files (x86)Windows Kits10Assessment and Deployment KitWindows Preinstallation Environmentamd64WinPE_OCsWinPE-PowerShell.cab“ • Dism /add-package /image:”c:winpe_amd64mount” /packagepath:"C:Program Files (x86)Windows Kits10Assessment and Deployment KitWindows Preinstallation Environmentamd64WinPE_OCszh-cnlp.cab“ • Dism /image:”c:winpe_amd64mount” /set-allintl:zh-cn • 替换 WPE 背景图片 • 替换”c:winpe_amd64mountwindowssystem32winpe.jpg” • 设置 WPE 以高性能模式运行 • 修改“c:winpe_amd64mountwindowssystem32startnet.cmd” • 在 winpeinit 下增加一行 powercfg /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
  • 18. WICD • WICD - Windows映像和配置设置器,用于简化 Windows 映像的自定义和预配。 • WICD 支持 Windows 10 • 使用场景: 如果你是一位: 并对以下内容感兴趣: 使用: 系统组装商或 OEM 在新的桌面和移动设备上配置并应用 Windows 映像 使用 Windows ICD 创建完整映像媒体(USB、 网络、USB Tethering) 小型组织 自定义新的桌面和移动设备 使用 Windows ICD 创建设置包 在新的桌面设备上配置并应用 Windows 映像 使用 Windows ICD 创建完整映像媒体(USB、 网络、USB Tethering) 中型组织 在新的或现有的桌面设备上创建和部署自定义 Windows 映像 用于创建和部署自定义映像(USB、网络、 Windows 部署服务 (WDS) 或预启动执行环境 (PXE))的 Microsoft 部署工具包 在新的桌面设备上配置并应用 Windows 映像 使用 Windows ICD 创建设置包 自定义移动设备 使用 Windows ICD 创建设置包 大型组织 在新的或现有的桌面映像上创建和部署自定义 Windows 映像 使用 MDT 和/或配置管理器创建和部署自定义 映像(USB、网络、WDS/PXE/多播) 自定义新的桌面和移动设备 使用 Windows ICD 创建设置包
  • 19. USMT • USMT - 用户状态迁移工具,可提供高度自定义的用户配置文件迁移体验。 • 包含两个组件:ScanState, LoadState • 支持多种迁移定义:MigApp.xml、MigUser.xml、MigDocs.xml、Config.xml 以及自定义名称的 .xml 文件。 • 不要同时使用 MigUser.xml 和 MigDocs.xml • 非标用户配置使用 MigDocs.xml 可获得更好的体验。 • 迁移前后不要运行程序,LoadState 后应注销。 参考资料: https://msdn.microsoft.com/zh-cn/library/hh824805.aspx https://msdn.microsoft.com/zh-cn/library/hh825256.aspx https://msdn.microsoft.com/zh-cn/library/hh825026.aspx https://msdn.microsoft.com/zh-cn/library/hh824928.aspx https://msdn.microsoft.com/zh-cn/library/hh825093.aspx
  • 20. USMT 相关操作 • 迁移计算机 • 源计算机: • scanstate servermigrationmystore /config:config.xml /i:migdocs.xml /i:migapp.xml /v:13 /l:scan.log • 目标计算机: • loadstate servermigrationmystore /config:config.xml /i:migdocs.xml /i:migapp.xml /v:13 /l:load.log • 迁移两个域账户(User1 和 User2) • 源计算机: • scanstate servershareusmtmystore /ue:** /ui:contosouser1 /ui:corpuser2 /i:migdocs.xml /i:migapp.xml /o • 目标计算机: • Loadstate servershareusmtmystore /i:migdocs.xml /i:migapp.xml • 从压缩 USMT 迁移存储中提取文件 • Usmtutils /extract d:usmtstore.img d:extstore