Saltar al contingut principal
Claus BitLocker, rotació de contrasenyes d’administrador local, UID de tercers, etc. Podeu escriure a un camp personalitzat d’actiu mitjançant scripts. Això és útil per a coses com claus BitLocker, rotació de contrasenyes d’administrador local i UID de tercers.
1

Creeu un camp personalitzat d'actiu

  1. Aneu a Configuració > Actius > Camps personalitzats.
  2. Afegiu un camp personalitzat amb els detalls següents:
  • Nom: BitLocker Recovery Key
  • Variable: bitlockerRecoveryKey
Image
2

Creeu l'script

  1. Aneu a Scripts.
  2. Creeu un script amb els detalls següents:
  • Nom: 🗝️Store-BitlockerRecoveryKey
  • Contingut:
$ErrorActionPreference = 'SilentlyContinue' 

# Get drives where BitLocker is "On" 
$BitlockerDrives = Get-BitLockerVolume | Where-Object ProtectionStatus -EQ "On" -ErrorAction SilentlyContinue

#Get FileSystem drives 
$Drives = Get-PSDrive -PSProvider FileSystem

#Create array of Drive Names with ":" added
$DrivesName = @()
$Drives |  foreach {$DrivesName += $_.name + ':' }

#If any Bitlockered drives exist
if($BitlockerDrives){

    #Foreach Drive
    Foreach ($DriveName in $DrivesName) {

        #Confirm is drive is bitlockered
        $BitlockerDrive = $BitlockerDrives | where { $DriveName -contains $_ }

        #If specific drive is bitlockered
        if ($BitlockerDrive){

            #Get RecoveryKey 
            $RecoveryKey = $BitlockerDrive.KeyProtector | Where-Object RecoveryPassword -NE "" | Select-Object -ExpandProperty RecoveryPassword -ErrorAction SilentlyContinue
      
            #Join if multiple with ; delimiter 
            $RecoveryKey = $RecoveryKey -join ";"

            #Add the drive letter to the output
            $RecoveryKey = "$($BitlockerDrive.mountpoint)$RecoveryKey"

            #Add to other drive keys (If exist)
            $RecoveryKeys += " $RecoveryKey "

        } else { $RecoveryKeys += $DriveName + "Not Enabled" }   
        
    }

    GoreloAction -SetCustomField -Name 'asset.bitlockerRecoveryKey' -Value $RecoveryKeys

#If no bitlockered drives found
}else { 
    
    Foreach ($DriveName in $DrivesName) { 
        
        $RecoveryKeys += $DriveName + "Not Enabled " 
        
    } 
    
    GoreloAction -SetCustomField -Name 'asset.bitlockerRecoveryKey' -Value $RecoveryKeys 
    
}
3

Desplegueu l'script via una política.

  1. Aneu a Polítiques.
  2. Editeu una política existent que cobreixi els actius dels quals vulgueu emmagatzemar les claus o les adreces.
  3. Afegiu l’script i configureu-lo perquè es repeteixi diàriament a l’hora preferida.
  4. Deseu i distribuïu la política.