mirror of
https://github.com/msvc-win/get.msvc.win.git
synced 2025-12-16 05:07:39 +00:00
Update auditbreak
This commit is contained in:
parent
a06d5e58f6
commit
8cd6209fc0
1 changed files with 4 additions and 6 deletions
10
auditbreak
10
auditbreak
|
|
@ -1,5 +1,3 @@
|
||||||
# This script is hosted on <b>https://get.msvc.win/</b> for <b><a href="https://msvc.win/">MSVC Win Project</a></b><br />To get started, run <b>irm https://get.msvc.win/auditbreak | iex</b> inside of PowerShell<hr><pre>
|
|
||||||
|
|
||||||
# Define the embedded REG content
|
# Define the embedded REG content
|
||||||
$regContent = @"
|
$regContent = @"
|
||||||
Windows Registry Editor Version 5.00
|
Windows Registry Editor Version 5.00
|
||||||
|
|
@ -38,8 +36,8 @@ $tempRegPath = "$env:TEMP\AuditBreak.reg"
|
||||||
$regContent | Out-File -FilePath $tempRegPath -Encoding ASCII
|
$regContent | Out-File -FilePath $tempRegPath -Encoding ASCII
|
||||||
|
|
||||||
# Check Audit Mode
|
# Check Audit Mode
|
||||||
$auditKey = "HKLM\SYSTEM\Setup"
|
$auditKey = "HKLM\SYSTEM\Setup\Status"
|
||||||
$auditValue = "AuditInProgress"
|
$auditValue = "AuditBoot"
|
||||||
$auditStatus = Get-ItemProperty -Path $auditKey -Name $auditValue -ErrorAction SilentlyContinue
|
$auditStatus = Get-ItemProperty -Path $auditKey -Name $auditValue -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
if ($auditStatus.$auditValue -eq 1) {
|
if ($auditStatus.$auditValue -eq 1) {
|
||||||
|
|
@ -47,12 +45,12 @@ if ($auditStatus.$auditValue -eq 1) {
|
||||||
|
|
||||||
# Import the embedded REG file
|
# Import the embedded REG file
|
||||||
reg import $tempRegPath
|
reg import $tempRegPath
|
||||||
Write-Host "Registry settings applied."
|
Write-Host "Audit Mode is now disabled."
|
||||||
|
|
||||||
# Run your command
|
# Run your command
|
||||||
$command = "net.exe user Administrator /active:yes"
|
$command = "net.exe user Administrator /active:yes"
|
||||||
Start-Process -FilePath $command -Wait
|
Start-Process -FilePath $command -Wait
|
||||||
Write-Host "Command executed."
|
Write-Host "Administrator account is now enabled."
|
||||||
} else {
|
} else {
|
||||||
Write-Host "Audit Mode is not active."
|
Write-Host "Audit Mode is not active."
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue