在组织中部署 Windows To Go (Windows 10)

您所在的位置:网站首页 window10部署已用时间 在组织中部署 Windows To Go (Windows 10)

在组织中部署 Windows To Go (Windows 10)

2023-09-22 20:05| 来源: 网络整理| 查看: 265

在组织中部署 Windows To Go 项目 03/18/2023

适用于:

Windows 10

本文可帮助你在组织中部署 Windows To Go。 在开始部署之前,请确保已查看文章 Windows To Go:功能概述 和 为组织准备 Windows To Go ,以确保你拥有正确的硬件并准备好完成部署。 然后,可以使用本文中的步骤启动 Windows To Go 部署。

重要提示

Windows 10 版本2004及更高版本的操作系统中删除了 Windows To Go。 该功能不支持功能更新,因此不能让你保持最新。 它还需要许多 OEM 不再支持的特定类型的 USB。

部署提示

以下列表是在开始部署过程之前应注意的项:

仅对 Windows To Go 使用推荐的 U 盘。 不支持使用其他驱动器。 查看 Windows To Go:功能概述 中的列表,了解已认证用作 Windows To Go 驱动器的最新 USB 驱动器。

预配新工作区后,始终使用可在通知区域或 Windows 资源管理器中找到的 “安全删除硬件”和“弹出媒体 ”控件弹出 Windows To Go 驱动器。 从 USB 端口中删除驱动器而不先弹出驱动器可能会导致驱动器损坏。

运行 Windows To Go 工作区时,始终在拔出驱动器之前关闭工作区。

Configuration Manager SP1 及更高版本包括对 Windows To Go 驱动器的用户自行预配的支持。 有关此部署选项的详细信息,请参阅如何在 Configuration Manager 中预配 Windows To Go。

如果你打算使用 U 盘复制器复制 Windows To Go 驱动器,请不要在驱动器上配置脱机域加入或 BitLocker。

基本部署步骤

除非使用自定义的操作系统映像,否则初始 Windows To Go 工作区不会加入域,并且不会包含应用程序。 这与台式机或笔记本电脑上的 Windows 新安装完全相同。 规划部署时,应开发将 Windows to Go 驱动器加入域的方法,并安装组织中的用户所需的标准应用程序。 这些方法可能类似于用于设置具有域特权和应用程序的台式机和笔记本电脑的方法。 本部分介绍在 U 盘上创建正确的磁盘布局、将操作系统映像和核心 Windows To Go 特定配置应用到驱动器的说明。 以下步骤在小型和大规模 Windows To Go 部署方案中都使用。

完成这些步骤将为你提供一个通用的 Windows To Go 驱动器,该驱动器可以分发给用户,然后根据需要对其进行自定义。 此驱动器也适用于 USB 驱动器复制器。 你的特定部署方案不仅涉及这些基本步骤,还涉及这些额外的部署注意事项与传统的电脑部署类似,并且可以合并到 Windows To Go 部署计划中。 有关详细信息,请参阅 Windows 部署选项。

警告

如果你计划使用通用 Windows To Go 驱动器作为 USB 复制器中的主驱动器,则不应启动该驱动器。 如果驱动器已无意中启动,则应在重复之前重新预配该驱动器。

创建 Windows To Go 工作区

在此步骤中,我们将创建将在 Windows To Go 驱动器上使用的操作系统映像。 可以使用 Windows To Go Creator 向导,也可以使用Windows PowerShell和命令行工具的组合手动执行此操作。

警告

创建单个 Windows To Go 驱动器的首选方法是使用 Windows 10 企业版 和 Windows 10 教育版 中包含的 Windows To Go Creator 向导。

使用 Windows To Go Creator 向导创建 Windows To Go 工作区

使用具有管理员权限的帐户登录到 Windows 电脑。

将要用作 Windows To Go 驱动器的 USB 驱动器插入电脑。

验证.wim文件位置 ((可以是网络共享、DVD 或 U 盘) )是否可访问,以及它是否包含使用 sysprep 通用化的有效Windows 10 企业版或Windows 10 教育版映像。 许多环境可以对 Windows To Go 和桌面部署使用相同的映像。

注意

有关文件的详细信息 .wim ,请参阅 Windows 系统映像管理器 (Windows SIM) 技术参考。 有关使用 sysprep 的详细信息,请参阅 Sysprep 概述。

搜索 “Windows To Go ”,然后按 Enter。 如果出现“ 用户帐户控制 ”对话框,请确认其显示的操作是所需操作,然后选择“ 是”。 Windows To Go Creator 向导 随即打开。

在 “选择要使用的驱动器 ”页上,选择代表之前插入的 U 盘的驱动器,然后选择“ 下一步”。

在 “选择 Windows 图像 ”页上,选择“ 添加搜索位置 ”, .wim 然后导航到文件位置并选择文件夹。 向导将显示 文件夹中存在的可安装映像;选择要使用的Windows 10 企业版或Windows 10 教育版图像,然后选择“下一步”。

(可选) 在 “设置 BitLocker 密码 (可选) ”页上,可以选择“ 将 BitLocker 与我的 Windows To Go 工作区配合使用 ”来加密 Windows To Go 驱动器。 如果此时不希望加密驱动器,请选择“ 跳过”。 如果你决定稍后添加 BitLocker 保护,有关说明,请参阅 为 Windows To Go 驱动器启用 BitLocker 保护。

警告

如果计划使用USB-Duplicator创建多个 Windows To Go 驱动器,请不要启用 BitLocker。 不应复制受 BitLocker 保护的驱动器。

如果选择立即加密 Windows To Go 驱动器,请输入一个密码,该密码长度至少为 8 个字符,并且符合组织的密码复杂性策略。 此密码将在操作系统启动之前提供,因此固件必须能够解释你使用的任何字符。 某些固件不支持非 ASCII 字符。

