Lenovo ThinkPad T420 (English) BIOS Setup using Windows Management Instrumenta - Page 29

single, setting, remote, computer, supervisor, password, exists

Page 29 highlights

WScript.Echo "SetConfigRemote.vbs [setting] [value] [hostname]" WScript.Quit End If strRequest = WScript.Arguments(0) + "," + WScript.Arguments(1) + ";" 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 Set a single BIOS setting on a remote computer when a supervisor password exists Use the sample scripts in the ZIP file as templates to set a single BIOS setting on a remote computer when a supervisor password exists. Syntax: cscript.exe SetConfigPasswordRemote.vbs [Item] [Value] [Password + Encoding] [Hostname]Example: 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 Appendix A. Sample Visual Basic scripts for configuring BIOS settings 21

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40

:6FULSW³(FKR µ6HW&RQúJ5HPRWH³YEV
>VHWWLQJ@
>YDOXH@
>KRVWQDPH@µ
:6FULSW³4XLW
(QG
,I
VWU5HTXHVW
°
:6FULSW³$UJXPHQWV¶±¹
½ µ¼µ
½
:6FULSW³$UJXPHQWV¶À¹
½ µ»µ
VWU&RPSXWHU
°
:6FULSW³$UJXPHQWV¶Á¹
6HW
REM:0,6HUYLFH
°
*HW2EMHFW¶µ:LQ0JPWV²µ
B
·µ^,PSHUVRQDWLRQ/HYHO°,PSHUVRQDWH¼µ
B
·µDXWKHQWLFDWLRQ/HYHO°SNW3ULYDF\`¸??µ
B
·
VWU&RPSXWHU · µ?URRW?ZPLµ¹
6HW
FRO,WHPV
°
REM:0,6HUYLFH³([HF4XHU\¶µ6HOHFW
º
IURP
/HQRYRB6HW%LRV6HWWLQJµ¹
)RU
(DFK
REM,WHP
LQ
FRO,WHPV
2EM,WHP³6HW%LRV6HWWLQJ
VWU5HTXHVW¼
VWU5HWXUQ
1H[W
:6FULSW³(FKR
VWU5HTXHVW
:6FULSW³(FKR µ
6HW%LRV6HWWLQJ² µ
½
VWU5HWXUQ
,I
VWU5HWXUQ
¾! µ6XFFHVVµ
7KHQ
:6FULSW³4XLW
(QG
,I
6HW
FRO,WHPV
°
REM:0,6HUYLFH³([HF4XHU\¶µ6HOHFW
º
IURP
/HQRYRB6DYH%LRV6HWWLQJVµ¹
VWU5HWXUQ
° µHUURUµ
)RU
(DFK
REM,WHP
LQ
FRO,WHPV
2EM,WHP³6DYH%LRV6HWWLQJV µ»µ¼
VWU5HWXUQ
1H[W
:6FULSW³(FKR
VWU5HTXHVW
:6FULSW³(FKR µ
6DYH%LRV6HWWLQJV² µ
½
VWU5HWXUQ
Set
a
single
BIOS
setting
on
a
remote
computer
when
a
supervisor
password
exists
Use
the
sample
scripts
in
the
ZIP
±le
as
templates
to
set
a
single
BIOS
setting
on
a
remote
computer
when
a
supervisor
password
exists.
Syntax
:
FVFULSW³H[H
6HW&RQúJ3DVVZRUG5HPRWH³YEV
>,WHP@
>9DOXH@
>3DVVZRUG
½
(QFRGLQJ@
>+RVWQDPH@
Example
:
FVFULSW³H[H
6HW&RQúJ3DVVZRUG5HPRWH³YEV
:DNH2Q/$1
'LVDEOH
SDVV¼DVFLL¼XV
PDWWGHY¿FÂ
´
´
6HW
VSHFLúF
%,26
6HWWLQJ
´
2Q
(UURU
5HVXPH
1H[W
'LP
FRO,WHPV
,I
:6FULSW³$UJXPHQWV³&RXQW
¾!
Å
7KHQ
:6FULSW³(FKR µ6HW&RQúJ3DVVZRUG5HPRWH³YEV
>VHWWLQJ@
>YDOXH@
>SDVVZRUG
½
HQFRGLQJ@
>KRVWQDPH@µ
:6FULSW³4XLW
(QG
,I
Appendix
A.
Sample
Visual
Basic
scripts
for
con±guring
BIOS
settings
21