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

supervisor, password, remote, computer, exists

Page 31 highlights

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 Next WScript.Echo " SetBiosPassword: "+ strReturn Set a supervisor password on a remote computer when a supervisor password exists Use the sample scripts in the ZIP file as templates to set the supervisor password on a remote computer when a supervisor password exists. Note: You cannot set a supervisor password if one does not already exist. Syntax: cscript.exe SetSupervisorPasswordRemote.vbs [Old Password] [New Password] [encoding] [Hostname]Example: 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 Appendix A. Sample Visual Basic scripts for configuring BIOS settings 23

  • 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

VWU5HTXHVW
° µSDS¼µ
½
:6FULSW³$UJXPHQWV¶±¹
½ µ¼µ
½
:6FULSW³$UJXPHQWV¶À¹
½ µ¼µ
½
:6FULSW³$UJXPHQWV¶Á¹
½ µ»µ
VWU&RPSXWHU
° µ/2&$/+267µ
´
&KDQJH
DV
QHHGHG³
6HW
REM:0,6HUYLFH
°
*HW2EMHFW¶µ:LQ0JPWV²µ
B
·µ^,PSHUVRQDWLRQ/HYHO°,PSHUVRQDWH`¸??µ ·
VWU&RPSXWHU · µ?URRW?ZPLµ¹
6HW
FRO,WHPV
°
REM:0,6HUYLFH³([HF4XHU\¶µ6HOHFW
º
IURP
/HQRYRB6HW%LRV3DVVZRUGµ¹
VWU5HWXUQ
° µHUURUµ
)RU
(DFK
REM,WHP
LQ
FRO,WHPV
2EM,WHP³6HW%LRV3DVVZRUG
VWU5HTXHVW¼
VWU5HWXUQ
1H[W
:6FULSW³(FKR µ
6HW%LRV3DVVZRUG² µ½
VWU5HWXUQ
Set
a
supervisor
password
on
a
remote
computer
when
a
supervisor
password
exists
Use
the
sample
scripts
in
the
ZIP
±le
as
templates
to
set
the
supervisor
password
on
a
remote
computer
when
a
supervisor
password
exists.
Note:
You
cannot
set
a
supervisor
password
if
one
does
not
already
exist.
Syntax
:
FVFULSW³H[H
6HW6XSHUYLVRU3DVVZRUG5HPRWH³YEV
>2OG
3DVVZRUG@
>1HZ
3DVVZRUG@
>HQFRGLQJ@
>+RVWQDPH@
Example
:
FVFULSW³H[H
6HW6XSHUYLVRU3DVVZRUG5HPRWH³YEV
ROGSDVV
QHZSDVV
DVFLL¼XV
PDWWGHY¿FÂ
´
´
8SGDWH
$GPQLVWUDWRU
3DVVZRUG
´
2Q
(UURU
5HVXPH
1H[W
'LP
FRO,WHPV
,I
:6FULSW³$UJXPHQWV³&RXQW
¾!
Å
7KHQ
:6FULSW³(FKR µ6HW6XSHUYLVRU3DVVZRUG5HPRWH³YEV
>ROG
3DVVZRUG@
>QHZ
3DVVZRUG@
>HQFRGLQJ@
>KRVWQDPH@µ
:6FULSW³4XLW
(QG
,I»
VWU5HTXHVW
° µSDS¼µ
½
:6FULSW³$UJXPHQWV¶±¹
½ µ¼µ
½
: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%LRV3DVVZRUGµ¹
VWU5HWXUQ
° µHUURUµ
)RU
(DFK
REM,WHP
LQ
FRO,WHPV
2EM,WHP³6HW%LRV3DVVZRUG
VWU5HTXHVW¼
VWU5HWXUQ
1H[W
:6FULSW³(FKR µ
6HW%LRV3DVVZRUG² µ½
VWU5HWXUQ
Appendix
A.
Sample
Visual
Basic
scripts
for
con±guring
BIOS
settings
23