重要提示

BitLocker 恢复密码将保存在用于自动创建工作区的计算机的文档库中。 如果组织使用 Active Directory 域服务 (AD DS) 来存储恢复密码,则它还将保存在用于创建工作区的计算机的计算机帐户下的 AD DS 中。 仅当需要恢复对驱动器的访问权限时,才会使用此密码,因为上一步中指定的 BitLocker 密码不可用,例如密码丢失或忘记。 有关 BitLocker 和 AD DS 的详细信息,请参阅Active Directory 域服务注意事项。

验证插入的 U 盘是否是要为 Windows To Go 预配的 U 盘,然后选择“ 创建 ”以启动 Windows To Go 工作区创建过程。

警告

标识的 USB 驱动器将作为 Windows To Go 预配过程的一部分重新格式化,并且驱动器上的所有数据都会被清除。

等待创建过程完成,这可能需要 20 到 30 分钟。 将显示一个完成页,告知你何时可以使用 Windows To Go 工作区。 在完成页中,你可以配置 Windows To Go 启动选项,将当前计算机配置为 Windows To Go 主计算机。

Windows To Go 工作区现已准备好启动。 你现在可以使用 Windows To Go 启动选项 准备主计算机 ,并启动 Windows To Go 驱动器。

Windows PowerShell等效命令

以下Windows PowerShell cmdlet 或 cmdlet 执行与前面的过程相同的功能。 在单行上输入每个 cmdlet,即使由于格式限制,它们可能显示为多行换行。 此过程只能在运行Windows 10的电脑上使用。 在开始之前,请确保只有要预配为 Windows To Go 驱动器的 U 盘已连接到电脑。

搜索 powershell,右键单击“Windows PowerShell”,然后选择“以管理员身份运行”。

在Windows PowerShell会话中,输入以下命令,将主启动记录分区 (MBR) 磁盘,以便与 FAT32 系统分区和 NTFS 格式的操作系统分区配合使用。 此磁盘布局可以支持使用 UEFI 或 BIOS 固件的计算机:

展开以显示用于对 MBR 磁盘进行分区的 PowerShell 命令 # The following command will set $Disk to all USB drives with >20 GB of storage $Disk = Get-Disk | Where-Object {$_.Path -match "USBSTOR" -and $_.Size -gt 20Gb -and -not $_.IsBoot } #Clear the disk. This will delete any data on the disk. (and will fail if the disk is not yet initialized. If that happens, simply continue with 'New-Partition…) Validate that this is the correct disk that you want to completely erase. # # To skip the confirmation prompt, append -confirm:$False Clear-Disk -InputObject $Disk[0] -RemoveData # This command initializes a new MBR disk Initialize-Disk -InputObject $Disk[0] -PartitionStyle MBR # This command creates a 350 MB system partition $SystemPartition = New-Partition -InputObject $Disk[0] -Size (350MB) -IsActive # This formats the volume with a FAT32 Filesystem # To skip the confirmation dialog, append -Confirm:$False Format-Volume -NewFileSystemLabel "UFD-System" -FileSystem FAT32 ` -Partition $SystemPartition # This command creates the Windows volume using the maximum space available on the drive. The Windows To Go drive should not be used for other file storage. $OSPartition = New-Partition -InputObject $Disk[0] -UseMaximumSize Format-Volume -NewFileSystemLabel "UFD-Windows" -FileSystem NTFS ` -Partition $OSPartition # This command assigns drive letters to the new drive, the drive letters chosen should not already be in use. Set-Partition -InputObject $SystemPartition -NewDriveLetter "S" Set-Partition -InputObject $OSPartition -NewDriveLetter "W" # This command sets the NODEFAULTDRIVELETTER flag on the partition which prevents drive letters being assigned to either partition when inserted into a different computer. Set-Partition -InputObject $OSPartition -NoDefaultDriveLetter $TRUE

接下来,你需要将想要与 Windows To Go 一起使用的操作系统映像应用到你在磁盘上创建的操作系统分区 (这可能需要 30 分钟或更长时间,具体取决于映像的大小和 USB 连接) 的速度。 以下命令演示如何使用 部署映像服务和管理 命令行工具 (DISM) 完成此操作:

提示

索引号必须正确设置为文件中有效的企业映像 .wim 。

#The WIM file must contain a sysprep generalized image. dism.exe /apply-image /imagefile:n:\imagefolder\deploymentimages\mywtgimage.wim /index:1 /applydir:W:\

现在,使用 bcdboot 命令行工具将必要的启动组件移动到磁盘上的系统分区。 这有助于确保启动组件、操作系统版本和体系结构匹配。 参数 /f ALL 指示 UEFI 和 BIOS 的启动组件应放置在磁盘的系统分区上。 以下示例演示了此步骤:

W:\Windows\System32\bcdboot.exe W:\Windows /f ALL /s S:

应用 SAN 策略-OFFLINE_INTERNAL-“4”,以防止操作系统自动使任何内部连接的磁盘联机。 这是通过在磁盘上创建和保存 san_policy.xml 文件来完成的。 以下示例演示了此步骤:

展开以显示示例san_policy.xml文件 4 4

将上一步中创建 的san_policy.xml 文件放入 Windows To Go 驱动器 (W 上的 Windows 分区根目录) 并运行以下命令:

Dism.exe /Image:W:\ /Apply-Unattend:W:\san_policy.xml

创建一个应答文件 (unattend.xml) ,以禁用 Windows 恢复环境与 Windows To Go 配合使用。 可以使用以下代码示例创建新的应答文件,也可以将其粘贴到现有应答文件中:

展开以显示示例san_policy.xml文件 true true

保存应答文件后,将复制到 unattend.xml Windows To Go 驱动器上的 sysprep 文件夹中, (例如, W:\Windows\System32\sysprep\)

重要提示

