End If
Set colItems = objWMIService.ExecQuery("Select * from Lenovo_SaveBiosSettings")
strReturn = "error"
For Each objItem in colItems
Next
WScript.Echo strRequest
WScript.Echo " SaveBiosSettings: " + strReturn
Set a supervisor password on the local computer when a supervisor
password exists
Use the sample scripts in the ZIP file as templates to set a supervisor password on
the local computer when a supervisor password exists.
Note: You cannot set a supervisor password if one does not already exist.
Syntax: cscript.exe SetSupervisorPassword.vbs [Old Password] [New Password]
[encoding]
Example: cscript.exe SetSupervisorPassword.vbs oldpass newpass ascii,us
'
' Update Admnistrator Password
'
On Error Resume Next
Dim colItems
If WScript.Arguments.Count <> 3 Then
[encoding]" WScript.Quit
End If
strRequest = "pap," + WScript.Arguments(0) + "," + WScript.Arguments(1) + "," +
strComputer = "LOCALHOST"
Set objWMIService = GetObject("WinMgmts:" _
Set colItems = objWMIService.ExecQuery("Select * from Lenovo_SetBiosPassword")
strReturn = "error"
For Each objItem in colItems
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]
18
Lenovo BIOS Windows Management Instrumentation Interface Deployment Guide
WScript.Quit
ObjItem.SaveBiosSettings WScript.Arguments(2) + ";", strReturn
WScript.Echo "SetSupervisorPassword.vbs [old Password] [new Password]
WScript.Arguments(2) + ";"
&"{ImpersonationLevel=Impersonate}!\\" & strComputer & "\root\wmi")
ObjItem.SetBiosPassword strRequest, strReturn
' Change as needed.