Grab our RSS feeds Follow us on Twitter Join our Facebook Group Connect with us on LinkedIn
myITforum.com, Powered by You.
you are not logged in

Articles

Newslinks

Links

Downloads

Site Services

Community Forums

Discussion Lists

Article Search

Newsletter

Web Blogs

FAQs

Live Support

myITforum TV

Take a Poll

Monthly Drawing

myITforum Network

User Group Directory

Our Partners

About Us

Register

Login

BRONZE PARTNER:

BRONZE PARTNER:



Industry News:




  Home : Articles : Scripting print | email | | Forums |   print | email | | Blogs |   print | email | | Wiki |   print | email | | FAQs |   print | email | Article Search  
Managing Dell BIOS settings


Bookmark and Share

By: Dan Thomson
Posted On: 5/30/2003

Yet another topic that pops up in the forums is how to alter Dell BIOS settings via script from within Windows. I'm sorry to say that I cannot remember where it was posted, but I had come across a script written by Dell a while ago that was supposed to enable the WakeOnLan feature in the BIOS of a Dell system running Dell's Open Manage Client Instrumentation ( OMCI ). I finally had the chance to test it out recently to see if it really worked. At first it failed. But, after upgrading my OMCI to the latest version available for my system ( version 6.1.1.259 ), it worked like a charm. I started to get excited about the possibility to script various other items in the BIOS. This would greatly help me in my re-imaging processes because I could automate configuring the BIOS the way I need to for my environment. I could also rest assured that the BIOS changes were getting performed and not having to rely on my, or someones else's, memory to not forget to make the changes.

I decided to see if there were more scripts out there just waiting to be discovered. So I performed a couple www.google.com searches for some text that was in the original script ( 1: Dell and SampleWuOLEnable 2: Dellomci and script ). This search returned matches for a few items on Dell's support site relating to OMCI version 7. I soon found myself downloading more scripts for items such as: Setting the BIOS password, Gathering system summary information, Flashing a BIOS, and a few others.

Listed below are 3 scripts that perform the following BIOS changes: Setting an asset tag, Enabling WakeOnLan, and Setting the boot device order.

*****************************************************************************

Script 1: Setting an asset tag


This script is pretty straight forward. Run it as outlined in the header and it will add the specified asset tag information into the BIOS of the specified system.

Example command line:
        cscript //nologo DellSetAssetTag.vbs mytestsystem 99148
Begin Code
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' File: DellSetAssetTag.vbs
' Updated: May 2003
' Version: 1.0
' Author: Dan Thomson, myITforum.com columnist
' I can be contacted at dethomson@hotmail.com
'
' Purpose: To set the asset tag for a Dell OMCI client.
'
' Usage: cscript.exe DellSetAssetTag.vbs <systemname> <assettag>
'
' Input: systemname Name of system to modify
' assettag Asset tag to be assigned
'
' Requirements:
' - Dell Open Manage Client (see below for tested version)
' - Windows Script
' - WMI version 1.5
'
' Notes:
' Tests performed using:
' Windows 2000 Professional
' Windows Script v5.6
' Dell Open Manage Client version 6.1.1.259
' Optiplex GX240 & GX260 ( success )
' Inspiron 5000 ( N/A )
' Precision 530MT ( success )
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Option Explicit
On Error Resume Next

'*** Declare variables
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim colInstances
Dim objInstance
Dim strWQLQuery
Dim strKeyName
Dim strAssetTag

'*** Check that the right executable was used to run the script
'*** and that all parameters were passed
If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
(Wscript.Arguments.Count < 2) Then
Call Usage()
WScript.Quit(-1)
End If

'*** Initialize variables
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_SystemSummary"
strKeyName = "Name"
strAssetTag = WScript.Arguments(1)

'*** WQL Query to retrieve instances of Dell_SystemSummary
strWQLQuery = "SELECT * FROM " & strClassName & " WHERE " & _
strKeyName & "=" & Chr(34) & strComputerName & Chr(34)

