Overview

This post provides a PowerShell script that creates an SCCM package to remove the HDD password from the BIOS, ensuring drive accessibility for authorized users. This script is essential for scenarios where access to the drive is necessary for maintenance or updates.

Instructions

  1. Copy the provided PowerShell script to a location on your SCCM server.
  2. Adjust the script variables such as $SCCMServer, $SiteCode, and $PackageSourcePath to fit your environment.
  3. Run the script in PowerShell to create the SCCM package for BIOS HDD unlock.
  4. Distribute the package to the appropriate distribution points within SCCM.
  5. Monitor the deployment to ensure that the HDD password is removed on all targeted systems.

What the Script Does

This PowerShell script automates the creation of an SCCM package that removes the HDD password from the BIOS. This ensures that the drive remains accessible for authorized users, facilitating maintenance and updates.

PowerShell Script

# Define Variables
$SCCMServer = "\\YourSCCMServer"
$SiteCode = "YourSiteCode"
$ScriptName = "BIOS-HDD-Unlock"
$ScriptDescription = "Removes the HDD password from the BIOS, ensuring drive accessibility for authorized users."
$PackageSourcePath = "C:\Scripts\$ScriptName"

# Load SCCM PowerShell Module
Import-Module "$($Env:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" -Force

# Connect to the SCCM Site
cd "$SiteCode`:"

# Check if a package with the same name exists and delete it
$ExistingPackages = Get-CMPackage -Name $ScriptName -ErrorAction SilentlyContinue

if ($ExistingPackages) {
    foreach ($Package in $ExistingPackages) {
        Remove-CMPackage -Id $Package.PackageID -Force
    }
}

# Create the Package Source Directory if it does not exist
if (!(Test-Path -Path $PackageSourcePath)) {
    New-Item -ItemType Directory -Path $PackageSourcePath -Force
}

# Create the PowerShell script
$ScriptContent = @'
# Removes the HDD password from the BIOS
Install-PackageProvider -Name "Nuget" -RequiredVersion "2.8.5.208" -Force
Install-Module -Name DellBIOSProvider -force
Import-Module DellBIOSProvider
Set-Item -Path DellSmbios:\Security\HDDPassword "" -Password H@rv3y?
'@

$ScriptPath = "$PackageSourcePath\BIOS-HDD-Unlock.ps1"
Set-Content -Path $ScriptPath -Value $ScriptContent

# Create the SCCM Package
$Package = New-CMPackage `
    -Name $ScriptName `
    -Description $ScriptDescription `
    -Path $PackageSourcePath

# Create a Program for the Package
$Program = New-CMProgram `
    -PackageName $ScriptName `
    -StandardProgramName $ScriptName `
    -CommandLine "powershell.exe -ExecutionPolicy Bypass -File BIOS-HDD-Unlock.ps1" `
    -ProgramRunType "WhetherOrNotUserIsLoggedOn"

# Distribute the Package to the Distribution Point but do not deploy
Start-CMContentDistribution `
    -PackageName $ScriptName `
    -DistributionPointName "YourDistributionPointName"

Explanation

This script removes the HDD password from the BIOS, ensuring that the drive is accessible for authorized users. It is packaged and distributed via SCCM to ensure consistent application across all targeted systems.

Tags:

#BIOS #HDDUnlock #PowerShell #SCCM