Repository navigation
Expand file tree
/
Copy pathDetect-BitlockerEncryption.ps1
More file actions
52 lines (44 loc) · 1.57 KB
/
Copy pathDetect-BitlockerEncryption.ps1
File metadata and controls
52 lines (44 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<#
.SYNOPSIS
Erkennt ob Laufwerke mit BitLocker verschluesselt sind.
.DESCRIPTION
Prueft den BitLocker-Verschluesselungsstatus aller Laufwerke.
Exit 1 = mindestens ein Laufwerk verschluesselt (Remediation wird ausgeloest).
Exit 0 = kein Laufwerk verschluesselt (kein Handlungsbedarf).
.NOTES
Author: Marius Gehrmann - Business IT Solutions
Verwendung: Intune Proactive Remediation (Detection Script)
Ausfuehrung: Im SYSTEM-Kontext, 64-Bit
.RELEASE NOTES
V1.0, 24.02.2026 - Erstversion
V1.1, 26.02.2026 - Alle Laufwerke pruefen, nicht nur C:
#>
try {
$allVolumes = Get-BitLockerVolume -ErrorAction Stop
$encryptedVolumes = $allVolumes | Where-Object {
$_.VolumeStatus -notin "FullyDecrypted", "DecryptionInProgress"
}
if ($encryptedVolumes) {
$details = ($encryptedVolumes | ForEach-Object {
"$($_.MountPoint) (Status: $($_.VolumeStatus), Methode: $($_.EncryptionMethod))"
}) -join ", "
Write-Host "BitLocker aktiv auf: $details"
exit 1
}
# Ggf. laufende Entschluesselungen melden
$decrypting = $allVolumes | Where-Object { $_.VolumeStatus -eq "DecryptionInProgress" }
if ($decrypting) {
$details = ($decrypting | ForEach-Object {
"$($_.MountPoint) ($($_.EncryptionPercentage)%)"
}) -join ", "
Write-Host "Entschluesselung laeuft bereits: $details"
}
else {
Write-Host "Kein Laufwerk mit BitLocker verschluesselt."
}
exit 0
}
catch {
Write-Host "Fehler bei BitLocker-Pruefung: $($_.Exception.Message)"
exit 1
}