安装程序会根据其位置处理无人参与文件。 安装程序会将临时无人参与文件放入文件夹中,%systemroot%\panther该文件夹是安装程序将检查安装信息的第一个位置。 应确保该文件夹不包含以前版本的 unattend.xml 文件,以确保使用刚刚创建的文件。

如果你不希望在此计算机上启动 Windows To Go 设备,并且想要删除它以在另一台电脑上启动它,请务必使用 “安全删除硬件和弹出媒体 ”选项安全地断开驱动器的连接,然后再从电脑中物理删除驱动器。

Windows To Go 工作区现已准备好启动。 现在,可以使用 Windows To Go 启动选项 准备主计算机 ,以测试工作区配置、 配置工作区以加入脱机域或 为 Windows To Go 驱动器启用 BitLocker 保护。

准备主计算机

运行 Windows 8 及更高版本的计算机可以配置为主机计算机,只要 Windows To Go 工作区在启动时可用,就会自动使用 Windows To Go。 在主计算机上启用 Windows To Go 启动选项时,每当 Windows To Go 驱动器附加到计算机时,Windows 就会将启动转移到该驱动器。 这样,可以轻松地从使用主计算机切换到使用 Windows To Go 工作区。

提示

如果你将使用运行 Windows 7 的电脑作为主计算机,请参阅 有关配置 BIOS 设置以使用 Windows To Go 的提示 ,了解帮助你准备主计算机的信息。

如果要使用 Windows To Go 工作区,请关闭计算机,插入 Windows To Go 驱动器,然后打开计算机。 若要使用主计算机,请关闭 Windows To Go 工作区,拔下 Windows To Go 驱动器,然后打开计算机。

若要为运行Windows 10的主机计算机设置 Windows To Go 启动选项,请执行以下操作:

搜索 “Windows To Go”启动选项 ,然后按 Enter。

在“ Windows To Go 启动选项 ”对话框中,选择“ 是”,然后选择“ 保存更改 ”,将计算机配置为从 USB 启动

对于运行 Windows 8 或 Windows 8.1 的主机计算机:

按 Windows 徽标键+W,搜索 “Windows To Go”启动选项,然后按 Enter。

在 “Windows To Go 启动选项 ”对话框中,选择“ 是”,然后选择“ 保存更改 ”,将计算机配置为从 USB 启动。

可以通过启用以下组策略设置,将组织的计算机配置为从 U 盘自动启动:

计算机配置>管理模板>Windows 组件>可移植操作系统>Windows To Go 默认启动选项

启用此策略设置后,当 USB 驱动器连接到计算机时,将尝试自动启动 Windows To Go 工作区。 用户无法使用 Windows To Go 启动选项来更改此行为。 如果禁用此策略设置,除非用户在固件中手动配置选项,否则在 USB 驱动器连接时不会启动到 Windows To Go。 如果未配置此策略设置,属于管理员组成员的用户可以使用 Windows To Go 启动选项启用或禁用从 U 盘启动。

现在,当在启动计算机之前插入主机时,主计算机已准备好直接启动到 Windows To Go 工作区。 (可选)可以执行 配置 Windows To Go 工作区以加入脱机域 ,并为 Windows To Go 驱动器启用 BitLocker 保护。

启动 Windows To Go 工作区

将主机电脑配置为从 USB 启动后,可以使用以下过程启动 Windows To Go 工作区:

若要启动工作区,请执行以下操作:

确保主机电脑未处于睡眠状态。 如果计算机处于睡眠状态,请将其关闭或休眠。

将 Windows To Go U 盘直接插入电脑上的 USB 3.0 或 USB 2.0 端口。 请勿使用 USB 集线器或扩展器。

打开电脑。 如果 Windows To Go 驱动器受 BitLocker 保护,系统会要求输入密码,否则工作区将直接启动到 Windows To Go 工作区。

高级部署步骤

以下步骤用于更高级的部署,在这些部署中,你希望进一步控制 Windows To Go 驱动器的配置,确保它们已正确配置为远程访问组织资源,并且已使用 BitLocker 驱动器加密进行保护。

配置用于远程访问的 Windows To Go 工作区

确保 Windows To Go 工作区在非本地使用时有效,这对于成功部署至关重要。 Windows To Go 的主要优势之一是用户能够在企业网络外部的非托管计算机上使用已加入企业托管域的工作区。 若要启用此用法,通常需要按照基本部署说明中所述预配 U 盘,然后添加配置以支持工作区的域加入、安装任何业务线应用程序以及配置所选远程连接解决方案(如虚拟专用网络客户端或 DirectAccess)。 执行这些配置后,用户可以使用本地计算机在工作区中工作。 通过以下过程,可为对公司网络没有物理访问权限的辅助角色预配已加入域的 Windows To Go 工作区。

远程访问方案的先决条件:

已加入域的计算机运行Windows 8或更高版本,并配置为 Windows To Go 主计算机

尚未使用无人参与设置启动或加入域的 Windows To Go 驱动器。

有权将计算机帐户添加到域的域用户帐户,并且是 Windows To Go 主计算机上的管理员组的成员

在域上配置的 DirectAccess

若要为远程访问配置 Windows To Go 工作区,请执行以下操作:

启动主计算机,并使用具有将工作站添加到域的权限的用户帐户登录,然后从提升的命令提示符运行以下命令,将示例占位符参数替换为适用于你的环境的占位符参数 () 表示:

djoin.exe /provision /domain /machine /certtemplate /policynames /savefile /reuse

注意

/certtemplate 参数支持使用证书模板为 DirectAccess 分发证书,如果组织未使用证书模板,则可以省略此参数。 此外,如果与基于 Windows Server 2008 的域控制器一 djoin.exe 起使用,请在预配期间追加 /downlevel 开关。 有关详细信息,请参阅 脱机域加入分步指南。

插入 Windows To Go 驱动器。