'*** Retrieve instances of Dell_Configuration class (there should only be 1 instance).
Set colInstances = GetObject("WinMgmts:{impersonationLevel=impersonate}//" & _
strComputerName & "/" & strNameSpace).ExecQuery(strWQLQuery, "WQL", NULL)

'*** Use only first instance to set asset tag
For Each objInstance in colInstances
'*** Set the new value for the property and save the instance
objInstance.Properties_.Item("AssetTag").Value = strAssetTag
objInstance.Put_
Exit For
Next

Set colInstances = Nothing

'*** If any errors occurred, let the user know
If Err.Number <> 0 Then
WScript.Echo "Setting the BIOS Asset Tag failed."
End If

WScript.Quit(Err.Number)

'*** Sub used to display the correct usage of the script
Sub Usage()
Dim strMessage
strMessage = "incorrect syntax. You should run: " & vbCRLF & _
"cscript.exe //nologo DellSetAssetTag.vbs <systemname> <assettag>"
WScript.Echo strMessage
End Sub
End Code

*****************************************************************************

Script 2: Enabling WakeOnLan


Another pretty straight forward script. Run it as outlined in the header and it will enable the WakeOnLan feature in the BIOS of the specified system.

Example command line:
        cscript //nologo DellEnableWakeOnLan.vbs mytestsystem
Begin Code
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' File: DellEnableWakeOnLan.vbs
' Updated: May 2003
' Version: 1.0
' Author: Dell
' Modified by: Dan Thomson, myITforum.com columnist
' I can be contacted at dethomson@hotmail.com
'
' Purpose: To enable Wakeup On LAN on a Dell OMCI client.
'
' Usage: cscript.exe DellEnableWakeOnLan.vbs <systemname>
'
' Input: systemname Name of system to modify
'
' Requirements:
' - Dell Open Manage Client (see below for tested version)
' - Windows Script
' - WMI version 1.5
'
' Notes:
' Tests performed using:
' Windows 2000 Professional
' Windows Script v5.6
' Dell Open Manage Client version 6.1.1.259
' Optiplex GX240 & GX260 ( success )
' Inspiron 5000 ( N/A )
' Precision 530MT ( success )
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Option Explicit
On Error Resume Next

'*** Declare variables
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim strKeyValue
Dim objInstance
Dim strPropName
Dim strPropValue

'*** Check that the right executable was used to run the script
'*** and that all parameters were passed
If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
(Wscript.Arguments.Count < 1) Then
Call Usage()
WScript.Quit(-1)
End If

'*** Initialize variables
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_SMBIOSSettings"
strKeyValue = "0"
strPropName = "WakeupOnLan"

'*** Retrieve the instance of Dell_SMBIOSSettings class
Set objInstance = GetObject("WinMgmts:{impersonationLevel=impersonate}//" & _
strComputerName & "/" & strNameSpace & ":" & strClassName & "=" & _
Chr(34) & strKeyValue & Chr(34))

strPropValue = objInstance.Properties_.Item(strPropName).Value

'*** Set the value of WakeUpOnLan only if it is not already '6'
' A value of 6 = "Enable for all NICs"
If strPropValue <> 6 then

'*** Set the new value for the property and save the instance
objInstance.Properties_.Item(strPropName).Value = 6
objInstance.Put_

'*** If any errors occurred, let the user know
If Err.Number <> 0 Then
WScript.Echo "Enabling WakeUp On Lan failed."
End If
End If

Set objInstance = Nothing

WScript.Quit(Err.Number)

'*** Sub used to display the correct usage of the script
Sub Usage()
Dim strMessage
strMessage = "incorrect syntax. You should run: " & vbCRLF & _
"cscript.exe //nologo DellEnableWakeOnLan.vbs <systemname>"
WScript.Echo strMessage
End Sub
End Code

*****************************************************************************

Script 3: Resetting the boot device order


This script is pretty straight forward, but may need some manual editing to best meet your organizational needs. Run it as outlined in the header and it will alter the boot device order settings in the BIOS of the specified system. This script is currently hard coded to the following order:
  1. Hard Disk
  2. CD-Rom
  3. Floppy
There is a note in the code that illustrates how to change the boot order from what I specified.

