以下是使用PowerShell脚本来启用BitLocker的示例:

# 检查是否已经启用BitLocker
$drive = "C:"
$bitlockerStatus = Get-BitLockerVolume -MountPoint $drive | Select-Object -ExpandProperty ProtectionStatus

if ($bitlockerStatus -eq "On") {
    Write-Host "BitLocker is already enabled on drive $drive."
} else {
    # 启用BitLocker
    $encryptionMethod = "Aes256"
    $encryptionPassword = "P@ssw0rd"

    $secureString = ConvertTo-SecureString -String $encryptionPassword -AsPlainText -Force
    $encryptionKey = Add-BitLockerKeyProtector -MountPoint $drive -PasswordProtector -Password $secureString

    Enable-BitLocker -MountPoint $drive -EncryptionMethod $encryptionMethod -UsedSpaceOnly -PasswordProtector
    Write-Host "BitLocker has been enabled on drive $drive."
}

请注意,此脚本假定要启用BitLocker的驱动器为C驱动器。您可以根据需要更改$drive变量的值。

此脚本还使用AES-256加密方法和"P@ssw0rd"作为加密密码。您可以根据需要更改$encryptionMethod$encryptionPassword变量的值。

在运行此脚本之前,请确保以管理员身份运行PowerShell

windows 开启bitlocker 的powershell脚本

原文地址: http://www.cveoy.top/t/topic/ilDa 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录