Bitlocker über Package aktivieren
Bitlocker über Package aktivieren
Hallo zusammen,
hat schon jemand Erfahrung mit dem Rollout von Bitlocker sammeln können?
Werde es wohl in den nächsten Wochen so paketieren müssen, sodass die Verschlüsselung auf allen Clients automatisch aktiviert wird.
hat schon jemand Erfahrung mit dem Rollout von Bitlocker sammeln können?
Werde es wohl in den nächsten Wochen so paketieren müssen, sodass die Verschlüsselung auf allen Clients automatisch aktiviert wird.
Empirum V18.0 / Windows Server 2012 R2 / SQL Server 2012 Standard
Re: Bitlocker über Package aktivieren
Haben es mit einem Mix aus VBS (Technet),GPO und Paket (Powershell) ausgerollt.
Wollte es erst rein über Powershell machen, aber die MUI Fähigkeit Werte auszulesen funktioniert nicht korrekt.
Wollte es erst rein über Powershell machen, aber die MUI Fähigkeit Werte auszulesen funktioniert nicht korrekt.
Re: Bitlocker über Package aktivieren
Moin,
vielen Dank für die Rückinfo.
Kannst du mir hierzu nähere Informationen nennen oder eventuell sogar deine Setup.inf posten? Wäre super hilfreich.
vielen Dank für die Rückinfo.
Kannst du mir hierzu nähere Informationen nennen oder eventuell sogar deine Setup.inf posten? Wäre super hilfreich.
Empirum V18.0 / Windows Server 2012 R2 / SQL Server 2012 Standard
Re: Bitlocker über Package aktivieren
Hallo,
bei mir läuft die Installation in zwei Schritten. Vielleicht kann man mit dem richtigen OS-Template sich den ersten Schritt sparen.
[Step1]
call bdehdcfg.exe -target default -quiet
cmd.exe /c shutdown -r -f
abort Bitlocker Partition created or check AC power.
[Step2]
call cmd.exe /c manage-bde.exe -tpm -TakeOwnership %langezufallzahl% > "%Temp%\TPM.txt"
call cmd.exe /c manage-bde.exe -on C: -TPMAndPIN %defaultPIN% -RecoveryPassword -SkipHardwaretest -UsedSpaceOnly
Gruß
Thomas
bei mir läuft die Installation in zwei Schritten. Vielleicht kann man mit dem richtigen OS-Template sich den ersten Schritt sparen.
[Step1]
call bdehdcfg.exe -target default -quiet
cmd.exe /c shutdown -r -f
abort Bitlocker Partition created or check AC power.
[Step2]
call cmd.exe /c manage-bde.exe -tpm -TakeOwnership %langezufallzahl% > "%Temp%\TPM.txt"
call cmd.exe /c manage-bde.exe -on C: -TPMAndPIN %defaultPIN% -RecoveryPassword -SkipHardwaretest -UsedSpaceOnly
Gruß
Thomas
Empirum v18.0 + EPE 4.7.1
Testsystem Empirum v18.0
Testsystem Empirum v18.0
Re: Bitlocker über Package aktivieren
Bei uns werden die Geräte direkt nach der OS und Softwareinstallation verschlüsselt und der Wiederherstellungskey im ADObjekt abgelegt. Das läuft wie folgt:
Du benötigst Das Bitlocker Swiss Army Knife von Stéphane vg
https://gallery.technet.microsoft.com/s ... s-a4777303
Eine GPO mit den benötigten Einstellungen für Bitlocker:
Bei uns:
BitLocker-Wiederherstellungsinformationen in Active Directory-Domänendiensten speichern
Verschlüsselungsmethode und Verschlüsselungsstärke für Laufwerke
Festlegen, wie BitLocker-geschützte Betriebssystemlaufwerke wiederhergestellt werden können
Minimale PIN-Länge für Systemstart konfigurieren
Sicheren Start für Integritätsüberprüfung zulassen
TPM-Plattformvalidierungsprofile
Das Feature Bitlocker-Wiederherstellungskennwort-Viewer muss dann auf dem jeweiligen AD Server noch aktiviert werden.
Nach der Verschlüsselung findet der Anwender im Startmenü einen Link zum Ändern der Pin.
Bei der Setup.inf musst dann halt noch die Sektion [Ecryption] mit dem verschlüsselten Startpin hinterlegen, die habe ich entfernt.
Du benötigst Das Bitlocker Swiss Army Knife von Stéphane vg
https://gallery.technet.microsoft.com/s ... s-a4777303
Eine GPO mit den benötigten Einstellungen für Bitlocker:
Bei uns:
BitLocker-Wiederherstellungsinformationen in Active Directory-Domänendiensten speichern
Verschlüsselungsmethode und Verschlüsselungsstärke für Laufwerke
Festlegen, wie BitLocker-geschützte Betriebssystemlaufwerke wiederhergestellt werden können
Minimale PIN-Länge für Systemstart konfigurieren
Sicheren Start für Integritätsüberprüfung zulassen
TPM-Plattformvalidierungsprofile
Das Feature Bitlocker-Wiederherstellungskennwort-Viewer muss dann auf dem jeweiligen AD Server noch aktiviert werden.
Nach der Verschlüsselung findet der Anwender im Startmenü einen Link zum Ändern der Pin.
Bei der Setup.inf musst dann halt noch die Sektion [Ecryption] mit dem verschlüsselten Startpin hinterlegen, die habe ich entfernt.
Code: Select all
[Product]
; ReplaceEnv <Variable>
#Set:Product, DONTDELETE
#Set:DeleteProduct, DELETE
[Set:Product]
; 1:, %App%, CREATE DIRECTORY CASCADED, 0
MkDir "%temp%\Bitlocker\"
; Prüft ob das System entschlüsselt ist
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {(&'BitLockerSAK' -GetEncryptionState).EncryptionState} > %temp%\Bitlocker\CurrentEncryptionState.txt"
WaitUntilFileExists "%temp%\Bitlocker\CurrentEncryptionState.txt" ,5
Set EncryptionState=ReadTextFile ("%temp%\Bitlocker\CurrentEncryptionState.txt")
Set EncryptionState=Uppercase(%EncryptionState%)
If %EncryptionState%<>FULLYDECRYPTED Then EncryptionState Else StartDriveEncryption EndIf
[StartDriveEncryption]
; Prüfe ob ein TPM-Module vorhanden ist.
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {&'BitlockerSAK' -IsTPMEnabled} > %temp%\Bitlocker\IsTPMEnabled.txt"
WaitUntilFileExists "%temp%\Bitlocker\IsTPMEnabled.txt" ,5
Set IsTPMEnabled=ReadTextFile ("%temp%\Bitlocker\IsTPMEnabled.txt")
Set IsTPMEnabled=Uppercase(%IsTPMEnabled%)
If %IsTPMEnabled%<>TRUE Then TPMNotEnabled EndIf
ErrorLogMsg [Info] Ein TPM ist vorhanden
; Prüfe ob das TPM-Module aktiv ist
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {&'BitlockerSAK' -IsTPMActivated} > %temp%\Bitlocker\IsTPMActivated.txt"
WaitUntilFileExists "%temp%\Bitlocker\IsTPMActivated.txt" ,5
Set IsTPMActivated=ReadTextFile ("%temp%\Bitlocker\IsTPMActivated.txt")
Set IsTPMActivated=Uppercase(%IsTPMActivated%)
If %IsTPMActivated%<>TRUE Then TPMNotActivated EndIf
ErrorLogMsg [Info] Das TPM ist aktiviert
; Prüfe den Besitz des TPM-Modules
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {&'BitlockerSAK' -IsTPMOwned} > %temp%\Bitlocker\IsTPMOwned.txt"
WaitUntilFileExists "%temp%\Bitlocker\IsTPMOwned.txt" ,5
Set IsTPMOwned=ReadTextFile ("%temp%\Bitlocker\IsTPMOwned.txt")
Set IsTPMOwned=Uppercase(%IsTPMOwned%)
If %IsTPMOwned%<>TRUE Then TPMNotOwned EndIf
ErrorLogMsg [Info] Das TPM ist im Besitz
; Prüft ob das System entschlüsselt ist
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {(&'BitLockerSAK' -GetEncryptionState).EncryptionState} > %temp%\Bitlocker\CurrentEncryptionState.txt"
WaitUntilFileExists "%temp%\Bitlocker\CurrentEncryptionState.txt" ,5
Set EncryptionState=ReadTextFile ("%temp%\Bitlocker\CurrentEncryptionState.txt")
Set EncryptionState=Uppercase(%EncryptionState%)
If %EncryptionState%<>FULLYDECRYPTED Then EncryptionState EndIf
ErrorLogMsg [Info] Das System ist entschlüsselt
; Prüft ob Schlüsselschutzvorrichtungen vorhanden sind
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {&'BitLockerSAK' -GetKeyProtectorIds} > %temp%\Bitlocker\GetKeyProtectorIds.txt"
WaitUntilFileExists "%temp%\Bitlocker\GetKeyProtectorIds.txt" ,5
Set GetKeyProtectorIds=ReadTextFile ("%temp%\Bitlocker\GetKeyProtectorIds.txt")
If %GetKeyProtectorIds%<>"" Then ResetKeyProtectors EndIf
If %GetKeyProtectorIds%<>"" Then ResetKeyProtectorsFailed EndIf
ErrorLogMsg [Info] Es ist keine Schlüsselschutzvorrichtungen vorhanden
; Setzen des Wiederherstellungskennwortes für das System
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {((&'Add-BitLockerKeyProtector' -MountPoint %systemdrive% -RecoveryPasswordProtector).KeyProtector | Where-Object {$_.KeyProtectorType -eq 'RecoveryPassword'}).KeyProtectorId} > %temp%\Bitlocker\RecoveryPasswordProtectorId.txt"
WaitUntilFileExists "%temp%\Bitlocker\RecoveryPasswordProtectorId.txt" ,5
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {(&'Get-Content' -Path '%temp%\Bitlocker\RecoveryPasswordProtectorId.txt') -match '\{[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}\}'} > %temp%\Bitlocker\isProtectorIdGUID.txt"
WaitUntilFileExists "%temp%\Bitlocker\isProtectorIdGUID.txt" ,5
Set RecoveryPasswordProtectorId=ReadTextFile ("%temp%\Bitlocker\RecoveryPasswordProtectorId.txt")
Set RecoveryPasswordProtectorId=Uppercase(%RecoveryPasswordProtectorId%)
Set isProtectorIdGUID=ReadTextFile ("%temp%\Bitlocker\isProtectorIdGUID.txt")
Set isProtectorIdGUID=Uppercase(%isProtectorIdGUID%)
If %isProtectorIdGUID%<>TRUE Then SetRecoveryPasswordProtectorFailed EndIf
ErrorLogMsg [Info] Das Wiederherstellungskennwort wurde gesetzt
; Sichern des Wiederherstellungskennwortes im AD
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {((&'Backup-BitLockerKeyProtector' -MountPoint %systemdrive% -KeyProtectorId '%RecoveryPasswordProtectorId%').KeyProtector | Where-Object {$_.KeyProtectorType -eq 'RecoveryPassword'}).KeyProtectorId} > %temp%\Bitlocker\BackupRecoveryPasswordProtector.txt"
WaitUntilFileExists "%temp%\Bitlocker\BackupRecoveryPasswordProtector.txt" ,5
Set BackupRecoveryPasswordProtector=ReadTextFile ("%temp%\Bitlocker\BackupRecoveryPasswordProtector.txt")
Set BackupRecoveryPasswordProtector=Uppercase(%BackupRecoveryPasswordProtector%)
If %BackupRecoveryPasswordProtector%<>%RecoveryPasswordProtectorId% Then BackupRecoveryPasswordProtectorFailed EndIf
ErrorLogMsg [Info] Das Wiederherstellungskennwort wurde ins AD gesichert
; Setzen des Standard BitLocker-Pin
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {((&'Add-BitLockerKeyProtector' -MountPoint %systemdrive% -Pin (ConvertTo-SecureString '%PIN%' -AsPlainText -Force) -TPMandPinProtector).KeyProtector | Where-Object {$_.KeyProtectorType -eq 'TpmPin'}).KeyProtectorId} > %temp%\Bitlocker\TPMandPinProtector.txt"
WaitUntilFileExists "%temp%\Bitlocker\TPMandPinProtector.txt" ,5
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {(&'Get-Content' -Path '%temp%\Bitlocker\TPMandPinProtector.txt') -match '\{[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}\}'} > %temp%\Bitlocker\isPINProtectorIdGUID.txt"
WaitUntilFileExists "%temp%\Bitlocker\isPINProtectorIdGUID.txt" ,5
Set TPMandPinProtector=ReadTextFile ("%temp%\Bitlocker\TPMandPinProtector.txt")
Set TPMandPinProtector=Uppercase(%TPMandPinProtector%)
Set isPINProtectorIdGUID=ReadTextFile ("%temp%\Bitlocker\isPINProtectorIdGUID.txt")
Set isPINProtectorIdGUID=Uppercase(%isPINProtectorIdGUID%)
If %isPINProtectorIdGUID%<>TRUE Then SetTPMandPinProtectorFailed EndIf
ErrorLogMsg [Info] Der PIN wurde gesetzt
; BitLocker aktivieren
CallHidden %systemroot%\System32\manage-bde.exe -protectors -enable %systemdrive%
CallHidden %systemroot%\System32\manage-bde.exe -on %systemdrive%
ErrorLogMsg [Info] Das System ist für die Verschlüsselung vorbereitet und wird nach einen Neustart verschlüsselt
CallHidden shutdown -r -t 10
AbortReboot INFO: Das System ist für die Verschlüsselung vorbereitet und wird nach einen Neustart verschlüsselt
[TPMNotEnabled]
Abort ERROR: Kein TPM vorhanden.
[TPMNotActivatable]
Abort ERROR: TPM konnte nicht aktiviert werden
[TPMcannotTakeOwnerShip]
Abort ERROR: konnte Besitz des TPMs nicht übernehmen
[TPMNotActivated]
If DoesFileExist("%temp%\Bitlocker\tryTPMActivation.txt") == "1" Then TPMNotActivatable EndIf
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {&'Initialize-Tpm'} > %temp%\Bitlocker\tryTPMActivation.txt"
CallHidden shutdown -r -t 5
AbortReboot INFO: Versuche das TPM zu aktivieren
[TPMNotOwned]
If DoesFileExist("tryTakeTPMOwnership.txt") == "1" Then TPMcannotTakeOwnerShip EndIf
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {&'Initialize-Tpm'} > %temp%\Bitlocker\tryTakeTPMOwnership.txt"
CallHidden shutdown -r -t 5
AbortReboot INFO: Versuche das TPM zurückzusetzten
[EncryptionState]
If %EncryptionState% == FULLYENCRYPTED Then DriveFullyEncrypted EndIf
If %EncryptionState% == ENCRYPTIONINPROGRESS Then DriveEncryptionInProgress EndIf
If %EncryptionState% == ENCRYPTIONPAUSED Then DriveEncryptionPaused EndIf
If %EncryptionState% == DECRYPTIONPAUSED Then DriveDecryptionPaused EndIf
If %EncryptionState% == DECRYPTIONINPROGRESS Then DriveDecryptionInProgress EndIf
If %EncryptionState% == FULLYDECRYPTED Then DriveFullyDecrypted EndIf
[DriveFullyEncrypted]
ErrorLogMsg [Info] Das Laufwerk wurde erfolgreich verschlüsselt
[DriveEncryptionInProgress]
For Counter,0,100,1,"CheckEncryptionProgress"
If %EncryptionProgress%<>100 Then DriveEncryptionInProgress Else DriveFullyEncrypted EndIf
[DriveDecryptionInProgress]
If %EncryptionProgress%<>0 Then DriveDecryptionInProgress Else DriveFullyDecrypted EndIf
For Counter,100,0,-1,"CheckDecryptionProgress"
[CheckEncryptionProgress]
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {(&'BitLockerSAK' -GetEncryptionState).CurrentEncryptionProgress} > %temp%\Bitlocker\CurrentEncryptionProgress.txt"
WaitUntilFileExists "%temp%\Bitlocker\CurrentEncryptionProgress.txt" ,5
Set EncryptionProgress=ReadTextFile ("%temp%\Bitlocker\CurrentEncryptionProgress.txt")
Set EncryptionProgress=Uppercase(%EncryptionProgress%)
Set Counter=%EncryptionProgress%
ErrorLogMsg [Info] Verschlüsselt (Prozent): %EncryptionProgress%
Sleep 60000
[CheckDecryptionProgress]
-Sleep 60000
-ErrorLogMsg [Info] Verschlüsselt (Prozent): %EncryptionProgress%
-Set Counter=%EncryptionProgress%
-Set EncryptionProgress=Uppercase(%EncryptionProgress%)
-Set EncryptionProgress=ReadTextFile ("%temp%\Bitlocker\CurrentEncryptionProgress.txt")
-WaitUntilFileExists "%temp%\Bitlocker\CurrentEncryptionProgress.txt" ,5
-CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {(&'BitLockerSAK' -GetEncryptionState).CurrentEncryptionProgress} > %temp%\Bitlocker\CurrentEncryptionProgress.txt"
[DriveFullyDecrypted]
-ErrorLogMsg [Info] Das Laufwerk wurde erfolgreich entschlüsselt
[DriveEncryptionPaused]
Abort ERROR: Die Laufwerksverschlüsselung ist gerade pausiert
[DriveDecryptionPaused]
-Abort ERROR: Die Laufwerksentschlüsselung ist gerade pausiert
[ResetKeyProtectors]
ErrorLogMsg [Info] versuche Schlüsselschutzvorrichtungen zurück zu setzten
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {&'Disable-BitLocker' -MountPoint %systemdrive%} > %temp%\Bitlocker\Disable-BitLocker.txt"
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {&'BitLockerSAK' -GetKeyProtectorIds} > %temp%\Bitlocker\GetKeyProtectorIds.txt"
Set GetKeyProtectorIds=ReadTextFile ("%temp%\Bitlocker\GetKeyProtectorIds.txt")
[ResetKeyProtectorsFailed]
Abort ERROR: Schlüsselschutzvorrichtungen konnten nicht zurück gesetzt werden
[SetRecoveryPasswordProtectorFailed]
Abort ERROR: Wiederherstellungskennwort konnten nicht gesetzt werden
[BackupRecoveryPasswordProtectorFailed]
Abort ERROR: Sichern des Wiederherstellungskennwort im AD ist gescheitert
[SetTPMandPinProtectorFailed]
Abort ERROR: PIN konnten nicht gesetzt werden
[Set:DeleteProduct]
; Prüft ob das System entschlüsselt ist
If %EncryptionState%<>FULLYDECRYPTED Then EncryptionState Else DriveFullyDecrypted EndIf
-Set EncryptionState=Uppercase(%EncryptionState%)
-Set EncryptionState=ReadTextFile ("%temp%\Bitlocker\CurrentEncryptionState.txt")
-WaitUntilFileExists "%temp%\Bitlocker\CurrentEncryptionState.txt" ,5
-CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {(&'BitLockerSAK' -GetEncryptionState).EncryptionState} > %temp%\Bitlocker\CurrentEncryptionState.txt"
-Call %systemroot%\System32\manage-bde.exe -off %systemdrive%
[Shell:Product]
%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Bitlocker Pin ändern.lnk,%windir%\System32\bdechangepin.exe,,%windir%\System32,,"%windir%\System32\bdechangepin.exe",0,-1,0
Re: Bitlocker über Package aktivieren
Moin zusammen,
habe es leider aus zeitlichen Gründen nicht eher geschafft mich zu melden. Aber vielen Dank für eure detaillierten Posts!
Ich setze mich dann mal in den nächsten Tagen mit eurem Input an die nächste Setup.inf
habe es leider aus zeitlichen Gründen nicht eher geschafft mich zu melden. Aber vielen Dank für eure detaillierten Posts!
Ich setze mich dann mal in den nächsten Tagen mit eurem Input an die nächste Setup.inf
Empirum V18.0 / Windows Server 2012 R2 / SQL Server 2012 Standard
Re: Bitlocker über Package aktivieren
Habe ich ähnlich gelöst, jedoch noch mit dem vbs da multilang bei mir und powershell falsche outputs geworfen hat.SRO wrote:Bei uns werden die Geräte direkt nach der OS und Softwareinstallation verschlüsselt und der Wiederherstellungskey im ADObjekt abgelegt. Das läuft wie folgt:
Du benötigst Das Bitlocker Swiss Army Knife von Stéphane vg
https://gallery.technet.microsoft.com/s ... s-a4777303
....
[/code]
Ich werde deinen Code mal prüfen ob das bei uns funktioniert.
(Falscher Output = OS komplettsprache auf zb. CZ, es wirft dann kein "BitlockerEncryptionInProgress" sondern irgendwas in Landessprache, was nicht mit Powershell rückwärts prüfbar war (in meinen Tests) die Abfragen ergaben falsche true and false Ergebnisse.
Re: Bitlocker über Package aktivieren
Moin,
ich habe mein Package nun auch so gut wie fertig.
Genutzt habe ich aber folgenden Befehl für die Abfrage, ob das Notebook im Akku- oder Netzbetrieb ist (Benötigt für HDD Vorbereitung):
ich habe mein Package nun auch so gut wie fertig.
Genutzt habe ich aber folgenden Befehl für die Abfrage, ob das Notebook im Akku- oder Netzbetrieb ist (Benötigt für HDD Vorbereitung):
Code: Select all
Callhidden cmd /c WMIC Path Win32_Battery Get BatteryStatus >"%BatteryStatusLog%"
;## In der Logdatei ist 1 = Akkubetrieb // 2 = Netzteil
If DoesTextInFileExist ("2", "%BatteryStatusLog%") == "1" Then "Start" Else "Abort" EndIf
Empirum V18.0 / Windows Server 2012 R2 / SQL Server 2012 Standard
-
- Posts: 22
- Joined: 28. Jul 2015, 10:39
- Contact:
Re: Bitlocker über Package aktivieren
Moin, läuft das bei euch unter Windows 10 mit aktiver UAC? Die Powershell-Aufrufe und die manage-bde müssen ja mit erhöhten Rechten ausgeführt werden. Hatte versucht das so zu lösen, in der PS ISE funktioniert das auch wunderbar, nur im Paket bzw. Packageeditor nicht. BSP:
Code: Select all
callhidden powershell -OutputFormat Text -WindowStyle Hidden -command "& {Start-Process -filepath PowerShell -ArgumentList 'Import-Module C:\bitlocker_tmp\BitLockerSAK.ps1;BitlockerSAK -IsTPMEnabled > C:\Bitlocker_tmp\IsTPMEnabled.txt' -Verb RunAs}"
Re: Bitlocker über Package aktivieren
Die Installation wird doch im Systemkontext ausgeführt, also viel höhere Rechte gibbet da net.
Wie hast du denn das Packaging Center gestartet?
...und UAC ist aus
Wie hast du denn das Packaging Center gestartet?
...und UAC ist aus
-
- Moderator
- Posts: 7969
- Joined: 13. Dec 2004, 23:10
- Location: Adendorf/Lüneburg
Re: Bitlocker über Package aktivieren
Ich habe neulich mal eine einfache passwortbasierte Bitlocker Verschlüsselung zu gescriptet:
setup.inf-Auszug:
[Set:Installation]
CallHidden Powershell.exe -ExecutionPolicy Unrestricted -Command "%Src%\bitlocker-activation.ps1"
bitlocker-activation.ps1
$SecureString = ConvertTo-SecureString "Matrix42!!!" -AsPlainText -Force
Enable-BitLocker -MountPoint "C:" -EncryptionMethod Aes256 -UsedSpaceOnly -PasswordProtector $SecureString
setup.inf-Auszug:
[Set:Installation]
CallHidden Powershell.exe -ExecutionPolicy Unrestricted -Command "%Src%\bitlocker-activation.ps1"
bitlocker-activation.ps1
$SecureString = ConvertTo-SecureString "Matrix42!!!" -AsPlainText -Force
Enable-BitLocker -MountPoint "C:" -EncryptionMethod Aes256 -UsedSpaceOnly -PasswordProtector $SecureString
Hendrik Ambrosius / Senior Presales Consultant
Mobile: +49 172 408 4447 | hendrik.ambrosius@matrix42.com
Matrix42 GmbH | Elbinger Straße 7 | 60487 Frankfurt am Main | Germany | www.matrix42.com
Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of Matrix42 or of the support team.
Mobile: +49 172 408 4447 | hendrik.ambrosius@matrix42.com
Matrix42 GmbH | Elbinger Straße 7 | 60487 Frankfurt am Main | Germany | www.matrix42.com
Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of Matrix42 or of the support team.
Re: Bitlocker über Package aktivieren
Ohne PIN, mit Win10 22H2 kompatibel sieht es so aus. Aufgrund der Schwierigkeiten, die BitlockerSAK.ps1 Funktionssammlung inline zu parsen wurde ein cmd-Wrapper hinzugefügt.
Setup.inf
BitlockerSAK.cmd
BitlockerSAK.ps1
Quelle: https://raw.githubusercontent.com/Steph ... kerSAK.ps1
Setup.inf
Code: Select all
[SetupInfo]
Author =
CreationDate = 03.01.2024
InventoryID =
Description = Enable / Disable Bitlocker
Method = Script
Tested on =
Dependencies =
Command line options = /S0
Last Change =
Build =
[VarDefInfo]
; <Variable>, <Type: 0=Computer 1=User>, <Allow NULL values: 0=No 1=Yes>
[Setup]
Version=14.2
ShowCaption=1
BlockInput=0
Platform=x64
[Requirements]
[Application]
ProductName=Bitlocker
DeveloperName=Microsoft
Version=1.0
Revision=0
SetupName=%ProductName% %Version% %SetupWizard%
Text1="%ProductName% %Version%", Arial, 30, , 2170F3, 4, , LEFT BOLD ITALIC
Text2="%DeveloperName%", Arial, 24, , 2170F3, 4, , LEFT BOLD ITALIC
Text8="%Company%", Arial, 18, , 2170F3, 4, 10, RIGHT BOLD ITALIC
Text9="%InstallationFor% %WindowsUser%", Arial, 16, , 2170F3, 4, -18, BOTTOM ITALIC LEFT
BackgroundColor=EFEFEF,000000
CopyDialogRect=0%, 77%, 100%, 100%, HCENTER
; Register all installations in common registry key
UserKeyName=$Matrix42Packages$\%DeveloperName%\%ProductName%
MachineKeyName=$Matrix42Packages$\%DeveloperName%\%ProductName%\%Version%
UninstallKeyName=Matrix42 - %DeveloperName% %ProductName% %Version%
UninstallDisplayName=Matrix42 - %DeveloperName% %ProductName% %Version%
UninstallString=%ReinstallString% /U
ReinstallString="%CommonSetupDir%\Setup.exe" "%App%\%SetupInfDir%\Setup.inf"
UninstallDisplayIcon="%WINDIR%\EmPack\%DeveloperName%\%ProductName%\%Version%\%SetupInfDir%\app.ico",0
UninstallOptions=NOREMOVE NOREPAIR NOMODIFY
ReinstallMode=1
SrcDir=..
; Matrix42 Scripts are copied in a common scripts directory
ApplicationDir=%CommonAppData%\$Matrix42Scripts$\%DeveloperName%\%ProductName%\%Version%
SetupInfDir=Install
DataDir=%Personal%
AskUninstallOld=1
ShellLinks=1
CommonShellLinks=1
CreateUnresolvableShellLinks=1
UseStringSection=Strings:09
UseSysStringSection=SysStrings:09
DateWarning=1
SizeWarning=0
Reboot=2
PreventExternalReboot=1
StartServicesOnReboot=0
CallTimeOut=3600
AbortAfterCallTimeOut=1
DisableCancelButton=1
ShowEndMessage=1
EndMessage=%EndMessageDesc%
[Strings:07]
Disk1=Installationsmedium 1
EndMessageDesc=Die Installation wurde erfolgreich abgeschlossen!
ErrorLogMessage=Die Installation/Deinstallation wurde mit einer Fehlermeldung abgebrochen!
InstallationFor=Installation für:
InstallerDesc=Dienstprogramm zum Installieren einzelner Komponenten.
InstallerName=Installationsprogramm
SetupWizard=Installations-Assistent
Uninstallation=deinstallieren
UserInformation1=Bitte haben Sie einen Moment Geduld. Die zugewiesene Software wird installiert.
UserInformation2=Bei Fragen und Problemen wenden Sie sich bitte an
[Strings:09]
Disk1=Installation media 1
EndMessageDesc=Installation was completed successfully!
ErrorLogMessage=The installation/uninstallation aborted with an error message!
InstallationFor=Installation for:
InstallerDesc=Service program to install single components.
InstallerName=Setup program
SetupWizard=Installation Wizard
Uninstallation=Uninstallation
UserInformation1=Bitte haben Sie einen Moment Geduld. Die zugewiesene Software wird installiert.
UserInformation2=Bei Fragen und Problemen wenden Sie sich bitte an
[SysStrings:07]
Users=Benutzer
[SysStrings:09]
Users=Users
[Environment]
CommonSetupDir=%CommonFilesDir%\Setup%SetupBits%
V_MachineValuesPath=\\%EmpirumServer%\Values$\MachineValues\%DomainName%
V_UserValuesPath=%HKLM,"Software\matrix42\Software Depot","HomeServer"%\Values$\UserValues\%UserDomain%
; Maschinenabhängige Variablen
; machine dependent variables
;VM_<Variable>=%%%V_MachineValuesPath%\%ComputerName%.ini,%ComputerName%,<Variable>%%
; Userabhängige Variablen
; user dependent variables
;VU_<Variable>=%%%V_UserValuesPath%\%WindowsUser%.ini,%WindowsUser%,<Variable>%%
; !!! Setzen der entsprechenden ReplaceEnv Befehle für die Variablen im Abschnitt [Product] nicht vergessen!!!
; !!! Don't forget to set the appropriate ReplaceEnv instructions for the variables in the section [Product]!!!
[Prompts]
[Services]
[Processes]
[EventSources]
[Encryption]
; PIN
[Disks]
1=%Disk1%
[Options]
Installer = %InstallerName%, COPYALWAYS, Installer, "%InstallerDesc%"
Product = %ProductName%, COPYALWAYS, Product, "%ProductDesc%"
[Installer]
1:..\..\..\..\..\User\Setup.exe, %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\..\User\SetupDeu.chm, %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\..\User\SetupEnu.chm, %CommonSetupDir%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP, 0
1:..\..\..\..\..\User\Mx42SynSem.dll, %System%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP WINDOWS32, 0
1:..\..\..\..\..\User\x64\Mx42SynSem.dll, %System%, OPTIONAL USEFILENAME DIRECTORY NOSIZEWARNING SETUP WINDOWS64, 0
1:%SetupInfDir%\Setup.inf, "%WINDOWS%\EmPack\%DeveloperName%\%ProductName%\%Version%\" , NORMAL, 0
1:%SetupInfDir%\app.ico, "%WINDIR%\EmPack\%DeveloperName%\%ProductName%\%Version%\" , NORMAL, 0
1:%Temp%\Setup64.exe, %CommonSetupDir%\Setup.exe, OPTIONAL NOSIZEWARNING SETUP ALWAYS WINDOWS64, 0
[Product]
; ReplaceEnv <Variable>
#Set:Product, DONTDELETE
#Set:DeleteProduct, DELETE
[Set:Product]
; 1:, %App%, CREATE DIRECTORY CASCADED, 0
DEL "%temp%\Bitlocker\*.txt"
; Prüft ob das System entschlüsselt ist
CallHidden "%SRC%\BitlockerSAK.cmd" GetEncryptionState
WaitUntilFileExists "%temp%\Bitlocker\CurrentEncryptionState.txt" ,5
Set EncryptionState=ReadTextFile ("%temp%\Bitlocker\CurrentEncryptionState.txt")
Set EncryptionState=Uppercase(%EncryptionState%)
If %EncryptionState% == "" Then "PsCommandError" EndIf
If %EncryptionState%<>FULLYDECRYPTED Then EncryptionState Else StartDriveEncryption EndIf
[StartDriveEncryption]
; Prüfe ob ein TPM-Module vorhanden ist.
CallHidden "%SRC%\BitlockerSAK.cmd" -IsTPMEnabled "%temp%\Bitlocker\IsTPMEnabled.txt"
WaitUntilFileExists "%temp%\Bitlocker\IsTPMEnabled.txt" ,5
Set IsTPMEnabled=ReadTextFile ("%temp%\Bitlocker\IsTPMEnabled.txt")
Set IsTPMEnabled=Uppercase(%IsTPMEnabled%)
If %IsTPMEnabled%<>TRUE Then TPMNotEnabled EndIf
ErrorLogMsg [Info] Ein TPM ist vorhanden
; Prüfe ob das TPM-Module aktiv ist
CallHidden "%SRC%\BitlockerSAK.cmd" -IsTPMActivated "%temp%\Bitlocker\IsTPMActivated.txt"
WaitUntilFileExists "%temp%\Bitlocker\IsTPMActivated.txt" ,5
Set IsTPMActivated=ReadTextFile ("%temp%\Bitlocker\IsTPMActivated.txt")
Set IsTPMActivated=Uppercase(%IsTPMActivated%)
If %IsTPMActivated%<>TRUE Then TPMNotActivated EndIf
ErrorLogMsg [Info] Das TPM ist aktiviert
; Prüfe den Besitz des TPM-Modules
CallHidden "%SRC%\BitlockerSAK.cmd" -IsTPMOwned "%temp%\Bitlocker\IsTPMOwned.txt"
WaitUntilFileExists "%temp%\Bitlocker\IsTPMOwned.txt" ,5
Set IsTPMOwned=ReadTextFile ("%temp%\Bitlocker\IsTPMOwned.txt")
Set IsTPMOwned=Uppercase(%IsTPMOwned%)
If %IsTPMOwned%<>TRUE Then TPMNotOwned EndIf
ErrorLogMsg [Info] Das TPM ist im Besitz
; Prüft ob das System entschlüsselt ist
CallHidden "%SRC%\BitlockerSAK.cmd" GetEncryptionState
WaitUntilFileExists "%temp%\Bitlocker\CurrentEncryptionState.txt" ,5
Set EncryptionState=ReadTextFile ("%temp%\Bitlocker\CurrentEncryptionState.txt")
Set EncryptionState=Uppercase(%EncryptionState%)
If %EncryptionState%<>FULLYDECRYPTED Then EncryptionState EndIf
ErrorLogMsg [Info] Das System ist entschlüsselt
; Prüft ob Schlüsselschutzvorrichtungen vorhanden sind
CallHidden "%SRC%\BitlockerSAK.cmd" -GetKeyProtectorIds "%temp%\Bitlocker\GetKeyProtectorIds.txt"
WaitUntilFileExists "%temp%\Bitlocker\GetKeyProtectorIds.txt" ,5
Set GetKeyProtectorIds=ReadTextFile ("%temp%\Bitlocker\GetKeyProtectorIds.txt")
If %GetKeyProtectorIds%<>"" Then ResetKeyProtectors EndIf
If %GetKeyProtectorIds%<>"" Then ResetKeyProtectorsFailed EndIf
ErrorLogMsg [Info] Es ist keine Schlüsselschutzvorrichtungen vorhanden
; Setzen des Wiederherstellungskennwortes für das System
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {((&'Add-BitLockerKeyProtector' -MountPoint %systemdrive% -RecoveryPasswordProtector).KeyProtector | Where-Object {$_.KeyProtectorType -eq 'RecoveryPassword'}).KeyProtectorId} > %temp%\Bitlocker\RecoveryPasswordProtectorId.txt"
WaitUntilFileExists "%temp%\Bitlocker\RecoveryPasswordProtectorId.txt" ,5
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {(&'Get-Content' -Path '%temp%\Bitlocker\RecoveryPasswordProtectorId.txt') -match '\{[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}\}'} > %temp%\Bitlocker\isProtectorIdGUID.txt"
WaitUntilFileExists "%temp%\Bitlocker\isProtectorIdGUID.txt" ,5
Set RecoveryPasswordProtectorId=ReadTextFile ("%temp%\Bitlocker\RecoveryPasswordProtectorId.txt")
Set RecoveryPasswordProtectorId=Uppercase(%RecoveryPasswordProtectorId%)
Set isProtectorIdGUID=ReadTextFile ("%temp%\Bitlocker\isProtectorIdGUID.txt")
Set isProtectorIdGUID=Uppercase(%isProtectorIdGUID%)
If %isProtectorIdGUID%<>TRUE Then SetRecoveryPasswordProtectorFailed EndIf
ErrorLogMsg [Info] Das Wiederherstellungskennwort wurde gesetzt
; Sichern des Wiederherstellungskennwortes im AD
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {((&'Backup-BitLockerKeyProtector' -MountPoint %systemdrive% -KeyProtectorId '%RecoveryPasswordProtectorId%').KeyProtector | Where-Object {$_.KeyProtectorType -eq 'RecoveryPassword'}).KeyProtectorId} > %temp%\Bitlocker\BackupRecoveryPasswordProtector.txt"
WaitUntilFileExists "%temp%\Bitlocker\BackupRecoveryPasswordProtector.txt" ,5
Set BackupRecoveryPasswordProtector=ReadTextFile ("%temp%\Bitlocker\BackupRecoveryPasswordProtector.txt")
Set BackupRecoveryPasswordProtector=Uppercase(%BackupRecoveryPasswordProtector%)
If %BackupRecoveryPasswordProtector%<>%RecoveryPasswordProtectorId% Then BackupRecoveryPasswordProtectorFailed EndIf
ErrorLogMsg [Info] Das Wiederherstellungskennwort wurde ins AD gesichert
; Setzen des Standard BitLocker-Pin
; Requires [Encryption] PIN
; CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {((&'Add-BitLockerKeyProtector' -MountPoint %systemdrive% -Pin (ConvertTo-SecureString '%PIN%' -AsPlainText -Force) -TPMandPinProtector).KeyProtector | Where-Object {$_.KeyProtectorType -eq 'TpmPin'}).KeyProtectorId} > %temp%\Bitlocker\TPMandPinProtector.txt"
; WaitUntilFileExists "%temp%\Bitlocker\TPMandPinProtector.txt" ,5
; CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {(&'Get-Content' -Path '%temp%\Bitlocker\TPMandPinProtector.txt') -match '\{[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}\}'} > %temp%\Bitlocker\isPINProtectorIdGUID.txt"
; WaitUntilFileExists "%temp%\Bitlocker\isPINProtectorIdGUID.txt" ,5
; Set TPMandPinProtector=ReadTextFile ("%temp%\Bitlocker\TPMandPinProtector.txt")
; Set TPMandPinProtector=Uppercase(%TPMandPinProtector%)
; Set isPINProtectorIdGUID=ReadTextFile ("%temp%\Bitlocker\isPINProtectorIdGUID.txt")
; Set isPINProtectorIdGUID=Uppercase(%isPINProtectorIdGUID%)
; If %isPINProtectorIdGUID%<>TRUE Then SetTPMandPinProtectorFailed EndIf
; ErrorLogMsg [Info] Der PIN wurde gesetzt
; BitLocker aktivieren
CallHidden %systemroot%\System32\manage-bde.exe -protectors -enable %systemdrive%
CallHidden %systemroot%\System32\manage-bde.exe -on %systemdrive%
ErrorLogMsg [Info] Das System ist für die Verschlüsselung vorbereitet und wird nach einen Neustart verschlüsselt
CallHidden shutdown -r -t 10
AbortReboot INFO: Das System ist für die Verschlüsselung vorbereitet und wird nach einen Neustart verschlüsselt
[PsCommandError]
Abort ERROR: PowerShell Command fehlgeschlagen.
[TPMNotEnabled]
Abort ERROR: Kein TPM vorhanden.
[TPMNotActivatable]
Abort ERROR: TPM konnte nicht aktiviert werden
[TPMcannotTakeOwnerShip]
Abort ERROR: konnte Besitz des TPMs nicht übernehmen
[TPMNotActivated]
If DoesFileExist("%temp%\Bitlocker\tryTPMActivation.txt") == "1" Then TPMNotActivatable EndIf
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {&'Initialize-Tpm'} > %temp%\Bitlocker\tryTPMActivation.txt"
CallHidden shutdown -r -t 5
AbortReboot INFO: Versuche das TPM zu aktivieren
[TPMNotOwned]
If DoesFileExist("tryTakeTPMOwnership.txt") == "1" Then TPMcannotTakeOwnerShip EndIf
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {&'Initialize-Tpm'} > %temp%\Bitlocker\tryTakeTPMOwnership.txt"
CallHidden shutdown -r -t 5
AbortReboot INFO: Versuche das TPM zurückzusetzten
[EncryptionState]
If %EncryptionState% == FULLYENCRYPTED Then DriveFullyEncrypted EndIf
If %EncryptionState% == ENCRYPTIONINPROGRESS Then DriveEncryptionInProgress EndIf
If %EncryptionState% == ENCRYPTIONPAUSED Then DriveEncryptionPaused EndIf
If %EncryptionState% == DECRYPTIONPAUSED Then DriveDecryptionPaused EndIf
If %EncryptionState% == DECRYPTIONINPROGRESS Then DriveDecryptionInProgress EndIf
If %EncryptionState% == FULLYDECRYPTED Then DriveFullyDecrypted EndIf
[DriveFullyEncrypted]
ErrorLogMsg [Info] Das Laufwerk wurde erfolgreich verschlüsselt
[DriveEncryptionInProgress]
For Counter,0,100,1,"CheckEncryptionProgress"
If %EncryptionProgress%<>100 Then DriveEncryptionInProgress Else DriveFullyEncrypted EndIf
[DriveDecryptionInProgress]
If %EncryptionProgress%<>0 Then DriveDecryptionInProgress Else DriveFullyDecrypted EndIf
For Counter,100,0,-1,"CheckDecryptionProgress"
[CheckEncryptionProgress]
CallHidden "%SRC%\BitlockerSAK.cmd" CurrentEncryptionProgress
WaitUntilFileExists "%temp%\Bitlocker\CurrentEncryptionProgress.txt" ,5
Set EncryptionProgress=ReadTextFile ("%temp%\Bitlocker\CurrentEncryptionProgress.txt")
Set EncryptionProgress=Uppercase(%EncryptionProgress%)
Set Counter=%EncryptionProgress%
ErrorLogMsg [Info] Verschlüsselt (Prozent): %EncryptionProgress%
Sleep 60000
[CheckDecryptionProgress]
-Sleep 60000
-ErrorLogMsg [Info] Verschlüsselt (Prozent): %EncryptionProgress%
-Set Counter=%EncryptionProgress%
-Set EncryptionProgress=Uppercase(%EncryptionProgress%)
-Set EncryptionProgress=ReadTextFile ("%temp%\Bitlocker\CurrentEncryptionProgress.txt")
-WaitUntilFileExists "%temp%\Bitlocker\CurrentEncryptionProgress.txt" ,5
-CallHidden "%SRC%\BitlockerSAK.cmd" CurrentEncryptionProgress
[DriveFullyDecrypted]
-ErrorLogMsg [Info] Das Laufwerk wurde erfolgreich entschlüsselt
[DriveEncryptionPaused]
Abort ERROR: Die Laufwerksverschlüsselung ist gerade pausiert
[DriveDecryptionPaused]
-Abort ERROR: Die Laufwerksentschlüsselung ist gerade pausiert
[ResetKeyProtectors]
ErrorLogMsg [Info] versuche Schlüsselschutzvorrichtungen zurück zu setzten
CallHidden powershell -ExecutionPolicy Unrestricted -OutputFormat Text -WindowStyle Hidden -command "& {&'Disable-BitLocker' -MountPoint %systemdrive%} > %temp%\Bitlocker\Disable-BitLocker.txt"
CallHidden "%SRC%\BitlockerSAK.cmd" -GetKeyProtectorIds "%temp%\Bitlocker\GetKeyProtectorIds.txt"
Set GetKeyProtectorIds=ReadTextFile ("%temp%\Bitlocker\GetKeyProtectorIds.txt")
[ResetKeyProtectorsFailed]
Abort ERROR: Schlüsselschutzvorrichtungen konnten nicht zurück gesetzt werden
[SetRecoveryPasswordProtectorFailed]
Abort ERROR: Wiederherstellungskennwort konnten nicht gesetzt werden
[BackupRecoveryPasswordProtectorFailed]
Abort ERROR: Sichern des Wiederherstellungskennwort im AD ist gescheitert
[SetTPMandPinProtectorFailed]
Abort ERROR: PIN konnten nicht gesetzt werden
[Set:DeleteProduct]
; Prüft ob das System entschlüsselt ist
If %EncryptionState%<>FULLYDECRYPTED Then EncryptionState Else DriveFullyDecrypted EndIf
-Set EncryptionState=Uppercase(%EncryptionState%)
-Set EncryptionState=ReadTextFile ("%temp%\Bitlocker\CurrentEncryptionState.txt")
-WaitUntilFileExists "%temp%\Bitlocker\CurrentEncryptionState.txt" ,5
-CallHidden "%SRC%\BitlockerSAK.cmd" GetEncryptionState
-DEL "%temp%\Bitlocker\*.txt"
-Call %systemroot%\System32\manage-bde.exe -off %systemdrive%
[Shell:Product]
; %ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\Bitlocker Pin ändern.lnk,%windir%\System32\bdechangepin.exe,,%windir%\System32,,"%windir%\System32\bdechangepin.exe",0,-1,0
Code: Select all
@echo off
setlocal enabledelayedexpansion
REM
REM Prerequisites.
REM Elevated process.
REM
REM Command line.
REM "\\empirum\configurator$\Packages\Microsoft\Bitlocker\1.0\BitlockerSAK.cmd" CurrentEncryptionProgress
REM "\\empirum\configurator$\Packages\Microsoft\Bitlocker\1.0\BitlockerSAK.cmd" GetEncryptionState
REM
REM Runtime Variables.
SET SCRIPT_PATH=%~dps0
SET OUTPUT_PATH="%TEMP%\Bitlocker"
REM
MD "%OUTPUT_PATH%" 2>NUL:
REM
IF /I "%1" == "CurrentEncryptionProgress" call :getCurrentEncryptionProgress & goto :eof
IF /I "%1" == "GetEncryptionState" call :getEncryptionState & goto :eof
REM
call :forwardFirstParameterOnly %1 %2
REM
goto :eof
:forwardFirstParameterOnly
REM
IF "%2" == "" echo [ERROR] Param 2 LogFile missing. & goto :eof
powershell -ExecutionPolicy Unrestricted -OutputFormat Text -command "& {. %SCRIPT_PATH%BitlockerSAK.ps1;&'BitLockerSAK' %1}" > %2
TYPE %2
REM
goto :eof
:getCurrentEncryptionProgress
REM
powershell -ExecutionPolicy Unrestricted -OutputFormat Text -command "& {. %SCRIPT_PATH%BitlockerSAK.ps1;(&'BitLockerSAK' -GetEncryptionState).CurrentEncryptionProgress}" > "%OUTPUT_PATH%\CurrentEncryptionProgress.txt"
TYPE "%OUTPUT_PATH%\CurrentEncryptionProgress.txt"
REM
goto :eof
:getEncryptionState
REM
powershell -ExecutionPolicy Unrestricted -OutputFormat Text -command "& {. %SCRIPT_PATH%BitlockerSAK.ps1;(&'BitLockerSAK' -GetEncryptionState).EncryptionState}" > "%OUTPUT_PATH%\CurrentEncryptionState.txt"
TYPE "%OUTPUT_PATH%\CurrentEncryptionState.txt"
REM
goto :eof
Quelle: https://raw.githubusercontent.com/Steph ... kerSAK.ps1
Who is online
Users browsing this forum: No registered users and 3 guests