在任务栏中右键单击Windows PowerShell快捷方式,然后单击“以管理员身份运行”,启动提升的Windows PowerShell提示。

在Windows PowerShell命令提示符下运行:

展开此部分以显示要运行的 PowerShell 命令 # The following command will set $Disk to all USB drives with >20 GB of storage $Disk = Get-Disk | Where-Object {$_.Path -match "USBSTOR" -and $_.Size -gt 20Gb -and -not $_.IsBoot } #Clear the disk. This will delete any data on the disk. (and will fail if the disk is not yet initialized. If that happens, simply continue with 'New-Partition…) Validate that this is the correct disk that you want to completely erase. # # To skip the confirmation prompt, append -confirm:$False Clear-Disk -InputObject $Disk[0] -RemoveData # This command initializes a new MBR disk Initialize-Disk -InputObject $Disk[0] -PartitionStyle MBR # This command creates a 350 MB system partition $SystemPartition = New-Partition -InputObject $Disk[0] -Size (350MB) -IsActive # This formats the volume with a FAT32 Filesystem # To skip the confirmation dialog, append -Confirm:$False Format-Volume -NewFileSystemLabel "UFD-System" -FileSystem FAT32 ` -Partition $SystemPartition # This command creates the Windows volume using the maximum space available on the drive. The Windows To Go drive should not be used for other file storage. $OSPartition = New-Partition -InputObject $Disk[0] -UseMaximumSize Format-Volume -NewFileSystemLabel "UFD-Windows" -FileSystem NTFS ` -Partition $OSPartition # This command assigns drive letters to the new drive, the drive letters chosen should not already be in use. Set-Partition -InputObject $SystemPartition -NewDriveLetter "S" Set-Partition -InputObject $OSPartition -NewDriveLetter "W" # This command toggles the NODEFAULTDRIVELETTER flag on the partition which prevents drive letters being assigned to either partition when inserted into a different computer. Set-Partition -InputObject $OSPartition -NoDefaultDriveLetter $TRUE

接下来,你需要将想要与 Windows To Go 一起使用的操作系统映像应用到你在磁盘上创建的操作系统分区 (这可能需要 30 分钟或更长时间,具体取决于映像的大小和 USB 连接) 的速度。 以下命令演示如何使用 部署映像服务和管理 命令行工具 (DISM) 完成此操作:

#The WIM file must contain a sysprep generalized image. dism.exe /apply-image /imagefile:n:\imagefolder\deploymentimages\mywtgimage.wim /index:1 /applydir:W:\

提示

索引号必须正确设置为文件中有效的企业映像 .wim 。

完成这些命令后,运行以下命令:

djoin.exe /requestodj /loadfile C:\example\path\domainmetadatafile /windowspath W:\Windows

接下来,我们需要编辑unattend.xml文件,以配置第一次运行 (OOBE) 设置。 在此示例中,我们将隐藏 Microsoft 软件许可条款 (EULA) 页,将自动更新配置为自动安装重要更新和建议更新,并将此工作区标识为专用办公网络的一部分。 如果需要,可以使用为组织配置的其他 OOBE 设置。 有关 OOBE 设置的详细信息,请参阅 OOBE:

展开此部分以显示示例unattend.xml文件 true true 1 Work true true 1 Work

安全删除 Windows To Go 驱动器。

从本地或非本地主机启动计算机并启动 Windows To Go 工作区。

如果在本地使用具有直接网络连接的主计算机,请使用域凭据登录。

如果在本地,请使用 Internet 访问加入有线或无线网络,然后使用域凭据再次登录。

注意

根据 DirectAccess 配置,系统可能会要求插入智能卡以登录到域。

现在,你应该能够访问组织的网络资源,并从 Windows To Go 工作区中工作,就像通常在本地标准台式计算机一样。

为 Windows To Go 驱动器启用 BitLocker 保护

在 Windows To Go 驱动器上启用 BitLocker 将有助于确保数据不受未经授权的使用,如果 Windows To Go 驱动器丢失或被盗,未经授权的人员将不容易获取机密数据或使用工作区获取对组织中受保护资源的访问权限。 启用 BitLocker 后,每次启动 Windows To Go 驱动器时,系统都会要求你提供 BitLocker 密码来解锁驱动器。 以下过程提供了在 Windows To Go 驱动器上启用 BitLocker 的步骤:

启用 BitLocker 方案的先决条件

可以成功预配的 Windows To Go 驱动器。

运行Windows 8配置为 Windows To Go 主计算机的计算机

查看以下 BitLocker 驱动器加密组策略设置,并根据需要修改配置:

Windows 组件>BitLocker 驱动器加密>操作系统驱动器>启动时需要其他身份验证

此策略允许将密码密钥保护程序用于操作系统驱动器;必须启用此策略才能从 Windows To Go 工作区中配置 BitLocker。 通过此策略设置,可以配置每次计算机启动时 BitLocker 是否需要其他身份验证,以及是否使用具有受信任的平台模块的 BitLocker (TPM) 。 必须启用此设置,并选择“允许 BitLocker 不使用兼容的 TPM 检查”框,然后启用“配置对操作系统驱动器使用密码”设置。

Windows 组件>BitLocker 驱动器加密>操作系统驱动器>为操作系统驱动器配置密码的使用

此策略设置允许使用密码解锁受 BitLocker 保护的操作系统驱动器,并提供对 Windows To Go 工作区的密码配置复杂性和长度要求的方法。 若要使复杂性要求设置生效,组策略设置密码必须满足计算机配置>中的复杂性要求Windows 设置>安全设置>帐户策略>密码策略也必须启用。

Windows 组件>BitLocker 驱动器加密>操作系统驱动器>允许使用 BitLocker 身份验证,要求在平板电脑上预启动键盘输入

