获取Bitlocker保护器信息的脚本,然后备份到AD

时间:2018-11-20 18:44:02

标签: powershell

好。因此,这正是我要通过Powershell脚本执行的操作。我试图通过编写脚本来帮助我的团队,但我绝对不是这个主题的专家,实际上恰恰相反。这就是为什么我请你们所有的专家。

因此,我有一个AD中的计算机名称列表,但没有在每台计算机的AD帐户中列出BitLocker恢复信息。她

我希望通过PowerShell脚本执行以下操作:

  1. 从computers.txt文件中ping每台计算机名称,以确定计算机是否在线

  2. 如果计算机名称ping为活动: 一种。运行CMD行cmd:manage-bde -CN [computername] -protectors -get C: 它将以以下形式返回数字密码:

数字密码:       ID:{#######-####-####-####-###########}

b。使用数字密码,并使用以下命令将其备份到AD: manage-bde -CN [计算机名称]-保护程序-adbackup c:-id {数字密码}

我创建了一个脚本,该脚本从computers.txt文件中获取计算机名称列表,并在每个脚本上运行测试连接,然后将“ ping” /“ not ping”输出到输出.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"  
  }                
} 

1 个答案:

答案 0 :(得分:0)

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:\WINDOWS\system32\BitLockerDeviceEncryption.exe
Application BitLockerWizard.exe               10.0.17134.1 C:\WINDOWS\system32\BitLockerWizard.exe          
Application BitLockerWizardElev.exe           10.0.17134.1 C:\WINDOWS\system32\BitLockerWizardElev.exe 

Enable-Bit​Locker 为卷启用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.

Backup-Bit​Locker​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.

This question could be seen very similar to this Q&A discussion.

自动完成如何在AD中备份Bitlocker恢复信息的过程

相关问题