15 lines
726 B
PowerShell
15 lines
726 B
PowerShell
# Set a known password
|
|
$nopassword = $(Start-Process -FilePath "%ScriptRoot%\BiosConfig\Dell\cctk.exe" -ArgumentList "--setuppwd=CRHDF" -NoNewWindow -Wait -PassThru).ExitCode
|
|
If($nopassword -eq 115) {
|
|
$pw_array = @("dellintel","smbadmin","CRHDF2020","crhdf","Lvsr59100")
|
|
foreach($oldBIOSpassword in $pw_array) {
|
|
$trypassword = $(Start-Process -FilePath ".\cctk.exe" -ArgumentList "--valsetuppwd=$oldBIOSpassword --setuppwd=CRHDF" -NoNewWindow -Wait -PassThru).ExitCode
|
|
If ($trypassword -eq 0) {
|
|
Break
|
|
}
|
|
}
|
|
} elseif($nopassword -ne 0) {
|
|
## catch not 0 error code
|
|
Write-Host "BIOS is password protected with an unknown password. Cannot continue."
|
|
Exit $nopassword
|
|
} |