此策略设置允许用户启用需要预启动环境中用户输入的身份验证选项,即使平台指示缺少预启动输入功能也是如此。 如果未启用此设置,则密码不能用于解锁受 BitLocker 保护的操作系统驱动器。

在预配过程中,可以选择在 Windows To Go 驱动器上启用 BitLocker 保护,然后再将其分发给用户,也可以允许最终用户在拥有驱动器后向其应用 BitLocker 保护。 这两种方案都提供了分步过程。

在预配期间启用 BitLocker 可确保操作系统映像始终受 BitLocker 保护。 在预配过程中启用 BitLocker 时,可以通过在配置磁盘后和应用映像之前启用 BitLocker 来显著减少加密驱动器所需的时间。 如果使用此方法,则在为用户提供 Windows To Go 工作区时,需要为用户提供 BitLocker 密码。 此外,还应指示用户启动其工作区并尽快更改其 BitLocker 密码, (可以使用标准用户权限) 执行此操作。

在分发后启用 BitLocker 需要用户打开 BitLocker。 这意味着,在用户启用 BitLocker 之前,你的 Windows To Go 工作区将不受保护。 需要 Windows To Go 工作区的管理权限才能启用 BitLocker。 有关 BitLocker 的详细信息,请参阅 BitLocker 概述。

BitLocker 恢复密钥

BitLocker 恢复密钥是在标准解锁方法失败时可用于解锁受 BitLocker 保护的驱动器的密钥。 建议将 BitLocker 恢复密钥备份到Active Directory 域服务 (AD DS) 。 如果不想使用 AD DS 来存储恢复密钥,可以将恢复密钥保存到文件中或打印它们。 BitLocker 恢复密钥的管理方式因何时启用 BitLocker 而异。

如果在预配期间启用了 BitLocker 保护,则 BitLocker 恢复密钥将存储在用于预配驱动器的计算机的计算机帐户下。 如果未使用将恢复密钥备份到 AD DS,则需要打印恢复密钥或将恢复密钥保存到每个驱动器的文件中。 IT 管理员必须跟踪分配给哪个 Windows To Go 驱动器的密钥。

如果在分发后启用了 BitLocker,恢复密钥将备份到工作区的计算机帐户下的 AD DS。 如果未使用将恢复密钥备份到 AD DS,用户可以将其打印或保存到文件中。

警告

如果未使用将恢复密钥备份到 AD DS,并且 IT 管理员希望集中记录恢复密钥,则必须实施用户向 IT 部门提供密钥的过程。

在预配期间启用 BitLocker

启动运行Windows 8的主计算机。

插入 Windows To Go 驱动器。

在任务栏中右键单击Windows PowerShell快捷方式,然后单击“以管理员身份运行”,启动提升的Windows PowerShell提示。

使用以下 cmdlet 预配 Windows To Go 驱动器:

注意

如果使用 手动方法创建工作区, 则应已预配 Windows To Go 驱动器。 如果是这样,可以继续执行下一步。

展开此部分以显示要运行的 PowerShell 命令 # The following command will set $Disk to all USB drives with >20 GB of storage $Disk = Get-Disk | Where-Object {$_.Path -match "USBSTOR" -and $_.Size -gt 20Gb -and -not $_.IsBoot } #Clear the disk. This will delete any data on the disk. (and will fail if the disk is not yet initialized. If that happens, simply continue with 'New-Partition…) Validate that this is the correct disk that you want to completely erase. # # To skip the confirmation prompt, append -confirm:$False Clear-Disk -InputObject $Disk[0] -RemoveData # This command initializes a new MBR disk Initialize-Disk -InputObject $Disk[0] -PartitionStyle MBR # This command creates a 350 MB system partition $SystemPartition = New-Partition -InputObject $Disk[0] -Size (350MB) -IsActive # This formats the volume with a FAT32 Filesystem # To skip the confirmation dialog, append -Confirm:$False Format-Volume -NewFileSystemLabel "UFD-System" -FileSystem FAT32 ` -Partition $SystemPartition # This command creates the Windows volume using the maximum space available on the drive. The Windows To Go drive should not be used for other file storage. $OSPartition = New-Partition -InputObject $Disk[0] -UseMaximumSize Format-Volume -NewFileSystemLabel "UFD-Windows" -FileSystem NTFS ` -Partition $OSPartition # This command assigns drive letters to the new drive, the drive letters chosen should not already be in use. Set-Partition -InputObject $SystemPartition -NewDriveLetter "S" Set-Partition -InputObject $OSPartition -NewDriveLetter "W" # This command toggles the NODEFAULTDRIVELETTER flag on the partition which prevents drive letters being assigned to either partition when inserted into a different computer. Set-Partition -InputObject $OSPartition -NoDefaultDriveLetter $TRUE

接下来,你需要将想要与 Windows To Go 一起使用的操作系统映像应用到你在磁盘上创建的操作系统分区 (这可能需要 30 分钟或更长时间,具体取决于映像的大小和 USB 连接) 的速度。 以下命令演示如何使用 部署映像服务和管理 命令行工具 (DISM) 完成此操作:

提示

索引号必须正确设置为文件中有效的企业映像 .wim 。

#The WIM file must contain a sysprep generalized image. dism.exe /apply-image /imagefile:n:\imagefolder\deploymentimages\mywtgimage.wim /index:1 /applydir:W:\

在同一 PowerShell 会话中,使用以下 cmdlet 将恢复密钥添加到驱动器:

$BitlockerRecoveryProtector = Add-BitLockerKeyProtector W: -RecoveryPasswordProtector

接下来,使用以下 cmdlet 将恢复密钥保存到文件:

#The BitLocker Recovery key is essential if for some reason you forget the BitLocker password #This recovery key can also be backed up into Active Directory using manage-bde.exe or the #PowerShell cmdlet Backup-BitLockerKeyProtector. $RecoveryPassword = $BitlockerRecoveryProtector.KeyProtector.RecoveryPassword $RecoveryPassword > WTG-Demo_Bitlocker_Recovery_Password.txt

