forked from dsccommunity/xBitlocker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConfigureBitlockerAndAutoBitlocker.ps1
50 lines (44 loc) · 1.82 KB
/
ConfigureBitlockerAndAutoBitlocker.ps1
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
Configuration ConfigureBitlockerAndAutoBitlocker
{
Import-DscResource -ModuleName PSDesiredStateConfiguration
Import-DscResource -ModuleName xBitlocker
Node 'localhost'
{
# First install the required Bitlocker features
WindowsFeature BitlockerFeature
{
Name = 'Bitlocker'
Ensure = 'Present'
IncludeAllSubFeature = $true
}
WindowsFeature BitlockerToolsFeature
{
Name = 'RSAT-Feature-Tools-Bitlocker'
Ensure = 'Present'
IncludeAllSubFeature = $true
}
# This example enables Bitlocker on the Operating System drive using both a RecoveryPasswordProtector and a StartupKeyProtector
xBLBitlocker Bitlocker
{
MountPoint = 'C:'
PrimaryProtector = 'RecoveryPasswordProtector'
StartupKeyProtector = $true
StartupKeyPath = 'A:'
RecoveryPasswordProtector = $true
AllowImmediateReboot = $true
UsedSpaceOnly = $true
DependsOn = '[WindowsFeature]BitlockerFeature', '[WindowsFeature]BitlockerToolsFeature'
}
# This example sets up AutoBitlocker for any drive of type Fixed with a RecoveryPasswordProtector only.
xBLAutoBitlocker AutoBitlocker
{
DriveType = 'Fixed'
PrimaryProtector = 'RecoveryPasswordProtector'
RecoveryPasswordProtector = $true
UsedSpaceOnly = $true
# Don't enable AutoBL until the OS drive has been encrypted
DependsOn = '[xBLBitlocker]Bitlocker'
}
}
}
ConfigureBitlockerAndAutoBitlocker