简体   繁体   English

以编程方式为 BitLocker 准备驱动器

[英]Programmatically prepare drive for BitLocker

How can I programmatically prepare a drive for BitLocker.如何以编程方式为 BitLocker 准备驱动器。

I get VMs with OS and System volumes in the same volume and would like to enable BitLocker.我在同一卷中获得了具有操作系统和系统卷的虚拟机,并希望启用 BitLocker。 Like this:像这样:

单一操作系统和系统卷

The BitLocker Wizard will prepare the drive like so: BitLocker 向导将准备驱动器,如下所示: BitLocker 驱动器准备向导

The outcome will look like this:结果将如下所示: 单独的操作系统和系统卷

I'd like to be able to do this in PowerShell or really any scripted way.我希望能够在 PowerShell 或任何脚本方式中执行此操作。

I've tried using the New-Partition cmdlet, but that doesn't work.我试过使用 New-Partition cmdlet,但这不起作用。

Have you installed the BitLocker Module?您是否安装了 BitLocker 模块? I think the Enable-BitLocker is what you are looking for.我认为 Enable-BitLocker 是您正在寻找的。

PS> Import-Module BitLocker WARNING: The names of some imported commands from the module 'BitLocker' include unapproved verbs that might make them less discoverable. PS> Import-Module BitLocker 警告:从模块“BitLocker”中导入的一些命令的名称包括未经批准的动词,可能会使它们不易被发现。 To find the commands with unapproved verbs, run the Import -Module command again with the Verbose parameter.要查找带有未批准动词的命令,请使用 Verbose 参数再次运行 Import -Module 命令。 For a list of approved verbs, type Get-Verb.要获得批准的动词列表,请键入 Get-Verb。

PS> Get-Command -Module BitLocker PS> Get-Command -Module BitLocker

CommandType Name Version Source CommandType 名称 版本 来源


Function Add-BitLockerKeyProtector 1.0.0.0 BitLocker Function 添加BitLockerKeyProtector 1.0.0.0 BitLocker
Function Backup-BitLockerKeyProtector 1.0.0.0 BitLocker Function 备份-BitLockerKeyProtector 1.0.0.0 BitLocker
Function BackupToAAD-BitLockerKeyProtector 1.0.0.0 BitLocker Function BackupToAAD-BitLockerKeyProtector 1.0.0.0 BitLocker
Function Clear-BitLockerAutoUnlock 1.0.0.0 BitLocker Function Clear-BitLockerAutoUnlock 1.0.0.0 BitLocker
Function Disable-BitLocker 1.0.0.0 BitLocker Function 禁用-BitLocker 1.0.0.0 BitLocker
Function Disable-BitLockerAutoUnlock 1.0.0.0 BitLocker Function 禁用-BitLockerAutoUnlock 1.0.0.0 BitLocker
Function Enable-BitLocker 1.0.0.0 BitLocker Function 启用-BitLocker 1.0.0.0 BitLocker
Function Enable-BitLockerAutoUnlock 1.0.0.0 BitLocker Function Enable-BitLockerAutoUnlock 1.0.0.0 BitLocker
Function Get-BitLockerVolume 1.0.0.0 BitLocker Function 获取 BitLockerVolume 1.0.0.0 BitLocker
Function Lock-BitLocker 1.0.0.0 BitLocker Function Lock-BitLocker 1.0.0.0 BitLocker
Function Remove-BitLockerKeyProtector 1.0.0.0 BitLocker Function 删除-BitLockerKeyProtector 1.0.0.0 BitLocker
Function Resume-BitLocker 1.0.0.0 BitLocker Function Resume-BitLocker 1.0.0.0 BitLocker
Function Suspend-BitLocker 1.0.0.0 BitLocker Function 挂起-BitLocker 1.0.0.0 BitLocker
Function Unlock-BitLocker 1.0.0.0 BitLocker Function 解锁-BitLocker 1.0.0.0 BitLocker

I learned, via another channel, that there is a tool called Bdehdcfg that will do this.我通过另一个渠道了解到,有一个名为 Bdehdcfg 的工具可以做到这一点。

https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/ff829850(v=ws.11) https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/ff829850(v=ws.11)

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

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