A PowerShell script for suspending BitLocker protection on local or remote Windows computers for a specified number of reboots.
- Single or Multiple Computers: Suspend BitLocker on one computer or batch process multiple systems
- File-Based Input: Process computer lists from text files
- Comprehensive Validation: Performs 6 validation checks before suspending BitLocker
- Detailed Logging: Timestamped logs with color-coded console output
- Delay Support: Optional delay before suspension for scheduled operations
- Remote Execution: Supports remote computers via PowerShell remoting
- PowerShell 4.0 or higher (Windows PowerShell or PowerShell 7+ on Windows)
- Administrator privileges
- Windows operating system
- For remote computers: WinRM/PowerShell remoting enabled
- BitLocker must be available on target systems
- Clone this repository or download
SuspendBitlocker.ps1 - Ensure PowerShell execution policy allows script execution:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.\SuspendBitlocker.ps1
.\SuspendBitlocker.ps1 -Help.\SuspendBitlocker.ps1 -RebootCount 2.\SuspendBitlocker.ps1 -ComputerName "SERVER01" -RebootCount 1.\SuspendBitlocker.ps1 -ComputerList "PC01","PC02","PC03" -RebootCount 2Create a text file with one hostname per line, then run:
.\SuspendBitlocker.ps1 -ComputerList "C:\computers.txt" -RebootCount 1.\SuspendBitlocker.ps1 -ComputerName "SERVER01" -DelaySeconds 300 -RebootCount 1| Parameter | Type | Description | Default |
|---|---|---|---|
-ComputerName |
string | Single computer hostname or IP | Local computer |
-ComputerList |
string[] | Array of computers or file path | N/A |
-RebootCount |
int | Number of reboots to suspend (1-15) | 1 |
-DelaySeconds |
int | Delay before suspension (0-86400) | 0 |
-LogPath |
string | Directory for log files | Script directory |
-Help |
switch | Display help message | N/A |
The script performs these checks for each computer:
- Administrator Privileges - Verifies script is running as admin
- Hostname Validation - DNS resolution check
- Network Connectivity - Ping test
- Remote Connection - WinRM/PowerShell remoting check (remote only)
- BitLocker Capability - Verifies BitLocker is available
- Pending Reboot - Detects pending reboots (warning only)
Log files are automatically created with timestamps:
- Format:
SuspendBitlocker_yyyyMMdd_HHmmss.log - Location: Script directory (or specified via
-LogPath) - Includes: Timestamp, log level, and detailed messages
.\SuspendBitlocker.ps1 -RebootCount 3.\SuspendBitlocker.ps1 -ComputerList "SRV01","SRV02" -RebootCount 1 -DelaySeconds 300.\SuspendBitlocker.ps1 -ComputerList "C:\IT\workstations.txt" -RebootCount 2Plain text file with one hostname per line:
WORKSTATION01
WORKSTATION02
SERVER01
Empty lines are automatically skipped.
- Failed computers are skipped with detailed error logging
- Script continues processing remaining computers after failures
- Exit codes: 0 (success), 1 (failure)
- Summary report shows success/failure counts
- Requires administrator privileges
- Suspending BitLocker temporarily disables drive encryption protection
- Only suspend BitLocker when necessary (e.g., BIOS updates, hardware changes)
- All operations are logged for audit purposes
Feel free to submit issues or pull requests for improvements.
This project is licensed under the MIT License - feel free to use, modify, and distribute.