diff --git a/cleanup.ps1 b/cleanup.ps1 index 133a250..98aa76b 100644 --- a/cleanup.ps1 +++ b/cleanup.ps1 @@ -8,4 +8,13 @@ Add-MpPreference -ExclusionProcess "C:\Program Files\TacticalAgent\tacticalrmm.e Add-MpPreference -ExclusionProcess "C:\ProgramData\TacticalRMM\tacticalagent*" Add-MpPreference -ExclusionProcess "C:\Windows\Temp\is-*.tmp\tacticalagent*" +# -------------------------------------------------------------------------------- +# Enable daily restore points + +Enable-ComputerRestore -Drive 'C:' + +Register-ScheduledTask -TaskName "Daily System Restore" -Action (New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "-ExecutionPolicy Bypass -Command `"Checkpoint-Computer -Description \"\"AUTOMATIC-$(Get-Date -Format 'yyyyMMddHHmmss')\"\" -RestorePointType \"\"MODIFY_SETTINGS\"\"`"") -Trigger (New-ScheduledTaskTrigger -Daily -At 9am) -Settings (New-ScheduledTaskSettingsSet -StartWhenAvailable -DontStopOnIdleEnd -RunOnlyIfNetworkAvailable) -Principal (New-ScheduledTaskPrincipal -UserId "NT AUTHORITY\SYSTEM" -LogonType ServiceAccount -RunLevel Highest) + +Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore" -Name "SystemRestorePointFrequency" -Value 0 -Type DWORD -Force + # -------------------------------------------------------------------------------- \ No newline at end of file