Example command line:
        cscript //nologo DellSetBootOrder.vbs mytestsystem
Begin Code
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' File: DellSetBootOrder.vbs
' Updated: May 2003
' Version: 1.0
' Author: Dan Thomson, myITforum.com columnist
' I can be contacted at dethomson@hotmail.com
'
' Purpose: To set the boot order for a Dell OMCI client.
'
' Usage: cscript.exe DellSetBootOrder.vbs <systemname>
'
' Input: systemname Name of system to modify
'
' Requirements:
' - Dell Open Manage Client (see below for tested version)
' - Windows Script
' - WMI version 1.5
'
' Notes:
' Tests performed using:
' Windows 2000 Professional
' Windows Script v5.6
' Dell Open Manage Client version 6.1.1.259
' Optiplex GX240 & GX260 ( success )
' Inspiron 5000 ( failed )
' Precision 530MT ( success )
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Option Explicit
On Error Resume Next

'*** Declare variables
Dim strNameSpace
Dim strComputerName
Dim strClassName
Dim colInstances
Dim objInstance
Dim strWQLQuery
Dim strKeyName

'*** Check that the right executable was used to run the script
'*** and that all parameters were passed
If (LCase(Right(WScript.FullName, 11)) = "wscript.exe" ) Or _
(Wscript.Arguments.Count < 1) Then
Call Usage()
WScript.Quit(-1)
End If

'*** Initialize variables
strNameSpace = "root/Dellomci"
strComputerName = WScript.Arguments(0)
strClassName = "Dell_BootDeviceSequence"
strKeyName = "DellInstanceID"

'There are 3 instances of Dell_BootDevicesSequence...1 for each device
For i = 0 to 2
'*** WQL Query to retrieve instances of Dell_SystemSummary
strWQLQuery = "SELECT * FROM " & strClassName & " WHERE " & _
strKeyName & "=" & Chr(34) & i & Chr(34)

'*** Retrieve instances of Dell_Configuration class (there should only be 1 instance).
Set colInstances = GetObject("WinMgmts:{impersonationLevel=impersonate}//" & _
strComputerName & "/" & strNameSpace).ExecQuery(strWQLQuery, "WQL", NULL)

'*** Use only first instance to set boot order
For Each objInstance in colInstances
'*** Get the name of the boot device
strBootDeviceName = objInstance.Properties_.Item("BootDeviceName").Value

'Set appropriate boot order per attribute being managed
'I have hard coded these settings for my environment.
'Just change the integer values on the right to set the
'boot order to what you desire.
Select Case strBootDeviceName
Case "Hard-Disk Drive C:" : intOrder = 1
Case "IDE CD-ROM Device" : intOrder = 2
Case "Diskette Drive" : intOrder = 3
End Select

'*** Set the new value for the property
objInstance.Properties_.Item("BootOrder").Value = intOrder

'This setting allows me to enable or disable a boot device
'1 = enabled, 0 = disabled ( I'm leaving al mine enabled )
objInstance.Properties_.Item("Status").Value = 1
'Save the changes
objInstance.Put_

Exit For
Next
Set colInstances = Nothing
Next

'*** If any errors occurred, let the user know
If Err.Number <> 0 Then
WScript.Echo "Setting the system boot order failed."
End If

WScript.Quit(Err.Number)

'*** Sub used to display the correct usage of the script
Sub Usage()
Dim strMessage
strMessage = "incorrect syntax. You should run: " & vbCRLF & _
"cscript.exe //nologo DellSetBootOrder.vbs <systemname>"
WScript.Echo strMessage
End Sub
End Code

****************************************************************************************

Notes:If there are any suggestions or questions about this article, please post them in the Article Discussions Forum. Also, check out the General Scripting forums to find assistance with WMI and VB Scripting.

I can also be reached at dethomson@hotmail.com. But, if possible, please post any questions to one of the myITforum forums so that others can benefit from our discussions.

Happy scripting `:)

Dan

See my other articles.

P.S. I'll be working up a bunch more scripts soon. So let me know if there is something related to the Dell BIOS that you'd like to be able to script.

  myITforum.com ©2010 | Legal | Privacy