Dell BIOS Settings Management – PSModule

This post was updated on September 11th, 2020.

Update: Dell does now provide native WMI classes to manage BIOS settings on newer models. For more information, see this post: Dell BIOS Settings Management – WMI. For information on using the Dell PowerShell module to configure settings on older models, continue reading this post.

This post is one of 3 posts in my series on managing BIOS settings using PowerShell. I’ve also written about HP and Lenovo. In this post I’ll be talking about using PowerShell to manage Dell BIOS settings.

The script can be downloaded from my GitHub: https://github.com/ConfigJon/Firmware-Management/blob/master/Dell/Manage-DellBiosSettings-PSModule.ps1

Dell and PowerShell

Unlike HP and Lenovo, Dell does not provide command line access to their BIOS settings by default. Instead, Dell provides a PowerShell module called Dell Command | PowerShell Provider. This PowerShell module allows Dell BIOS passwords and settings to be directly viewed and modified from a PowerShell prompt or script. This PowerShell module needs to be installed before running the Dell password management script. For more information, see my recent blog post, Working with the Dell Command | PowerShell Provider.

Once the Dell PowerShell Provider module has been installed, open an administrative PowerShell prompt and import the module.

Import-Module DellBIOSProvider

The DellBIOSProvider module creates a new PSDrive called DellSmbios. Settings can be queried or modified by using the Get-Item and Set-Item cmdlets on objects in the DellSmbios:\ location.

#Get the current value of a single BIOS setting
Get-Item -Path DellSmbios:\Category\Setting | Select-Object -ExpandProperty CurrentValue

#Get the current value and possible values of all BIOS settings
$DellSmbios = Get-ChildItem -Path DellSmbios:\
$Categories = $DellSmbios.Category
$SettingList = @()
foreach($Category in $Categories){
    $SettingList += Get-ChildItem -Path "DellSmbios:\$($Category)" | Select-Object Attribute,CurrentValue,PossibleValues
}
Write-Output $SettingList

#Set the value of a single BIOS setting
Set-Item -Path DellSmbios:\Category\Setting -Value Enabled

The DellBIOSProvider module also allows for working with systems that have a BIOS password set. In this case, the password parameter needs to be used when setting a new value.

#Set the value of a single BIOS setting when a BIOS password is set
Set-Item -Path DellSmbios:\Category\Setting -Value Enabled -Password ExamplePassword

For more information on using the Dell PowerShell Provider, refer to the official documentation: Reference Guide, User Guide

Manage-DellBiosSettings.ps1

This script takes the basic commands and adds logic to allow for a more automated settings management process. The script has four parameters.

  • GetSettings – Use this parameter to instruct the script to generate a list of all current BIOS settings. The settings will be displayed to the screen by default.
  • SetSettings – Use this parameter to instruct the script to set specific BIOS settings. Settings can be specified either in the body of the script or from a CSV file.
  • CsvPath – Use this parameter to specify the location of a CSV file. If used with the GetSettings switch, this acts as the location where a list of current BIOS settings will be saved. If used with the SetSettings switch, this acts as the location where the script will read BIOS settings to be set from. Using this switch with the SetSettings switch will also cause the script to ignore any settings specified in the body of the script.
  • AdminPassword – Used to specify the BIOS password

When using the script to set settings, the list of settings can either be specified in the script itself or in a CSV file. To specify settings in the script, look for the $Settings array near the top of the script. The settings should be in the format of “Setting Name,Setting Value”

#List of settings to be configured =================================
#===================================================================
$Settings = (
    "FingerprintReader,Enabled",
    "FnLock,Enabled",
    "IntegratedAudio,Enabled",
    "NumLock,Enabled",
    "SecureBoot,Enabled",
    "TpmActivation,Enabled",
    "TpmClear,Disabled",
    "TpmPpiClearOverride,Disabled",
    "TpmPpiDpo,Disabled",
    "TpmPpiPo,Enabled",
    "TpmSecurity,Enabled",
    "UefiNwStack,Enabled",
    "Virtualization,Enabled",
    "VtForDirectIo,Enabled",
    "WakeOnLan,Disabled"
)
#===================================================================
#===================================================================

A full list of configurable settings can be exported from a device by calling the script with the GetSettings parameter. The CsvPath parameter can also be specified to output the list of settings to a CSV file.

You can then sort through the exported settings and either save them as a CSV file or add them to the $Settings array in the body of the script.

When the script runs, it will write to a log file. By default, this log file will be named Manage-DellBiosSettings-PSModule.Log. If the script is being run during a task sequence, the log file will be located in the _SMSTSLogPath. Otherwise, the log file will be located in ProgramData\ConfigJonScripts\Dell. The log file name and path can be changed using the LogFile parameter. Note that the log file path will always be set to _SMSTSLogPath when run during a task sequence.

The script has logic built-in to detect if settings were already set correctly, were successfully set, failed to set, or were not found on the device. The script will output these counts to the screen at the end. More detailed information about the settings will be written to the log file.

I have included a few example settings files in my GitHub. These settings files contain commonly configured Dell BIOS settings.

  • Settings_CSV_SecureBoot.csv – Contains settings for enabling UEFI and SecureBoot
  • Settings_CSV_TPM.csv – Contains settings for enabling and activating TPM
  • Settings_CSV_General.csv – Contains other common settings
  • Settings_In-Script_All.txt – Contains common settings formatted for use in the body of the script

Examples

The script can be run as a standalone script in Windows, or as part of a Configuration Manager task sequence. It can also be run in the full Windows OS or in WinPE.

Here are a few examples of calling the script from a PowerShell prompt.

#Set BIOS settings supplied in the script
Manage-DellBiosSettings-PSModule.ps1 -SetSettings -AdminPassword ExamplePassword

#Set BIOS settings supplied in a CSV file
Manage-DellBiosSettings-PSModule.ps1 -SetSettings -CsvPath C:\Temp\Settings.csv -AdminPassword ExamplePassword

#Output a list of current BIOS settings to the screen
Manage-DellBiosSettings-PSModule.ps1 -GetSettings

#Output a list of current BIOS settings to a CSV file
Manage-DellBiosSettings-PSModule.ps1 -GetSettings -CsvPath C:\Temp\Settings.csv

Here is an example of calling the script during a task sequence. In this example the settings are specified in the body of the script, so the script can be stored directly in the task sequence step. Also the admin password is set, so the AdminPassword parameter is specified.

In this second example, the script is being called from a package and the settings are being supplied from a CSV file.

Additional Reading

If you’re looking for other options for managing Dell BIOS settings, check out the Dell Command Configure utility. For information on configuring Dell BIOS passwords using PowerShell, see my post Dell BIOS Password Management.