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

Windows for business | Windows Client for IT Pros | Devices and deployment | Set up, install, or upgrade
Windows for business | Windows Server | User experience | PowerShell
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Rich Matheisen 47,906 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.