然后,使用以下 cmdlet 将密码添加为安全字符串。 如果省略密码,则 cmdlet 会在继续操作之前提示输入密码:

# Create a variable to store the password $spwd = ConvertTo-SecureString -String -AsplainText -Force Enable-BitLocker W: -PasswordProtector $spwd

警告

若要让 BitLocker 仅加密磁盘上的已用空间,请将 参数 -UsedSpaceOnly 追加到 Enable-BitLocker cmdlet。 将数据添加到驱动器时,BitLocker 将加密额外的空间。 使用此参数将加快准备过程,因为较小的磁盘百分比需要加密。 如果处于无法等待加密完成的时间关键情况,还可以在加密过程中安全地删除 Windows To Go 驱动器。 下次将驱动器插入计算机时,它将请求 BitLocker 密码。 提供密码后,加密过程将继续。 如果执行此操作,请确保用户知道 BitLocker 加密仍在处理中,并且能够在加密在后台完成时使用工作区。

复制数字恢复密码并将其保存到安全位置的文件中。 如果密码丢失或忘记,则需要恢复密码。

警告

如果“选择如何恢复 BitLocker 保护的可移动数据驱动器组策略”设置已配置为将恢复信息备份到Active Directory 域服务,则驱动器的恢复信息将存储在用于应用恢复密钥的主计算机的帐户下。

如果要将恢复信息存储在 Windows To Go 工作区的帐户下,可以使用 BitLocker 安装向导从 Windows To Go 工作区中转 BitLocker 控制面板项中的 BitLocker,如在分发后启用 BitLocker 中所述。

安全删除 Windows To Go 驱动器。

Windows To Go 驱动器现在已准备好分发给用户,并受 BitLocker 保护。 分发驱动器时,请确保用户知道以下信息:

启动驱动器所需的初始 BitLocker 密码。

当前加密状态。

初始启动后更改 BitLocker 密码的说明。

说明如何在必要时检索恢复密码。 这些说明可能是技术支持过程、自动密码检索站点或联系人。

在分发后启用 BitLocker

