I have created a script to make BIOS changes to Dell PC's in my labs, which works well and sets Admin and lockout password at the end of the script. Although, I'm not thrilled about showing the BIOS password in the script and must delete the script after deployment.
Problem 2
However I do not know enough scripting to make the same changes (run same script) to Pc's that have the Admin and Lockout passwords already set. All Pc's have the same BIOS password.
I do not want to use this;
si -path DellSmbios:\PostBehavior\Fastboot "Auto" -password "Beer"
I found a few search results that allow me to successfully create an a secure and an encrypted password file, but I don't know how to include or provide the password to my "Set-item" in my script file.
Read-Host "Enter Admin Password" -AsSecureString | ConvertFrom-SecureString | Out-File "C:\Temp\Bios.txt" (It will ask you for the password so enter the password)
You now have an encrypted password in the Bios.txt file
If you want to use it you need to have the file on the system. For example C:\Temp\Bios.txt
I'm having an issue with this, when I run this command it sets the admin password as System.Security.SecureString and not what the secure string actually is.
In my code we have a password file and a key file. Were using the following code:
DJITS
4 Posts
2125
0
Posted January 15th, 2021 08:00
Mike,
I might be able to help you.
You need your password and then open powershell
First run:
Read-Host "Enter Admin Password" -AsSecureString | ConvertFrom-SecureString | Out-File "C:\Temp\Bios.txt" (It will ask you for the password so enter the password)
You now have an encrypted password in the Bios.txt file
If you want to use it you need to have the file on the system. For example C:\Temp\Bios.txt
Now run:
$pw = Get-Content "C:\Temp\Bios.txt" | ConvertTo-SecureString
You now have a variable that you can use in the Dell module. As example:
Set-Item -Path DellSMBIOS:\VirtualizationSupport\TrustExecution enabled -PasswordSecure $pw
Hope this helps you out
Regards,
DJITS