powershell - Bitlocker 和 Powershell
问题描述
我需要有关 powershell 命令的帮助 - Enable-Bitlocker
以下代码是一个示例:
$pw = ConvertTo-SecureString "123456" -AsPlainText -Force
Enable-BitLocker -MountPoint $env:SystemDrive -EncryptionMethod Aes256 -Pin $pw -TpmAndPinProtector -UsedSpaceOnly -SkipHardwareTest -ErrorAction SilentlyContinue
Start-Sleep 2
(Get-BitLockerVolume -MountPoint $env:HOMEDRIVE).KeyProtector > $env:UserProfile\Desktop\BitLocker_Recovery_Key.txt
我的问题是,此命令的唯一输出是 Bitlocker_Recovery_Key.txt 中的以下内容
KeyProtectorId : {CC2206C6-1B69-4DC1-96FE-38EED6F576E1}
AutoUnlockProtector :
KeyProtectorType : TpmPin
KeyFileName :
RecoveryPassword :
KeyCertificateType :
Thumbprint :
我的目标是获取恢复密码(48 字符串密码)作为我的 bitlocker 加密的备份。
提前致谢!
解决方案
在更彻底地阅读了bitlocker的微软文档后,我设法解决了我自己的问题。
看来我已经完成了自动化过程所需的每一步,但是为了接收恢复密钥,我们需要添加一个恢复密码保护器(请注意,添加一个恢复密码保护器并不需要我们实际提交密码,而只是接收恢复密码和数字密码)接收密码的过程是通过powershell调用以下命令来实现的。
Invoke-Expression "Manage-bde -protectors -add <drive of choice or $i if in a loop> -RecoveryPassword"
激活保护器需要管理员权限,以下是输出通过使用命令 manage-bde -protectors -get <$i or drive letter>
Volume : []
All Key Protectors
TPM And PIN:
ID:
PCR Validation Profile:
Numerical Password:
ID: id
Password:
password
Numerical Password:
ID: id
Password:
password
只有这样我们才能在我们的方法中使用恢复密钥。
请注意, enable-bitlocker 或 manage-bde -on <drive or $i> 不会自动生成恢复密码,我们需要添加恢复密码保护器。
推荐阅读
- nginx - 如何使用 nginx 代理远程服务器?
- javascript - 将文本框上的输入相乘并在警报上显示答案(javascript)
- python-2.7 - tensorflow 错误:InvalidArgumentError:元组组件 1 中的形状不匹配。预期 [1],得到 [5]
- python - 通过多列运行需要多个参数的函数 - Pandas
- python - Python 2 csv.DictWriter() Unicode 编码异常处理
- python - Tensorflow conv2d_transpose:out_backprop 的大小与计算的不匹配
- angularjs - Ionic (Angularjs) 和 Devextreme Datagrid 的集成,无法显示来自 $http JSON 的数据
- python - Google 已停用 QPX Express API
- regex - 正则表达式查找 URL,包括仅以 //(协议相关 URL)开头的 URL
- reactjs - 反应 setstate 不重新调整