-
Notifications
You must be signed in to change notification settings - Fork 20
/
disableVBS.ps1
14 lines (11 loc) · 898 Bytes
/
disableVBS.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Disables Virtualization Based Security (VBS), Credential Guard and HVCI.
# VBS enhances system security, but is known to cause some performance issues on older systems.
# Privilege Escalation
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Start-Process PowerShell -Verb RunAs "-NoProfile -ExecutionPolicy Bypass -Command `"cd '$pwd'; & '$PSCommandPath';`"";
exit;
}
Set-Itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard" -Name "EnableVirtualizationBasedSecurity" -Value 0
Set-Itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity" -Name "Enabled" -Value 0
Set-Itemproperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\CredentialGuard" -Name "Enabled" -Value 0
pause