将 Windows To Go 驱动器插入当前关闭) 的主计算机 (,然后打开计算机并启动到 Windows To Go 工作区

按 Windows 徽标键+W 打开 “搜索设置”,键入 BitLocker,然后选择 BitLocker 驱动器加密项。

显示工作区上的驱动器,为 C: 驱动器选择“ 打开 BitLocker ”。 此时会显示 BitLocker 安装向导 。

完成 BitLocker 安装向导 中的步骤,选择密码保护选项。

注意

如果尚未配置组策略设置 Windows 组件>BitLocker 驱动器加密>操作系统驱动器>需要在启动时进行其他身份验证,以指定允许 BitLocker 没有兼容的 TPM,则将无法从 Windows To Go 工作区中启用 BitLocker。

高级部署示例脚本

以下示例脚本支持预配多个 Windows To Go 驱动器和脱机域加入的配置。

示例脚本创建一个无人参与文件,该文件可简化部署过程,以便初始使用 Windows To Go 驱动器不会在启动前提示最终用户提供任何其他配置信息。

运行高级部署示例脚本的先决条件

若要运行此示例脚本,必须使用有权创建域帐户的帐户从已加入域的计算机以管理员身份打开Windows PowerShell会话。

此脚本需要使用脱机域加入,因为该脚本不会创建本地管理员用户帐户。 但是,域成员身份会自动将“域管理员”放入本地管理员组。 查看域策略。 如果使用 DirectAccess,则需要修改 djoin.exe 命令以包括 policynames 和 参数 certtemplate 。

脚本需要使用驱动器号,因此只能预配可用驱动器号的一半的驱动器。

运行高级部署示例脚本

将标题为“Windows To Go 多驱动器预配示例脚本”的整个代码示例复制到 PowerShell 脚本 (.ps1) 文件中。

进行必要的修改,使其适合你的部署,并保存文件。

配置 PowerShell 执行策略。 默认情况下,PowerShell 的执行策略设置为“受限”;这意味着,在显式授予脚本权限之前,脚本不会运行。 若要将 PowerShell 的执行策略配置为允许脚本运行,请使用提升的 PowerShell 提示符中的以下命令:

Set-ExecutionPolicy RemoteSigned

RemoteSigned 执行策略将阻止来自 Internet 的未签名脚本在计算机上运行,但允许运行本地创建的脚本。 有关执行策略的详细信息,请参阅 Set-ExecutionPolicy。

提示

若要获取任何Windows PowerShell cmdlet 的联机帮助(无论是否在本地安装),请输入以下 cmdlet,并将 替换为要查看其帮助的 cmdlet 的名称:

Get-Help -Online

此命令使Windows PowerShell在默认 Internet 浏览器中打开帮助主题的联机版本。

Windows To Go 多驱动器预配示例脚本 展开此部分以查看 Windows To Go 多驱动器预配示例脚本 param ( [parameter(Mandatory=$true)] [string] #Path to install wim. If you have the full path to the wim or want to use a local file. $InstallWIMPath, [string] #Domain to which to join the Windows To Go workspaces. $DomainName ) $Source = @" using System; using System.Collections.Generic; using System.IO; using System.Text; namespace MS.PolicyFileEditor { //The PolicyEntry represents the DWORD Registry Key/Value/Data entry that will //be written into the file. public class PolicyEntry { private List byteList; public string KeyName { get; set; } public string ValueName { get; set; } internal List DataBytes { get { return this.byteList; } } public PolicyEntry( string Key, string Value, uint data) { KeyName = Key; ValueName = Value; this.byteList = new List(); byte[] arrBytes = BitConverter.GetBytes(data); if (BitConverter.IsLittleEndian == false) { Array.Reverse(arrBytes); } this.byteList.AddRange(arrBytes); } ~PolicyEntry() { this.byteList = null; } } public class PolicyFile { private Dictionary entries; public List Entries { get { List policyList = new List(entries.Values); return policyList; } } public PolicyFile() { this.entries = new Dictionary(StringComparer.OrdinalIgnoreCase); } public void SetDWORDValue(string key, string value, uint data) { PolicyEntry entry = new PolicyEntry(key, value, data); this.entries[entry.KeyName + "\\" + entry.ValueName] = entry; } public void SaveFile(string file) { using (FileStream fs = new FileStream(file, FileMode.Create, FileAccess.Write)) { fs.Write(new byte[] { 0x50, 0x52, 0x65, 0x67, 0x01, 0x00, 0x00, 0x00 }, 0, 8); byte[] openBracket = UnicodeEncoding.Unicode.GetBytes("["); byte[] closeBracket = UnicodeEncoding.Unicode.GetBytes("]"); byte[] semicolon = UnicodeEncoding.Unicode.GetBytes(";"); byte[] nullChar = new byte[] { 0, 0 }; byte[] bytes; foreach (PolicyEntry entry in this.Entries) { fs.Write(openBracket, 0, 2); bytes = UnicodeEncoding.Unicode.GetBytes(entry.KeyName); fs.Write(bytes, 0, bytes.Length); fs.Write(nullChar, 0, 2); fs.Write(semicolon, 0, 2); bytes = UnicodeEncoding.Unicode.GetBytes(entry.ValueName); fs.Write(bytes, 0, bytes.Length); fs.Write(nullChar, 0, 2); fs.Write(semicolon, 0, 2); bytes = BitConverter.GetBytes(4); if (BitConverter.IsLittleEndian == false) { Array.Reverse(bytes); } fs.Write(bytes, 0, 4); fs.Write(semicolon, 0, 2); byte[] data = entry.DataBytes.ToArray(); bytes = BitConverter.GetBytes((uint)data.Length); if (BitConverter.IsLittleEndian == false) { Array.Reverse(bytes); } fs.Write(bytes, 0, 4); fs.Write(semicolon, 0, 2); fs.Write(data, 0, data.Length); fs.Write(closeBracket, 0, 2); } fs.Close(); } } } } "@ ######################################################################## # # Helper Functions # Function CreateUnattendFile { param ( [parameter(Mandatory=$true)] [string] $Arch ) if ( Test-Path "WtgUnattend.xml" ) { del .\WtgUnattend.xml } $unattendFile = New-Item "WtgUnattend.xml" -type File $fileContent = @" true 1 Work en-US en-US en-US en-US true "@ Set-Content $unattendFile $fileContent #return the file object $unattendFile } Function CreateRegistryPolicyFile { $saveFileLocaiton = "" + (get-location) + "\registry.pol" $policyFile = New-Object MS.PolicyFileEditor.PolicyFile $policyFile.SetDWORDValue("Software\Policies\Microsoft\FVE", "UseAdvancedStartup", 1) $policyFile.SetDWORDValue("Software\Policies\Microsoft\FVE", "EnableBDEWithNoTPM", 1) $policyFile.SetDWORDValue("Software\Policies\Microsoft\FVE", "UseTPM", 2) $policyFile.SetDWORDValue("Software\Policies\Microsoft\FVE", "UseTPMPIN", 2) $policyFile.SetDWORDValue("Software\Policies\Microsoft\FVE", "UseTPMKey", 2) $policyFile.SetDWORDValue("Software\Policies\Microsoft\FVE", "UseTPMKeyPIN", 2) $policyFile.SetDWORDValue("Software\Policies\Microsoft\FVE", "OSEnablePrebootInputProtectorsOnSlates", 1) $policyFile.SaveFile($saveFileLocaiton) $saveFileLocaiton } ######################################################################## if ( Test-Path $installWIMPath ){ write-output "Image: $installWIMPath" } else{ write-output "Unable to find image: $installWIMPath" "Exiting the script" exit } if ( (Get-WindowsImage -ImagePath $InstallWIMPath -Index 1).Architecture -eq 0 ){ $Arch = "x86" } else{ $Arch = "amd64" } $starttime = get-date #Add type information for modifing the Registy Policy file Add-Type -TypeDefinition $Source -Language CSharp #Create helper files $unattendFile = CreateUnattendFile -Arch $Arch $registryPolFilePath = CreateRegistryPolicyFile $Disks = Get-Disk | Where-Object {$_.Path -match "USBSTOR" -and $_.Size -gt 20Gb -and -not $_.IsBoot } if ($Disks -eq $null) { Write-Output "No USB Disks found, exiting the script. Please check that you have a device connected." exit } #We want to make sure that all non-boot connected USB drives are online, writeable and cleaned. #This command will erase all data from all USB drives larger than 20Gb connected to your machine #To automate this step you can add: -confirm:$False Clear-Disk -InputObject $Disks -RemoveData -erroraction SilentlyContinue # Currently the provisioning script needs drive letters (for dism and bcdboot.exe) and the script is more # reliable when the main process determines all of the free drives and provides them to the sub-processes. # Use a drive index starting at 1, since we need 2 free drives to proceed. (system & operating system) $driveLetters = 68..90 | ForEach-Object { "$([char]$_):" } | Where-Object { (new-object System.IO.DriveInfo $_).DriveType -eq 'noRootdirectory' } $driveIndex = 1 foreach ($disk in $Disks) { if ( $driveIndex -lt $driveLetters.count ) { Start-Job -ScriptBlock { $installWIMPath = $args[0] $unattendFile = $args[1] $Disk = $args[2] $SystemDriveLetter = $args[3] $OSDriveLetter = $args[4] $DomainName = $args[5] $policyFilePath = $args[6] #For compatibility between UEFI and legacy BIOS we use MBR for the disk. Initialize-Disk -InputObject $Disk -PartitionStyle MBR #A short sleep between creating a new partition and formatting helps ensure the partition #is ready before formatting. $SystemPartition = New-Partition -InputObject $Disk -Size (350MB) -IsActive Sleep 1 Format-Volume -Partition $SystemPartition -FileSystem FAT32 -NewFileSystemLabel "UFD-System" -confirm:$False | Out-Null $OSPartition = New-Partition -InputObject $Disk -UseMaximumSize Sleep 1 Format-Volume -NewFileSystemLabel "UFD-Windows" -FileSystem NTFS -Partition $OSPartition -confirm:$False | Out-Null #The No default drive letter prevents other computers from displaying contents of the drive when connected as a Data drive. Set-Partition -InputObject $OSPartition -NoDefaultDriveLetter $TRUE Set-Partition -InputObject $SystemPartition -NewDriveLetter $SystemDriveLetter Set-Partition -InputObject $OSPartition -NewDriveLetter $OSDriveLetter dism /apply-image /index:1 /applydir:${OSDriveLetter}:\ /imagefile:$InstallWIMPath if (!$?){ write-output "DISM image application failed, exiting." exit } copy $unattendFile ${OSDriveLetter}:\Windows\System32\sysprep\unattend.xml #Create the directory for the Machine Registry Policy file, surpressing the output and any error #and copy the pre-created Registry.pol file to that location. write-output "Set BitLocker default policies for WindowsToGo" md ${OSDriveLetter}:\windows\System32\GroupPolicy\Machine | out-null copy $policyFilePath ${OSDriveLetter}:\windows\System32\GroupPolicy\Machine #modify the registry of the image to set SanPolicy. This is also where you could set the default #keyboard type for USB keyboards. write-output "Modify SAN Policy" reg load HKLM\PW-System ${OSDriveLetter}:\Windows\System32\config\SYSTEM > info.log reg add HKLM\PW-System\ControlSet001\Services\Partmgr\Parameters /v SanPolicy /d 4 /t REG_DWORD /f > info.log reg unload HKLM\PW-System > info.log #We're running bcdboot from the newly applied image so we know that the correct boot files for the architecture and operating system are used. #This will fail if we try to run an amd64 bcdboot.exe on x86. cmd /c "$OSDriveLetter`:\Windows\system32\bcdboot $OSDriveLetter`:\Windows /f ALL /s $SystemDriveLetter`:" if (!$?){ write-output "BCDBOOT.exe failed, exiting script." exit } if ($DomainName) { #using get-random, we will create a random computer name for the drive. $suffix = Get-Random $computername = "wtg-" + $suffix djoin /provision /domain $DomainName /savefile ${OSDriveLetter}:\tempBLOB.bin /reuse /machine $computername djoin /requestodj /loadfile ${OSDriveLetter}:\tempBLOB.bin /windowspath ${OSDriveLetter}:\windows > info.log del ${OSDriveLetter}:\tempBLOB.bin #add offline registry key to skip user account screen write-output "Add Offline Registry key for skipping UserAccount OOBE page." reg load HKLM\PW-Temp${OSDriveLetter} ${OSDriveLetter}:\Windows\System32\config\SOFTWARE > info.log reg add HKLM\PW-Temp${OSDriveLetter}\Microsoft\Windows\CurrentVersion\Setup\OOBE /v UnattendCreatedUser /d 1 /t REG_DWORD > info.log reg unload HKLM\PW-Temp${OSDriveLetter} > info.log } try { Write-VolumeCache -DriveLetter ${OSDriveLetter} Write-Output "Disk is now ready to be removed." } catch [System.Management.Automation.CommandNotFoundException] { write-output "Flush Cache not supported, Be sure to safely remove the WTG device." } } -ArgumentList @($installWIMPath, $unattendFile, $disk, $driveLetters[$driveIndex-1][0], $driveLetters[$driveIndex][0], $DomainName, $registryPolFilePath) } $driveIndex = $driveIndex + 2 } #wait for all threads to finish get-job | wait-job #print output from all threads get-job | receive-job #delete the job objects get-job | remove-job #Cleanup helper files del .\WtgUnattend.xml del .\Registry.pol $finishtime = get-date $elapsedTime = new-timespan $starttime $finishtime write-output "Provsioning completed in: $elapsedTime (hh:mm:ss.000)" write-output "" "Provisioning script complete." 通过 Windows To Go 使用不同的 USB 键盘布局时的注意事项

在 PowerShell 预配脚本中,应用映像后,可以添加以下命令,以正确设置键盘设置。 以下示例使用日语键盘布局:

reg.exe load HKLM\WTG-Keyboard ${OSDriveLetter}:\Windows\System32\config\SYSTEM > info.log reg.exe add HKLM\WTG-Keyboard\ControlSet001\Services\i8042prt\Parameters /v LayerDriver /d JPN:kbd106dll /t REG_SZ /f reg.exe add HKLM\WTG-Keyboard\ControlSet001\Services\i8042prt\Parameters /v OverrideKeyboardIdentifier /d PCAT_106KEY /t REG_SZ /f reg.exe add HKLM\WTG-Keyboard\ControlSet001\Services\i8042prt\Parameters /v OverrideKeyboardSubtype /d 2 /t REG_DWORD /f reg.exe add HKLM\WTG-Keyboard\ControlSet001\Services\i8042prt\Parameters /v OverrideKeyboardType /d 7 /t REG_DWORD /f reg.exe unload HKLM\WTG-Keyboard 相关文章

Windows To Go:功能概述

Windows 10 论坛

使你的组织准备好使用 Windows To Go

Windows To Go 的部署注意事项

Windows To Go 安全性和数据保护注意事项

BitLocker 概述



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3