Page 1 of 1

BIOS Update - Variables

Published: November 22, 2022 - 03:42
by lfkl
Hello,

I'm trying to deploy a BIOS update package on desktops and laptops.

I have two problems:
1) How can I include a variable in the package that takes into account the compatible machine model(s) (given that our fleet is relatively homogeneous)?
For example, the BIOS-1 package runs on our DELL Optiplex 3050 and 3070 laptops, and BIOS-2 on the DELL Latitude laptops.

2) Regarding laptops, is it possible to include an additional condition that considers whether the battery level is above XX%?

It's not so simple…
Thank you for your insights and examples (I'm not very proficient in Python).

Have a good day.

Re: BIOS Update - Variables

Published: November 22, 2022 - 09:52
by florentR2
If it's for a Dell, it's best to use Dell Command Update, which will automatically select the correct drivers and BIOS for the model.
Regarding the battery level, it normally won't do anything if the machine isn't plugged in (at least not on Dell and HP machines).

Re: BIOS Update - Variables

Published: November 22, 2022 - 2:18 PM
by olaplanche
Good morning,

Personally, I created one package per model. Otherwise, to answer your question:

1) It is possible to retrieve the machine model directly from the package using the following code, for example:

Code: Select all

wmi_data = wmi_info(keys=['Win32_ComputerSystem'])['Win32_ComputerSystem']

print(wmi_data['Model'])
2) For the battery, you need to use the battery_percent function:

Code: Select all

battery = battery_percent()

print(battery)
Sincerely,

Re: BIOS Update - Variables

Published: November 23, 2022 - 1:48 AM
by lfkl
Thanks to both of you for your replies.
@florent2: Yes, that's pretty much what I thought, namely that the battery level is already checked in the Dell installer.
Actually, I should test it with a laptop connected via Wi-Fi to be sure.

@olaplanche
Thanks for the codes, they'll help.

Have a good day.