Skip to content

Instantly share code, notes, and snippets.

@jschlackman
Created March 31, 2022 20:40
Show Gist options
  • Save jschlackman/5b124aab21d70b73404b44ae7a4b7209 to your computer and use it in GitHub Desktop.
Save jschlackman/5b124aab21d70b73404b44ae7a4b7209 to your computer and use it in GitHub Desktop.
Function that uses the Dell Command Powershell Provider to set the initial admin password and prevent further BIOS changes from being made without the password being supplied.
# Name: Set-DellAdminPwd.ps1
# Author: James Schlackman
# Last Modified: March 31 2022
# Function that uses the Dell Command Powershell Provider to set the initial admin password and
# prevent further BIOS changes from being made without the password being supplied.
# https://www.dell.com/support/home/en-us/product-support/product/command-powershell-provider/docs
#Requires -Modules DellBIOSProvider
Import-Module DellBIOSProvider
function Set-DellAdminPwd {
param ([Parameter(Mandatory)] [String] $AdminPwd)
If ((Get-Item -Path DellSmbios:\Security\IsAdminPasswordSet).CurrentValue -eq 'False') {
Set-Item -Path DellSmbios:\Security\AdminSetupLockout Enabled
Set-Item -Path DellSmbios:\Security\AdminPassword "$AdminPwd"
}
Get-Item -Path DellSmbios:\Security\AdminSetupLockout | Select Attribute,CurrentValue
Get-Item -Path DellSmbios:\Security\IsAdminPasswordSet | Select Attribute,CurrentValue
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment