好。这正是我想要通过Powershell脚本来做的。我试图通过编写脚本来帮助我的团队,但我绝不是这个主题的专家,事实恰恰相反。这就是为什么我求助于你们所有的专家。
因此,我有一个AD中没有BitLocker恢复信息的计算机名称列表,这些计算机列在每台计算机的AD帐户中
我想通过PowerShell脚本执行以下操作:
-
从computers.txt文件中Ping每个机器名称,以确定机器是否在线
-
如果机器名称ping为活动:a.运行CMD行CMD:manage-bde-CN[computername]-protectors-get C:它将以以下形式返回数字密码:
数字密码:ID:{#########-####-#####-#############}
b。使用以下命令获取数字密码并将其备份到AD:manage-bde-CN[计算机名称]-protectors-adbackup c:-id{数字密码}
我创建了一个脚本,它从computers.txt文件中获取一个计算机名称列表,并在每个计算机上运行一个测试连接,将"ping"/"not ping"输出到output.txt文件。作为脚本的新手,我在第二部分和第二部分遇到了麻烦。以下是我目前所拥有的:
$ServerName = Get-Content "c:Computers.txt"
foreach ($Server in $ServerName) {
if (test-Connection -ComputerName $Server -Count 2 -Quiet ) {
"$Server is Pinging "
} else {
"$Server not pinging"
}
}
PowerShell有用于此的cmdlet。
Get-Command -Name '*bitlocker*' | Format-Table -AutoSize
CommandType Name Version Source
----------- ---- ------- ------
Function Add-BitLockerKeyProtector 1.0.0.0 BitLocker
Function Backup-BitLockerKeyProtector 1.0.0.0 BitLocker
Function Backup-BitLockerKeys 0.0 ModuleLibrary
Function BackupToAAD-BitLockerKeyProtector 1.0.0.0 BitLocker
Function Clear-BitLockerAutoUnlock 1.0.0.0 BitLocker
Function Disable-BitLocker 1.0.0.0 BitLocker
Function Disable-BitLockerAutoUnlock 1.0.0.0 BitLocker
Function Enable-BitLocker 1.0.0.0 BitLocker
Function Enable-BitLockerAutoUnlock 1.0.0.0 BitLocker
Function Get-BitLockerVolume 1.0.0.0 BitLocker
Function Lock-BitLocker 1.0.0.0 BitLocker
Function Remove-BitLockerKeyProtector 1.0.0.0 BitLocker
Function Resume-BitLocker 1.0.0.0 BitLocker
Function Suspend-BitLocker 1.0.0.0 BitLocker
Function Unlock-BitLocker 1.0.0.0 BitLocker
Application BitLockerDeviceEncryption.exe 10.0.17134.1 C:WINDOWSsystem32BitLockerDeviceEncryption.exe
Application BitLockerWizard.exe 10.0.17134.1 C:WINDOWSsystem32BitLockerWizard.exe
Application BitLockerWizardElev.exe 10.0.17134.1 C:WINDOWSsystem32BitLockerWizardElev.exe
启用位储物柜为卷启用BitLocker驱动器加密。
Example 1: Enable BitLocker
$SecureString = ConvertTo-SecureString "1234" -AsPlainText -Force
Enable-BitLocker -MountPoint "C:" -EncryptionMethod Aes256 -UsedSpaceOnly -Pin $SecureString -TPMandPinProtector
This example enables BitLocker for a specified drive using the TPM and a PIN for key protector.
备用钻头储物柜钥匙保护器在AD DS-中为BitLocker卷保存密钥保护程序
Example 1: Save a key protector for a volume
$BLV = Get-BitLockerVolume -MountPoint "C:"
Backup-BitLockerKeyProtector -MountPoint "C:" -KeyProtectorId $BLV.KeyProtector[1].KeyProtectorId
This example saves a key protector for a specified BitLocker volume.
这个问题可以被看作与这个问答非常相似;讨论。
自动化如何在AD 中备份Bitlocker恢复信息的过程