View and change BIOS settings on remote Dell computers using PowerShell

·

·

I have quite a few Dell machines on the domain that I want to start up automatically in the event of a power outage. Automatic switching on after a power failure can be activated by a small setting in the machine’s BIOS, but all the computers is on different rooms and locations so it would be a time-consuming job to change the settings on each machine individually.
Therefore I have been looking for a way to do this remotely, and I found a way to do it using PowerShell. I will explain in this post.

Preparations

  • Make sure your “master machine” (the server or computer you are going to run the commands from) and user account has access to the Dell computer’s C:\ drive over the network (\\hostname\c$\) and also administrative privileges locally on the remote machines.
  • Download the Dell Command PowerShell Provider from the link below and extract the DellBIOSProvider folder to a share or location that your “master machine” and user has access to.
    https://www.dell.com/support/home/drivers/DriversDetails?driverId=29CN5
  • Extract the DellBIOSProvider folder to a share or location that your “master machine” (the server or computer you are going to run the commands from) and user has access to.

PowerShell

Open a new session and do as follows:

Define variables

Change the value for $remote_computer, $module_source and $remote_bios_pwd according to your setup.

$remote_computer = "PC12345"
$module_source = "\\server\modules\DellCommand PowerShellProvider\DellBIOSProvider"
$module_destination = "\\$remote_computer\c$\Program Files\WindowsPowerShell\Modules\DellBIOSProvider"
$remote_bios_pwd = "password123"

Copy Module

Copy the module to the remote computer’s Module directory

Copy-Item -Path $module_source -Destination $module_destination -Recurse

Get BIOS settings

You can now use the Invoke-Command cmdlet to import the module on the remote machine and run commands. In the code below by using Get-Item on the DellSMBios provider made available by the module.
Notice that the module is imported and removed within each Invoke-Command ScriptBlock.

Invoke-Command -ComputerName $remote_computer -ScriptBlock {
    Import-Module -Name "DellBIOSProvider"
    Get-Item -Path DellSMBios:\* | Select-Object PSChildName,Description | Format-Table
    Remove-Module -Name "DellBIOSProvider" }

Will result in the following output:

PSChildName                   Description                                                                                                                                             
-----------                   -----------                                                                                                                                             
SystemInformation             Displays information that uniquely identifies the system.                                                                                               
MemoryInformation             Displays non-editable information about memory.                                                                                                         
ProcessorInformation          Displays non-editable information about processor(s).                                                                                                   
BatteryInformation            Displays each battery with the percent charged information.                                                                                             
BootSequence                  Displays the attributes to configure the system boot settings.                                                                                          
AdvancedBootOptions           Displays the attributes to configure advanced boot settings.                                                                                            
BIOSSetupAdvancedMode         Displays the attributes to configure various BIOS setup advanced mode settings.                                                                         
SystemConfiguration           Displays the attributes to configure devices that are integrated on the system board.                                                                   
StealthModeControl            Displays the attributes to configure stealth mode settings.                                                                                             
MiscellaneousDevices          Displays the attributes to configure various miscellaneous onboard devices.                                                                             
USBConfiguration              Displays the attributes to configure USB settings. NOTE: USB keyboard and mouse always work as defined in the BIOS setup, irrespective of these setting.
Video                         Displays the attributes to configure video settings.                                                                                                    
Security                      Displays the attributes to configure the security features of the system.                                                                               
TPMSecurity                   Displays the attributes to configure TPM device settings.                                                                                               
SecureBoot                    Displays the attributes to configure secure boot settings.                                                                                              
IntelSoftwareGuardExtensions  Displays the attributes to configure Intel Software Guard Extensions settings.                                                                          
Performance                   Displays the attributes to configure performance related settings.                                                                                      
PowerManagement               Displays the attributes to configure power management settings.                                                                                         
POSTBehavior                  Displays the attributes to configure system's behavior after POST.                                                                                      
Manageability                 Displays the attributes to configure various manageability settings.                                                                                    
VirtualizationSupport         Displays the attributes to configure virtualization settings.                                                                                           
Wireless                      Displays the attributes to configure wireless devices.                                                                                                  
Maintenance                   Displays the attributes to configure maintenance related settings.                                                                                      
SystemLogs                    Displays the attributes to configure system logs settings.                                                                                              
AdvancedConfigurations        Displays the attributes to configure various advanced settings.                                                                                         
SupportAssistSystemResolution Displays the attributes to configure various Support Assist settings.                                                                                   
ThermalConfiguration          Displays the attributes to configure various Thermal Configuration settings.                                                                            
Passwords                     Displays the attributes to configure various Passwords settings.                                                                                        
PreEnabled                    Displays the attributes to configure various Pre-enabled settings.

Browse deeper by adding a PSChildName (example PowerManagement) to the DellSMBios path:

Invoke-Command -ComputerName $remote_computer -ScriptBlock {
    Import-Module -Name "DellBIOSProvider"
    Get-Item -Path DellSMBios:\PowerManagement\* | Select-Object PSChildName,Description | Format-Table
    Remove-Module -Name "DellBIOSProvider" }

Will result in the following output:

PSChildName   Description                                                                                                                                                                                                                                                                                                                                                                                                                                                          
-----------   -----------                                                                                                                                                                                                                                                                                                                                                                                                                                                          
SpeedShift    Enables or disables the Intel Speed Shift Technology support. Setting this option to Enabled allows the operating system to select the appropriate processor performance automatically.                                                                                                                                                                                                                                                                              
AutoOn        Configures the days when the system has to turn on automatically at the time specified in AutoOnHour and AutoOnMinute. This function can turn on the system either every day, on weekdays, or on selected days. If AutoOnHour is set to '23', and AutoOnTime is set to '53', then setting AutoOntime to 'Weekdays' will turn on the system automatically on weekdays (Monday to Friday) at 11:53 p.m.. To turn on the system on particular days, set AutoOnTime as...
AutoOnHr      Configures the hour when the system has to turn on automatically. Value ranging from 0-23 can be provided. To set the time 11:59p.m., provide the value as 23.                                                                                                                                                                                                                                                                                                       
AutoOnMn      Configures the minute when the system has to turn on automatically. Value ranging from 0-59 can be provided. To set the time 11:59p.m., provide the value as 59.                                                                                                                                                                                                                                                                                                     
DeepSleepCtrl Controls when Deep Sleep is enabled.                                                                                                                                                                                                                                                                                                                                                                                                                                 
UsbWake       Enables USB device to wake the system from Standby. NOTE: This feature is functional only when the AC power adapter is connected.                                                                                                                                                                                                                                                                                                                                    
FanCtrlOvrd   Runs the system fan at full speed (100%) all of the time called Fan Control Override. Enabled - The fan always runs at full speed from boot to OS operation and can become quite noisy. Disabled - The fan returns to regular operation.                                                                                                                                                                                                                             
AcPwrRcvry    Controls the system's behavior when AC power is restored after AC power was lost. Off - System stays off after AC power is restored. On - System powers on after AC power is restored. Last - System returns to the previous state after AC power recovery.                                                                                                                                                                                                          
WakeOnLan     Enables the system to turn on from the off state when triggered by a special LAN signal, or from the hibernate state when triggered by a special wireless LAN signal. Disabled - Does not allow the system to power on by special LAN signals when it receives a wakeup signal from the LAN or wireless LAN. LanOnly - Allows the system to be powered on by special LAN signals. WlanOnly - Allows the system to be powered on by special WLAN signals. LanWlan -...
BlockSleep    Blocks the system entering to sleep (S3 state) mode in OS environment. When enabled, the system will not go to sleep mode, Intel Rapid Start will be disabled automatically and OS Power option will be blank if it was set to Sleep earlier.

Select a PSChildName (Example AcPwrRcvry) and see the available options

Invoke-Command -ComputerName $remote_computer -ScriptBlock {
    Import-Module -Name "DellBIOSProvider"
    Get-Item -Path DellSMBios:\PowerManagement\AcPwrRcvry
    Remove-Module -Name "DellBIOSProvider" }

Will result in the following output:

PSPath                    : DellBIOSProvider\DellSmbiosProv::DellSmbios:\PowerManagement\AcPwrRcvry
PSParentPath              : DellBIOSProvider\DellSmbiosProv::DellSmbios:\PowerManagement
PSChildName               : AcPwrRcvry
PSDrive                   : DellSmbios
PSProvider                : DellBIOSProvider\DellSmbiosProv
PSIsContainer             : False
PSComputerName            : PC12345
RunspaceId                : d6865620-0cc4-42fc-a3ec-533739f28a1e
Attribute                 : AcPwrRcvry
CurrentValue              : Off
ShortDescription          : AC Recovery
PossibleValues            : {Off, On, Last}
UnsupportedPossibleValues : {}
Description               : Controls the system's behavior when AC power is restored after AC power was lost. Off - System stays off after AC power is restored. On - System powers on after AC power is restored. Last - System returns to the previous state after AC power recovery.

In the output above there is some usefull info about AcPwrRcvry, the important ones are:

  • PSChildName is the name of option
  • PossibleValues is the possible values that can be set
  • CurrentValue is the value currently set
  • Description is details about what this option is.

Set BIOS settings

Now when you have found a setting to change, use the same path with Set-Item and parameters -Value <new value> -Password $Using:remote_bios_pwd (Also add -Verbose if you want an output confirmation, default is no output for successful command)

Tips: To pass variable values in to a ScriptBlock write $Using: before variable name ($Using:remote_bios_pwd).

Invoke-Command -ComputerName $remote_computer -ScriptBlock {
    Import-Module -Name "DellBIOSProvider"
    Set-Item -Path DellSMBios:\PowerManagement\AcPwrRcvry -Value On -Password $Using:remote_bios_pwd -Verbose
    Remove-Module -Name "DellBIOSProvider" }

Successful output with verbose parameter:

VERBOSE: Performing the operation Set-Item on target "Name: DellSmbios:\PowerManagement\AcPwrRcvry Value: On".
VERBOSE: Value being set using PLDM Interface
VERBOSE: Password type 'Admin' (Setup) is set.
VERBOSE: SUCCESS.

Remove Module

When done you can remove the module (optional)

Remove-Item -Path $module_destination -Recurse

Compatibility

I have tested this successfully with Windows Server 2019 as “master” and Windows 10 on the remote Dell computers.

Dell models tested:

  • Dell OptiPlex 7050 MFF
  • Dell OptiPlex 7000 MFF
  • Dell OptiPlex 7090 SFF
  • Dell Latitude 7310

Not all options are available on all systems.
Example: Latitude 7310 don’t have “AcPwrRcvry”, but it has “WakeOnDC”.

Scripting

I’m working on some scripts based on this technique for internal use, will possibly publish them on my GitHub at a later date 🙂 Stay tuned.

Sources

Share