Intune : Appareils Co-Managed – Sauvegarder la clé BitLocker dans Entra ID

par | Sep 24, 2024 | Intune, Remediation script | 0 commentaires

Dans le cas des appareils dans l’AD OnPrem, Co-Managed et gérés par Intune, il est pratique d’avoir la clé BitLocker enregistrée dans Entra ID afin de la visualiser dans le portail Intune.

La sauvegarde de la clé BitLocker vers Entra ID est possible en utilisant un script de remédiation Intune.

Script de détection :

try{
$BLV = Get-BitLockerVolume -MountPoint $env:SystemDrive
        $KeyProtectorID=""
        foreach($keyProtector in $BLV.KeyProtector){
            if($keyProtector.KeyProtectorType -eq "RecoveryPassword"){
                $KeyProtectorID=$keyProtector.KeyProtectorId
                break;
            }
        }

       $result = BackupToAAD-BitLockerKeyProtector -MountPoint "$($env:SystemDrive)" -KeyProtectorId $KeyProtectorID -whatif
return $true
}
catch{
     return $false
}

Script de remédiation :

try{
$BLV = Get-BitLockerVolume -MountPoint $env:SystemDrive
        $KeyProtectorID=""
        foreach($keyProtector in $BLV.KeyProtector){
            if($keyProtector.KeyProtectorType -eq "RecoveryPassword"){
                $KeyProtectorID=$keyProtector.KeyProtectorId
                break;
            }
        }

       $result = BackupToAAD-BitLockerKeyProtector -MountPoint "$($env:SystemDrive)" -KeyProtectorId $KeyProtectorID -whatif
return $true
}
catch{
     return $false
}

 

0 commentaires

Soumettre un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *