Windows Management Instrumentation Lenovo BIOS : 2010 5 20
Windows Management Instrumentation Lenovo BIOS : 2010 5 20
3 1 2010.4 Copyright Lenovo 2008.
............... v 1............. 1 Windows Management Instrumentation.... 1............... 2................ 2................ 2............ 2........ 2 2............... 5 BIOS............. 5................ 6............. 6 BIOS......... 7 3........ 21 BIOS........ 21 BIOS........... 21........... 22......... 22... 22............... 23 4........ 25 A. BIOS Visual Basic.. 27......... 27 BIOS.............. 28 BIOS............... 28 BIOS..... 29 BIOS.............. 30 BIOS............... 30 BIOS..... 31.. 32.. 33 B. BIOS PowerShell... 35 BIOS...... 35 BIOS........ 36 BIOS.......... 37 C........... 39................. 40 Copyright Lenovo 2008 iii
iv Windows Management Instrumentation Lenovo BIOS
BIOS Windows Management Instrumentation (WMI) Lenovo BIOS IT ZIP BIOS Visual Basic IT Lenovo Web www.lenovo.com/support Copyright Lenovo 2008 v
vi Windows Management Instrumentation Lenovo BIOS
1 IT BIOS ( ) Lenovo BIOS WMI Lenovo Windows Management Instrumentation (WMI) BIOS IT Lenovo BIOS WMI BIOS Windows Management Instrumentation WMI Windows Lenovo BIOS WMI WMI BIOS Lenovo BIOS WMI WMI Windows Script Host (WSH) Windows Visual Basic Scripting Edition (VBScript) JavaScript Copyright Lenovo 2008 1
Lenovo BIOS WMI v v v v v v v BIOS ( BIOS BIOS ) BIOS ( (HDD) ) BIOS Managed Object Format (MOF) DOS BIOS v v v SMI WMI BIOS ThinkPad v R400 v R500 v T400 v T500 v W500 v W510 v W700 v W700ds v W701 v X200 v X200s v X200 Tablet v X301 v T400s v X201 v X201s 2 Windows Management Instrumentation Lenovo BIOS
v v v T410 T410s T510 1 3
4 Windows Management Instrumentation Lenovo BIOS
2 BIOS WMI BIOS 1. Lenovo BIOS v : " root WMI" v : "Lenovo_BIOSElement" v ( 1 ) / Lenovo_BiosSetting Query CurrentSetting: "Item,Value" "WakeOnLAN,Enable" Lenovo_SetBiosSetting Method "Item,Value,Password,Encoding, KbdLang;" Lenovo_SaveBios Settings Lenovo_DiscardBios Settings Lenovo_LoadDefault Settings Lenovo_SetBios Password "WakeOnLAN,Disable,pswd, ascii,us;" Method "Password,Encoding,KbdLang;" "pswd,ascii,us;" Method "Password,Encoding,KbdLang;" "pswd,ascii,us;" Method "Password,Encoding,KbdLang;" "pswd,ascii,us;" Method "PasswordType,CurrentPassword, NewPassword, Encoding,KbdLang;" "pop,oldpop,newpop,ascii,us; : 1. Visual Basic 27 A. BIOS Visual Basic 2. PowerShell 35 B. BIOS PowerShell 3. 7 4 Copyright Lenovo 2008 5
BIOS 2. Success Not Supported Invalid Parameter Access Denied System Busy BIOS BIOS "abc,ascii,us" 3 3. v abc - raw ascii character 1 v 1e302e - scancode v ascii 2 v scancode 3 ( "ascii" ) v v v "us" - ( ) ( ) ( ) ( ) ( ) "fr" - ( ) "gr" - 6 Windows Management Instrumentation Lenovo BIOS
BIOS 4. BIOS BIOS : 1. BIOS / 2. load default WakeOnLAN Enable Disable N R400 R500 T400 T500 W701 W700ds T400s WakeOnLAN "Enable" "Disable" "ACOnly" "ACandBattery" N X201 X201s T410 T410s T510 W510 FlashOverLAN Enable Disable N R400 R500 T400 T500 EthernetLANOptionROM Enable Disable N R400 R500 T400 T500 HarddriveDMA Enable Disable N R400 R500 T400 T500 WirelessLANAndWiMAXRadios Enable Disable Y R400 R500 T400 T500 SerialPort Enable Disable Y R400 R500 T400 T500 Tablet 2 7
4. BIOS ( ) SerialPortIO 3F8 2F8 3E8 2E8 Y R400 R500 T400 T500 Tablet SerialPortIRQ 3 4 5 7 Y R400 R500 T400 T500 Tablet ParallelPort Enable Disable Y R400 R500 T400 T500 Tablet ParallelPortMode "OutputOnly" "BiDirectional" "ECP" Y R400 R500 T400 T500 Tablet ParallelPortIO 378 278 3BC Y R400 R500 T400 T500 Tablet ParallelPortIRQ 5 7 Y R400 R500 T400 T500 Tablet ParallelPortDMA "0 1 3 Y R400 R500 T400 T500 Tablet PCIINTA PCIINTB PCIINTC Disable Auto Select 3 4 5 6 7 9 10 11 Disable Auto Select 3 4 5 6 7 9 10 11 Disable Auto Select 3 4 5 6 7 9 10 11 Y Y Y R400 R500 T400 T500 R400 R500 T400 T500 R400 R500 T400 T500 8 Windows Management Instrumentation Lenovo BIOS
4. BIOS ( ) PCIINTD PCIINTE PCIINTF PCIINTG PCIINTH Disable Auto Select 3 4 5 6 7 9 10 11 Disable Auto Select 3 4 5 6 7 9 10 11 Disable Auto Select 3 4 5 6 7 9 10 11 Disable Auto Select 3 4 5 6 7 9 10 11 Disable Auto Select 3 4 5 6 7 9 10 11 Y Y Y Y Y R400 R500 T400 T500 R400 R500 T400 T500 R400 R500 T400 T500 R400 R500 T400 T500 R400 R500 T400 T500 USBBIOSSupport Enable Disable Y R400 R500 T400 T500 AlwaysOnUSB Enable Disable Y R400 R500 T400 T500 AlwaysOnUSBMode "Blackberry" "ipodiphone" "OtherUSBDevices" Y T400s 2 9
4. BIOS ( ) AlwaysOnUSBMode "Blackberry" "ipodiphone" "OtherUSBDevices" "Automatic" Y X201 X201s T410 T410s T510 W510 TrackPoint Disable Automatic Y R400 R500 T400 T500 FnCtrlKeySwap "Disable" "Automatic" Y X201 X201s T410 T410s T510 W510 TouchPad Disable Automatic Y R400 R500 T400 T500 FnKeyLock Enable Disable Y R400 R500 T400 T500 ThinkPadNumLock Independent Synchronized Y R400 R500 T400 T500 PowerOnNumLock Auto On Off Y R400 R500 T400 T500 PrimaryVideo PCIExpress Internal Y R400 R500 T400 T500 Tablet W700 W701 W700ds BootDisplayDevice LCD VGA DisplayPort DVI Y R400 R500 T400 T500 W701 W700ds T400s 10 Windows Management Instrumentation Lenovo BIOS
4. BIOS ( ) BootDisplayDevice GraphicsDevice LCD VGA "Digital" "Digital1onDock" "Digital2onDock" "IntegratedGfx" "DiscreteGfx" "SwitchableGfx" Yq Y X201 X201s T410 T410s T510 W510 R400 R500 T400 T500 Tablet X201 X201s T410 OsDetectionForSwitchableGraphics Enable Disable Y R400 R500 T400 T500 Tablet X201 X201s T410 TimerWakeWithBattery Enable Disable Y R400 R500 T400 T500 SpeedStep Enable Disable Y R400 R500 T400 T500 SpeedStepModeAC SpeedStepModeBattery AdaptiveThermalManagementAC MaximumPerformance BatteryOptimized MaximumBattery Automatic MaximumPerformance BatteryOptimized MaximumBattery Automatic MaximizePerformance Balanced Y Y Y R400 R500 T400 T500 R400 R500 T400 T500 R400 R500 T400 T500 2 11
4. BIOS ( ) AdaptiveThermalManagementBattery CDRomSpeed MaximizePerformance Balanced High Normal Silent Y Y R400 R500 T400 T500 R400 R500 T400 T500 CPUPowerManagement Disable Automatic Y R400 R500 T400 T500 PCIPowerManagement Disable Automatic Y R400 R500 T400 T500 PCIExpressPowerManagement "Disable" "Automatic" Y R400 R500 T400 T500 PowerControlBeep Enable Disable Y R400 R500 T400 T500 LowBatteryAlarm Enable Disable Y R400 R500 T400 T500 12 Windows Management Instrumentation Lenovo BIOS
4. BIOS ( ) PasswordBeep Enable Disable Y R400 R500 T400 T500 KeyboardBeep Enable Disable Y R400 R500 T400 T500 ExtendedMemoryTest Enable Disable Y R400 R500 T400 T500 SATAControllerMode "Compatibility" "AHCI" Y R400 R500 T400 T500 Tablet X301 T400s SATAControllerMode "Compatibility" "AHCI" "RAID" Y W700 W700ds CoreMultiProcessing Enable Disable N R400 R500 T400 T500 HyperThreadingTechnology Enable Disable Y X201 X201s T410 T410s T510 W510 VirtualizationTechnology Enable Disable N R400 R500 T400 T500 VTdFeature Enable Disable N R400 R500 T400 T500 2 13
4. BIOS ( ) AMTControl Enable Disable N R400 R500 T400 T500 IDERForNormalBoot "Hidden" "NotHidden" N R400 R500 T400 T500 W701 W700ds T400s LegacyDevicesOnMiniDock Enable Disable N R400 R500 T400 T500 Tablet HardwarePasswordManager Enable Disable N R400 R500 T400 T500 Passphrase Enable Disable N R400 R500 T400 T500 LockBIOSSetting Enable Disable N R400 R500 T400 T500 MinimumPasswordLength Disable 4 5 6 7 8 9 10 11 12 N R400 R500 T400 T500 BIOSPasswordAtUnattendedBoot Enable Disable N R400 R500 T400 T500 14 Windows Management Instrumentation Lenovo BIOS
4. BIOS ( ) FingerprintPredesktopAuthentication Enable Disable N R400 R500 T400 T500 FingerprintReaderPriority External InternalOnly N R400 R500 T400 T500 FingerprintSecurityMode Normal High N R400 R500 T400 T500 FingerprintPasswordAuthentication Enable Disable N R400 R500 T400 T500 SecurityChip Active Inactive Disable N R400 R500 T400 T500 TXTFeature Enable Disable N R400 R500 T400 T500 BIOSUpdateByEndUsers Enable Disable N R400 R500 T400 T500 2 15
4. BIOS ( ) DataExecutionPrevention Enable Disable N R400 R500 T400 T500 EthernetLANAccess Enable Disable N R400 R500 T400 T500 WirelessLANAccess Enable Disable N R400 R500 T400 T500 WiMAXAccess Enable Disable N R400 R500 T400 T500 WirelessWANAccess Enable Disable N R400 R500 T400 T500 BluetoothAccess Enable Disable N R400 R500 T400 T500 WirelessUSBAccess Enable Disable N R400 R500 T400 T500 W701 W700ds T400s ModemAccess Enable Disable N R400 R500 T400 T500 Tablet W700 W701 W700ds X201 X201s T410 16 Windows Management Instrumentation Lenovo BIOS
4. BIOS ( ) USBPartAccess Enable Disable N R400 R500 T400 T500 IEEE1394Access Enable Disable N R400 R500 T400 T500 SerialPortAccess Enable Disable N R400 R500 T400 T500 Tablet ParallelPortAccess Enable Disable N R400 R500 T400 T500 Tablet CardBusSlotAccess Enable Disable N R400 R500 T400 T500 W701 W700ds T400s ExpressCardAccess Enable Disable N R400 R500 T400 T500 PCIExpressSlotAccess Enable Disable N X301 T400s X201 X201s T410 T410s T510 W510 UltrabayAccess Enable Disable N R400 R500 T400 T500 MemoryCardSlotAccess Enable Disable N R400 R500 T400 T500 2 17
4. BIOS ( ) SmartCardSlotAccess Enable Disable N R400 R500 T400 T500 IntegratedCameraAccess Enable Disable N R400 R500 T400 T500 MicrophoneAccess Enable Disable N R400 R500 T400 T500 FingerprintReaderAccess Enable Disable N R400 R500 T400 T500 esataportaccess "Enable" "Disable" N W700 W700ds T400s ComputraceModuleActivation Enable Disable N R400 R500 T400 T500 FullTheftProectionModeulActivation Enable Disable N R400 R500 T400 T500 Tablet X301 T400s RemoteDisableModuleAcitvation Enable Disable N R400 R500 T400 T500 Tablet X301 T400s ATpModuleActivation Enable Disable N R400 R500 T400 T500 Tablet X301 T400s 18 Windows Management Instrumentation Lenovo BIOS
4. BIOS ( ) BootMode Quick Diagnostics Y R400 R500 T400 T500 StartupOptionKeys Enable Disable Y R400 R500 T400 T500 BootDeviceListF12Option Enable Disable N R400 R500 T400 T500 BootOrder NetworkBootOrder HDD0" "HDD1" "HDD2" "PCILAN" "ATAPICD0" "ATAPICD1" "USBFDD" "USBCD" "USBHDD" "NODEV" HDD0" "HDD1" "HDD2" "PCILAN" "ATAPICD0" "ATAPICD1" "USBFDD" "USBCD" "USBHDD" "NODEV" Y Y R400 R500 T400 T500 R400 R500 T400 T500 2 19
20 Windows Management Instrumentation Lenovo BIOS
3 WMI BIOS v BIOS v BIOS v ( ) v BIOS BIOS WMI BIOS Lenovo_BiosSetting ( 28 BIOS 30 BIOS ) BIOS 7 4 BIOS BIOS 1. Lenovo_BiosSetting BIOS ( 28 BIOS 30 BIOS ) 2. : 7 4 3. Lenovo_SetBiosSetting BIOS Lenovo_SaveBiosSetting ( 28 BIOS 30 BIOS ) : BIOS / BIOS Copyright Lenovo 2008 21
1. Lenovo_BiosSetting BootOrder ( 28 BIOS 30 BIOS ) 2. Lenovo_SetBiosSetting Lenovo_SaveBiosSetting ( 28 BIOS 30 BIOS ) CD 0 0 2 ATAPICD0:HDD0 BIOS Lenovo_LoadDefaultSettings Lenovo_SaveBiosSettings BIOS ( ) "pop,abc,def,ascii,us" 5 ( 32 33 ) 5. 1 v pap": Supervisor v POP": Power-on v "uhdp1": User HDP 1 v "mhdp1": Master HDP 1 v "uhdp2": User HDP 2 v "mhdp2": Master HDP 2 v "uhdp3": User HDP 3 v "mhdp3": Master HDP 3 2 v abc - raw ascii character v 1e302e - scancode 22 Windows Management Instrumentation Lenovo BIOS
5. ( ) 3 v Raw ascii "def" v Scan code "201221" 4 v ascii v scancode 5 v "us" - ( ) ( ) ( ) ( ) ( ) v "fr" - ( ) v "gr" - BIOS WMI v (POP) (HDP) BIOS BIOS POP HDP 1 v 3 23
24 Windows Management Instrumentation Lenovo BIOS
4 WMI WMI 1. impersonate 2. pktprivacy WMI 27 A. BIOS Visual Basic Copyright Lenovo 2008 25
26 Windows Management Instrumentation Lenovo BIOS
A. BIOS Visual Basic ZIP Visual Basic BIOS ZIP Windows XP Windows Vista Windows 7 Lenovo BIOS cscript.exe Windows Vista Windows 7 : ZIP ZIP : cscript.exe LoadDefaults.vbs : cscript.exe LoadDefaults.vbs ' ' Load default BIOS settings ' On Error Resume Next Dim colitems strcomputer = "LOCALHOST" ' Change as needed. Set objwmiservice = GetObject("WinMgmts:" _ &"{ImpersonationLevel=Impersonate}! " & strcomputer & " root wmi") Set colitems = objwmiservice.execquery("select * from Lenovo_LoadDefaultSettings") strreturn = "error" For Each objitem in colitems ObjItem.LoadDefaultSettings ";", strreturn Next WScript.Echo " LoadDefaultSettings: " + strreturn If strreturn <> "Success" Then WScript.Quit End If Set colitems = objwmiservice.execquery("select * from Lenovo_SaveBiosSettings") strreturn = "error" For Each objitem in colitems ObjItem.SaveBiosSettings ";", strreturn Next WScript.Echo " SaveBiosSettings: " + strreturn Copyright Lenovo 2008 27
BIOS ZIP BIOS : cscript.exe ListAll.vbs : cscript.exe ListAll.vbs ' ' List all BIOS settings ' On Error Resume Next Dim colitems strcomputer = "LOCALHOST" ' Change as needed. Set objwmiservice = GetObject("WinMgmts:" _ &"{ImpersonationLevel=Impersonate}! " & strcomputer & " root wmi") Set colitems = objwmiservice.execquery("select * from Lenovo_BiosSetting") For Each objitem in colitems If Len(objItem.CurrentSetting) > 0 Then Setting = ObjItem.CurrentSetting StrItem = Left(ObjItem.CurrentSetting, InStr(ObjItem.CurrentSetting, ",") -1) StrValue = Mid(ObjItem.CurrentSetting, InStr(ObjItem.CurrentSetting, ",") + 1, 256) WScript.Echo StrItem +"="+StrValue End If Next BIOS ZIP BIOS : cscript.exe SetConfig.vbs [Item] [Value] : cscript.exe SetConfig.vbs WakeOnLAN Disable ' ' Set specific BIOS Setting ' On Error Resume Next Dim colitems If WScript.Arguments.Count <> 2 Then WScript.Echo "SetConfig.vbs [setting] [value]" WScript.Quit End If strrequest = WScript.Arguments(0) + "," + WScript.Arguments(1) + ";" strcomputer = "LOCALHOST" ' Change as needed. Set objwmiservice = GetObject("WinMgmts:" _ &"{ImpersonationLevel=Impersonate}! " & strcomputer & " root wmi") Set colitems = objwmiservice.execquery("select * from Lenovo_SetBiosSetting") For Each objitem in colitems ObjItem.SetBiosSetting strrequest, strreturn Next WScript.Echo strrequest WScript.Echo " SetBiosSetting: " + strreturn 28 Windows Management Instrumentation Lenovo BIOS
If strreturn <> "Success" Then WScript.Quit End If Set colitems = objwmiservice.execquery("select * from Lenovo_SaveBiosSettings") strreturn = "error" For Each objitem in colitems ObjItem.SaveBiosSettings ";", strreturn Next WScript.Echo strrequest WScript.Echo " SaveBiosSettings: " + strreturn BIOS ZIP BIOS : cscript.exe SetConfigPassword.vbs [Item] [Value] [Password + Encoding] : cscript.exe SetConfigPassword.vbs WakeOnLAN Disable pass,ascii,us ' ' Set specific BIOS Setting ' On Error Resume Next Dim colitems If WScript.Arguments.Count <> 3 Then WScript.Echo "SetConfigPassword.vbs [setting] [value] [password + encoding]" WScript.Quit End If strrequest = WScript.Arguments(0) + "," + WScript.Arguments(1) + "," + WScript.Arguments(2) + ";" strcomputer = "LOCALHOST" ' Change as needed. Set objwmiservice = GetObject("WinMgmts:" _ &"{ImpersonationLevel=Impersonate}! " & strcomputer & " root wmi") Set colitems = objwmiservice.execquery("select * from Lenovo_SetBiosSetting") For Each objitem in colitems ObjItem.SetBiosSetting strrequest, strreturn Next WScript.Echo strrequest WScript.Echo " SetBiosSetting: " + strreturn If strreturn <> "Success" Then WScript.Quit End If Set colitems = objwmiservice.execquery("select * from Lenovo_SaveBiosSettings") strreturn = "error" For Each objitem in colitems ObjItem.SaveBiosSettings WScript.Arguments(2) + ";", strreturn Next A. BIOS Visual Basic 29
WScript.Echo strrequest WScript.Echo " SaveBiosSettings: " + strreturn BIOS ZIP BIOS : cscript.exe ListAllRemote.vbs [Hostname] : cscript.exe ListAllRemote.vbs mattdev-c5 ' ' List all BIOS settings ' On Error Resume Next Dim colitems If WScript.Arguments.Count <> 1 Then WScript.Echo "ListAllRemote.vbs [hostname]" WScript.Quit End If strcomputer = WScript.Arguments(0) Set objwmiservice = GetObject("WinMgmts:" _ &"{ImpersonationLevel=Impersonate," _ &"authenticationlevel=pktprivacy}! " _ & strcomputer & " root wmi") Set colitems = objwmiservice.execquery("select * from Lenovo_BiosSetting") For Each objitem in colitems If Len(objItem.CurrentSetting) > 0 Then Setting = ObjItem.CurrentSetting StrItem = Left(ObjItem.CurrentSetting, InStr(ObjItem.CurrentSetting, ",") -1) StrValue = Mid(ObjItem.CurrentSetting, InStr(ObjItem.CurrentSetting, ",") + 1, 256) WScript.Echo StrItem +"="+StrValue End If Next BIOS ZIP BIOS : cscript.exe SetConfigRemote.vbs [Item] [Value] [Hostname] : cscript.exe SetConfigRemote.vbs WakeOnLAN Disable mattdev-c5 ' ' Set specific BIOS Setting ' On Error Resume Next Dim colitems If WScript.Arguments.Count <> 3 Then WScript.Echo "SetConfigRemote.vbs [setting] [value] [hostname]" WScript.Quit End If strrequest = WScript.Arguments(0) + "," + WScript.Arguments(1) + ";" 30 Windows Management Instrumentation Lenovo BIOS
strcomputer = WScript.Arguments(2) Set objwmiservice = GetObject("WinMgmts:" _ &"{ImpersonationLevel=Impersonate," _ &"authenticationlevel=pktprivacy}! " _ & strcomputer & " root wmi") Set colitems = objwmiservice.execquery("select * from Lenovo_SetBiosSetting") For Each objitem in colitems ObjItem.SetBiosSetting strrequest, strreturn Next WScript.Echo strrequest WScript.Echo " SetBiosSetting: " + strreturn If strreturn <> "Success" Then WScript.Quit End If Set colitems = objwmiservice.execquery("select * from Lenovo_SaveBiosSettings") strreturn = "error" For Each objitem in colitems ObjItem.SaveBiosSettings ";", strreturn Next WScript.Echo strrequest WScript.Echo " SaveBiosSettings: " + strreturn BIOS ZIP BIOS : cscript.exe SetConfigPasswordRemote.vbs [Item] [Value] [Password + Encoding] [Hostname] : cscript.exe SetConfigPasswordRemote.vbs WakeOnLAN Disable pass,ascii,us mattdev-c5 ' ' Set specific BIOS Setting ' On Error Resume Next Dim colitems If WScript.Arguments.Count <> 4 Then WScript.Echo "SetConfigPasswordRemote.vbs [setting] [value] [password + encoding] [hostname]" WScript.Quit End If strrequest = WScript.Arguments(0) + "," + WScript.Arguments(1) + "," + WScript.Arguments(2) + ";" strcomputer = WScript.Arguments(3) Set objwmiservice = GetObject("WinMgmts:" _ &"{ImpersonationLevel=Impersonate," _ &"authenticationlevel=pktprivacy}! " _ A. BIOS Visual Basic 31
& strcomputer & " root wmi") Set colitems = objwmiservice.execquery("select * from Lenovo_SetBiosSetting") For Each objitem in colitems ObjItem.SetBiosSetting strrequest, strreturn Next WScript.Echo strrequest WScript.Echo " SetBiosSetting: " + strreturn If strreturn <> "Success" Then WScript.Quit End If Set colitems = objwmiservice.execquery("select * from Lenovo_SaveBiosSettings") strreturn = "error" For Each objitem in colitems ObjItem.SaveBiosSettings WScript.Arguments(2) + ";", strreturn Next WScript.Echo strrequest WScript.Echo " SaveBiosSettings: " + strreturn ZIP : : cscript.exe SetSupervisorPassword.vbs [Old Password] [New Password] [encoding] : cscript.exe SetSupervisorPassword.vbs oldpass newpass ascii,us ' ' Update Admnistrator Password ' On Error Resume Next Dim colitems If WScript.Arguments.Count <> 3 Then WScript.Echo "SetSupervisorPassword.vbs [old Password] [new Password] [encoding]" WScript.Quit End If strrequest = "pap," + WScript.Arguments(0) + "," + WScript.Arguments(1) + "," + WScript.Arguments(2) + ";" strcomputer = "LOCALHOST" ' Change as needed. Set objwmiservice = GetObject("WinMgmts:" _ &"{ImpersonationLevel=Impersonate}! " & strcomputer & " root wmi") Set colitems = objwmiservice.execquery("select * from Lenovo_SetBiosPassword") strreturn = "error" For Each objitem in colitems ObjItem.SetBiosPassword strrequest, strreturn 32 Windows Management Instrumentation Lenovo BIOS
Next WScript.Echo " SetBiosPassword: "+ strreturn ZIP : : cscript.exe SetSupervisorPasswordRemote.vbs [Old Password] [New Password] [encoding] [Hostname] : cscript.exe SetSupervisorPasswordRemote.vbs oldpass newpass ascii,us mattdev-c5 ' ' Update Admnistrator Password ' On Error Resume Next Dim colitems If WScript.Arguments.Count <> 4 Then WScript.Echo "SetSupervisorPasswordRemote.vbs [old Password] [new Password] [encoding] [hostname]" WScript.Quit End If; strrequest = "pap," + WScript.Arguments(0) + "," + WScript.Arguments(1) + "," + WScript.Arguments(2) + "*" strcomputer = WScript.Arguments(3) Set objwmiservice = GetObject("WinMgmts:" _ &"{ImpersonationLevel=Impersonate," _ &"authenticationlevel=pktprivacy}! " _ & strcomputer & " root wmi") Set colitems = objwmiservice.execquery("select * from Lenovo_SetBiosPassword") strreturn = "error" For Each objitem in colitems ObjItem.SetBiosPassword strrequest, strreturn Next WScript.Echo " SetBiosPassword: "+ strreturn A. BIOS Visual Basic 33
34 Windows Management Instrumentation Lenovo BIOS
B. BIOS PowerShell PowerShell BIOS BIOS <Command> gwmi -class Lenovo_BiosSetting -namespace root wmi ForEach-Object {if ($_.CurrentSetting -ne "") {Write-Host $_.CurrentSetting.replace(","," = ")}} BIOS test-pc ID <Command> gwmi -class Lenovo_BiosSetting -namespace root wmi -ComputerName test-pc -credential (get-credential) ForEach-Object {if ($_.CurrentSetting -ne "") {Write-Host $_.CurrentSetting.replace(","," = ")}} <Sample output> PS C: > gwmi -class Lenovo_BiosSetting -namespace root wmi -ComputerName test-pc -credential (get-credential) ForEach-Object {if ($_.CurrentSetting -ne "") {Write-Host $_.CurrentSetting.replace(","," = ")}} cmdlet get-credential at command pipeline position 1 Supply values for the following parameters: Credential WakeOnLAN = Enable FlashOverLAN = Enable EthernetLANOptionROM = Enable HarddriveDMA = Enable WirelessLANandWiMAXRadios = On SerialPort = Disable SerialPortIO = 3F8 SerialPortIRQ = 4 ParallelPort = Enable ParallelPortMode = BiDirectional ParallelPortIO = 3BC ParallelPortIRQ = 7 ParallelPortDMA = 0 PCIINTA = 11 PCIINTB = 11 PCIINTC = 11 PCIINTD = 11 PCIINTE = 11 PCIINTF = 11 PCIINTG = 11 PCIINTH = 11 USBBIOSSupport = Enable AlwaysOnUSB = Disable TrackPoint = Automatic TouchPad = Automatic Copyright Lenovo 2008 35
FnKeyLock = Disable ThinkPadNumLock = Independent PowerOnNumLock = Auto SpeedStep = Enable SpeedStepModeAC = Automatic SpeedStepModeBattery = BatteryOptimized AdaptiveThermalManagementAC = MaximizePerformance AdaptiveThermalManagementBattery = Balanced CDROMSpeed = Normal CPUPowerManagement = Automatic PCIPowerManagement = Automatic PowerControlBeep = Enable LowBatteryAlarm = Enable PasswordBeep = Disable KeyboardBeep = Enable ExtendedMemoryTest = Disable SATAControllerMode = Compatibility CoreMultiProcessing = Enable VirtualizationTechnology = Disable LegacyDevicesOnMiniDock = Enable Passphrase = Enable LockBIOSSetting = Disable MinimumPasswordLength = Disable BIOSPasswordAtUnattendedBoot = Enable PasswordResetService = Enable FingerprintPredesktopAuthentication = Enable FingerprintReaderPriority = External FingerprintSecurityMode = Normal SecurityChip = Inactive BIOSUpdateByEndUsers = Enable DataExecutionPrevention = Enable EthernetLANAccess = Enable WirelessLANAccess = Enable WiMAXAccess = Enable WirelessWANAccess = Enable BluetoothAccess = Enable WirelessUSBAccess = Enable ModemAccess = Enable USBPortAccess = Enable IEEE1394Access = Enable SerialPortAccess = Enable ParallelPortAccess = Enable CardBusSlotAccess = Enable ExpressCardAccess = Enable PCIExpressSlotAccess = Enable PrimaryVideo = Internal BootDisplayDevice = LCD TimerWakeWithBattery = Disable UltrabayAccess = Enable MemoryCardSlotAccess = Enable SmartCardSlotAccess = Enable IntegratedCameraAccess = Enable MicrophoneAccess = Enable BootMode = Quick StartupOptionKeys = Enable BootDeviceListF12Option = Enable BootOrder = USBFDD:ATAPICD0:USBCD:HDD0:PCILAN:USBHDD:HDD NetworkBootOrder = PCILAN:USBFDD:ATAPICD0:USBCD:HDD0:USBHDD:HDD1 PS C: > BIOS ZIP "AlwaysOnUSB" 36 Windows Management Instrumentation Lenovo BIOS
<Command> gwmi -class Lenovo_BiosSetting -namespace root wmi Where-Object {$_.CurrentSetting.split(",",[StringSplitOptions]::RemoveEmptyEntries) -eq "AlwaysOnUSB"} Format-List CurrentSetting <Command> gwmi -class Lenovo_BiosSetting -namespace root wmi -ComputerName test-pc -credential (get-credential) Where-Object {$_.CurrentSetting.split(",",[StringSplitOptions] ::RemoveEmptyEntries) -eq "AlwaysOnUSB"} Format-List CurrentSetting <Sample output> PS C: > gwmi -class Lenovo_BiosSetting -namespace root wmi -ComputerName test-pc -credential (get-credential) Where-Object {$_.CurrentSetting.split(",", [StringSplitOptions]::RemoveEmptyEntries) -eq "AlwaysOnUSB"} Format-List CurrentSetting cmdlet get-credential at command pipeline position 1 Supply values for the following parameters: Credential CurrentSetting : AlwaysOnUSB,Disable BIOS "WakeOnLAN,Disable" : / "<item, <value>" <Command> (gwmi -class Lenovo_SetBiosSetting -namespace root wmi).setbiossetting ("WakeOnLAN,Disable") GENUS : 2 CLASS : PARAMETERS SUPERCLASS : DYNASTY : PARAMETERS RELPATH : PROPERTY_COUNT : 1 DERIVATION : {} SERVER : NAMESPACE : PATH : return : Success PS C: > (gwmi -class Lenovo_SaveBiosSettings -namespace root wmi). SaveBiosSettings MemberType : Method OverloadDefinitions : {System.Management.ManagementBaseObject SaveBiosSettings(System.String parameter)} TypeNameOfValue : System.Management.Automation.PSMethod Value : System.Management.ManagementBaseObject SaveBiosSettings(System.String parameter) Name : SaveBiosSettings IsInstance : True PS C: > B. BIOS PowerShell 37
38 Windows Management Instrumentation Lenovo BIOS
C. Lenovo Lenovo Lenovo Lenovo Lenovo ( ) Lenovo (United States), Inc 1009 Think Place Building One Morrisville, NC 27560 USA Attention: Lenovo Director of Licensing Lenovo Lenovo Lenovo Lenovo Lenovo Copyright Lenovo 2008 39
Lenovo Web Web Web Lenovo Web Lenovo Lenovo Lenovo ThinkPad ThinkVantage Microsoft Windows Windows Vista Windows 7 Active Directory Microsoft Corporation 40 Windows Management Instrumentation Lenovo BIOS
Printed in USA