关于 Sysprep(系统准备)
https://learn.microsoft.com/zh-cn/windows-hardware/manufacture/desktop/sysprep--system-preparation--overview?view=windows-11
Sysprep 是 Windows 映像的一部分,在审核模式下运行。
Sysprep(系统准备)可以准备 Windows 客户端或 Windows Server 安装以生成映像。 Sysprep 可以从 Windows 安装中删除特定于 PC 的信息(通用化),以便可以将其安装在不同的电脑上。 运行 Sysprep 时,可将电脑配置为启动至审核模式或开箱即用体验 (OOBE)。
关于 SID(安全标识符)
https://learn.microsoft.com/zh-cn/windows-server/identity/ad-ds/manage/understand-security-identifiers
安全标识符用于唯一标识安全主体或安全组。 安全主体可以表示可由操作系统进行身份验证的任何实体,例如用户帐户、计算机帐户或在用户或计算机帐户的安全上下文中运行的线程或进程。
每个帐户或组,或在帐户的安全上下文中运行的每个进程都具有由颁发机构(如 Windows 域控制器)颁发的唯一 SID。 SID 存储在安全数据库中。 在创建帐户或组时,系统将生成用于标识特定帐户或组的 SID。 如果已将某个 SID 用作用户或组的唯一标识符,则该 SID 绝不能再次用于标识其他用户或组。
每次用户登录时,系统都会为该用户创建访问令牌。 访问令牌包含用户的 SID、用户权限以及用户所属的任何组的 SID。 此令牌为用户在该计算机上执行的任何操作提供安全上下文。
使用 Sysprep 重置 SID
1. "以管理员身份运行" Sysprep 设置 "进入系统全新体验(OOBE) + 通用"
C:\Windows\System32\Sysprep
2. 如果操作失败,打开 Panther \ setupact.log 日志查看错误原因
14:36:25, Error SYSPRP Package Microsoft.MicrosoftEdge.Stable_122.0.2365.106_neutral__8wekyb3d8bbwe was installed for a user, but not provisioned for all users. This package will not function properly in the sysprep image. 14:36:25, Error SYSPRP Failed to remove apps for the current user: 0x80073cf2. 14:36:25, Error SYSPRP Exit code of RemoveAllApps thread was 0x3cf2. 14:36:25, Error SYSPRP ActionPlatform::LaunchModule: Failure occurred while executing 'SysprepGeneralizeValidate' from C:\Windows\System32\AppxSysprep.dll; dwRet = 0x3cf2 14:36:25, Error SYSPRP SysprepSession::Validate: Error in validating actions from C:\Windows\System32\Sysprep\ActionFiles\Generalize.xml; dwRet = 0x3cf2 14:36:25, Error SYSPRP RunPlatformActions:Failed while validating Sysprep session actions; dwRet = 0x3cf2 14:36:25, Error [0x0f0070] SYSPRP RunDlls:An error occurred while running registry sysprep DLLs, halting sysprep execution. dwRet = 0x3cf2 14:36:25, Error [0x0f00d8] SYSPRP WinMain:Hit failure while pre-validate sysprep generalize internal providers; hr = 0x80073cf2