Script to configure Firewall on Windows devices
This PowerShell script helps IT admins configure Windows Firewall by enabling security rules, allowing or blocking specific traffic, and automating network protection.
This article provides a PowerShell script that can be used to enable BitLocker encryption on a Windows system.
This script takes the hassle out of enabling BitLocker encryption on your Windows drives using PowerShell, making sure your data stays safe and meets security standards.
Prerequisites:
# Enable BitLocker on a specific drive
$DriveLetter = "C:"
$RecoveryKeyPath = "C:\RecoveryKeys"
# Check if BitLocker is already enabled
$BitLockerStatus = Get-BitLockerVolume -MountPoint $DriveLetter
if ($BitLockerStatus.ProtectionStatus -eq "On") {
Write-Output "BitLocker is already enabled on drive $DriveLetter."
return
}
# Ensure the recovery key directory exists
if (!(Test-Path -Path $RecoveryKeyPath)) {
New-Item -ItemType Directory -Path $RecoveryKeyPath
Write-Output "Created recovery key directory at $RecoveryKeyPath."
}
# Enable BitLocker with recovery key backup
Enable-BitLocker -MountPoint $DriveLetter -EncryptionMethod XtsAes256 -RecoveryKeyPath $RecoveryKeyPath -UsedSpaceOnly
Write-Output "BitLocker encryption has been initiated on drive $DriveLetter. Recovery key is stored in $RecoveryKeyPath."
Let's break it down step by step:
This PowerShell script helps IT admins configure Windows Firewall by enabling security rules, allowing or blocking specific traffic, and automating network protection.
Secure your drives effortlessly! This guide walks you through enabling BitLocker encryption with a PowerShell script, complete with setup instructions, use cases, and best practices for data protection.
FEATURES
EXPLORE IT Asset Management