How to clear known BIOS password (Dell)

lupinlicious 136 Reputation points
2023-09-21T16:21:50.6966667+00:00

Hello,

I'm trying to put something together, so I can with ease change BIOS password.

The script is supposed to check the BIOS current password and then change it to a new password

Function Clear-DellAdminPassword {


    BEGIN {
        # Define the path to cctk.exe
        $cctkPath = "X:\bios\dell\cctk.exe"
        
        # Array of known passwords
        $KnownPasswords = @("password1", "password2", "password3")  # Replace these with your actual passwords
    }

    PROCESS {
        foreach ($pwd in $KnownPasswords) {
            # Command to reset BIOS admin password using cctk.exe
            $command = "$cctkPath --setuppwd=$pwd --valsetuppwd=$pwd"

            # Execute the command and capture the result
            $result = Invoke-Expression $command

            # Check the result (modify this check based on the actual output of cctk.exe when successful)
            if ($result -like "*success*") {
                Write-Output "Password cleared successfully using $pwd."
                return
            } 
        }
        Write-Warning "Failed to clear the password using known passwords."
    }

    END
}

Found some inspiration here:
https://www.powershellgallery.com/packages/DellBIOSProvider/2.7.0/Content/Clear-DellAdminPassword.ps1

I tried the script first without integrating the cctk, and ran it cause in the task sequence without any errors. Same thing with cctk, no compliments and it didn't clear the password.

cctk.exe --syspwd=newpassword --valsyspwd=oldpassword

Microsoft Deployment Toolkit
Microsoft Deployment Toolkit
A collection of Microsoft tools and documentation for automating desktop and server deployment. Previously known as Microsoft Solution Accelerator for Business Desktop Deployment (BDD).
886 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,456 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 46,551 Reputation points
    2023-09-21T17:59:07.1033333+00:00

    You've installed Dells' DellBIOSProvider module? Which version? Version 2.7.0 is the current version.

    You'd use the Clear-DellAdminPassword first, then the Write-DellAdminPassword to set the new password.

    https://www.powershellgallery.com/packages/DellBIOSProvider/2.7.0

    The documentation for that module:

    https://dl.dell.com/content/manual37680244-dell-command-powershell-provider-version-2-7-user-s-guide.pdf?language=en-us

    Why write your own function (which mostly looks like Dells' code).


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.