-
Notifications
You must be signed in to change notification settings - Fork 82
SystemProtection
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Ensure | Required | String | Indicates that the computer restore is enabled or is disabled. |
Present , Absent
|
DriveLetter | Key | String | Specifies the drive letter to enable or disable protection on. | |
DiskUsage | Write | SInt32 | Specifies the maximum disk space to use for protection as a percentage. | |
Force | Write | Boolean | Forces desired state to be applied regardless of data loss. Defaults to False. |
This resource is used configure System Protection. System Protection is only applicable to workstation operating systems. Server operating systems are not supported.
The amount of disk that can be allocated for System Protection is configurable on a per-drive basis which is why this resource doesn't accept an array of drives like xWindowsRestore did.
If you reduce the disk usage for a protected drive, the resource will try to resize it but VSS could throw an error because you have to delete checkpoints first. When you set Force to $true, SystemProtection will attempt the resize and if VSS throws an error, SystemProtection will delete all checkpoints on the the protected drive and try the resize operation again.
Make sure you fully understand and accept the risks associated with using the Force parameter.
Enables system protection for the C drive using the default value of 10 percent disk usage.
Configuration SystemProtection_EnableDriveC_Config
{
Import-DSCResource -ModuleName ComputerManagementDsc
Node localhost
{
SystemProtection DriveC
{
Ensure = 'Present'
DriveLetter = 'C'
}
}
}
Enables system protection for the C drive and sets the maximum restore point disk usage to 5 percent.
Configuration SystemProtection_EnableDriveC_5Percent_Config
{
Import-DSCResource -ModuleName ComputerManagementDsc
Node localhost
{
SystemProtection DriveC
{
Ensure = 'Present'
DriveLetter = 'C'
DiskUsage = 5
}
}
}
Disables system protection for the F drive.
Configuration SystemProtection_DisableDriveF_Config
{
Import-DSCResource -ModuleName ComputerManagementDsc
Node localhost
{
SystemProtection DriveF
{
Ensure = 'Absent'
DriveLetter = 'F'
}
}
}
Sets the maximum disk usage for Drive C to 15 percent. Assumes the current disk usage is configured for a higher percentage and you want to delete checkpoints.
Configuration SystemProtection_ReduceDriveCDiskUsage_Config
{
Import-DSCResource -ModuleName ComputerManagementDsc
Node localhost
{
SystemProtection DriveC
{
Ensure = 'Present'
DriveLetter = 'C'
DiskUsage = 15
Force = $true
}
}
}
Enables system protection for the C drive using the default value of 10 percent disk usage and the D drive with 25 percent disk usage.
Configuration SystemProtection_MultiDrive_Config
{
Import-DSCResource -ModuleName ComputerManagementDsc
Node localhost
{
SystemProtection DriveC
{
Ensure = 'Present'
DriveLetter = 'C'
DiskUsage = 15
}
SystemProtection DriveD
{
Ensure = 'Present'
DriveLetter = 'D'
DiskUsage = 25
}
}
}
- Computer
- IEEnhancedSecurityConfiguration
- OfflineDomainJoin
- PendingReboot
- PowerPlan
- PowerShellExecutionPolicy
- PSResourceRepository
- RemoteDesktopAdmin
- ScheduledTask
- SmbServerConfiguration
- SmbShare
- SystemLocale
- SystemProtection
- SystemRestorePoint
- TimeZone
- UserAccountControl
- VirtualMemory
- WindowsCapability
- WindowsEventLog