繁体   English   中英

使用 powershell 在外部驱动器上激活 Bitlocker

[英]Activate Bitlocker on external drive with powershell

我正在尝试通过带有 bitlocker 的 powershell 加密外部驱动器。

我在这里发布的脚本将是更大设置的一部分,其中所有连接到 PC 的磁盘都将自动格式化,然后在它们上启用 bitlocker。 我正在尝试设置用于解锁卷的密码导出恢复密钥,以防最坏的情况通过...

编码:

$Pass = 'xxxxx.' | ConvertTo-SecureString -AsPlainText -Force
Enable-BitLocker -MountPoint "E:" -EncryptionMethod Aes256  -UsedSpaceOnly -PasswordProtector -Password $Pass 
Add-BitLockerKeyProtector -MountPoint "E:" -RecoveryKeyPath "D:\keys\" -RecoveryKeyProtector

do 
{
$Volume = Get-BitLockerVolume -MountPoint E:
Write-Progress -Activity "Encrypting volume $($Volume.MountPoint)" -Status "Encryption Progress:" -PercentComplete $Volume.EncryptionPercentage
Start-Sleep -Seconds 1
}
until ($Volume.VolumeStatus -eq 'FullyEncrypted')

Write-Progress -Activity "Encrypting volume $($Volume.MountPoint)" -Status "Encryption Progress:" -Completed

我收到一个错误:无法使用指定的命名参数解析参数集。

位锁定时是否可以同时使用密码和恢复密钥操作?

提前致谢

调用Enable-BitLocker时不能同时使用密码和恢复密钥。

来自TechNet :“启用加密时,您只能指定其中一种方法或组合,但您可以使用 Add-BitLockerKeyProtector cmdlet 添加其他保护程序。”

所以启用后使用Add-BitLockerKeyProtector

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM