User Tools

Site Tools


userspace:dellbios

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
userspace:dellbios [2015/09/14 11:47]
tobias [DellBios v2]
userspace:dellbios [2015/09/14 11:50]
tobias [Dell Bios Settings v2]
Line 524: Line 524:
  
  
-=====  
 Tree:\\ Tree:\\
 <code> <code>
Line 605: Line 604:
 │   │       └── pci.ids │   │       └── pci.ids
 │   ├── setup3264.opsiscript │   ├── setup3264.opsiscript
 +</code>
 +
 +=====  Script: Setup3264.opsiscript ===== 
 +
 +<code>
 +[ACTIONS]
 +SetLogLevel = 6
 +
 +DefVar $INST_SystemType$
 +DefVar $INST_architecture$
 +DefVar $ExitCode$
 +DefStringList $ErrorCodesList$
 +set $ErrorCodesList$ = loadTextFile ('%scriptpath%\cctkerrorcodes.txt')
 +DefStringList $ErrorCodeString$
 +DefVar $ErrorCode$
 +DefVar $ErrorCodeDescription$
 +
 +Set $INST_SystemType$ = GetSystemType
 +
 +DefVar $RebootWanted$
 +Set $RebootWanted$ = GetProductProperty("10_RebootWanted", "false")
 +
 +
 +
 +DefVar $SetHDDPassword$
 +Set $SetHDDPassword$ = GetProductProperty("1_Set_HDDPassword", "false")
 +Defvar $HDDPWDOptions$
 +
 +DefVar $HDDPassword$
 +Set $HDDPassword$ = GetProductProperty("1_HDD_Password", "XXXX")
 +
 +DefVar $currentHDDPassword$
 +Set $currentHDDPassword$ = GetProductProperty("1_current_HDD_Password", "XXXX")
 +
 +
 +
 +DefVar $SetBIOSPassword$
 +Set $SetBIOSPassword$ = GetProductProperty("2_Set_BIOSPassword", "true")
 +DefVar $BIOSPWDOptions$
 +
 +DefVar $BIOSPassword$
 +Set $BIOSPassword$ =  GetProductProperty("2_BIOS_Password", "XXXX")
 +
 +DefVar $CurrentBIOSPassword$
 +Set $CurrentBIOSPassword$ =  GetProductProperty("2_current_BIOS_Password", "XXXX")
 +
 +
 +
 +DefVar $SetWOL$
 +Set $SetWOL$ =   GetProductProperty("3_Set_WOL", "true")
 +
 +DefVar $WOL$
 +Set $WOL$ = GetProductProperty("3_WOL", "enable")
 +
 +DefVar $Change_HDDPassword$
 +
 +; ----------------------------------------------------------------
 +; - 64Bit                             -
 +; ----------------------------------------------------------------
 +if $INST_SystemType$ = "64 Bit System"
 +  if $SetHDDPassword$ = "True"
 +    if  NOT ($CurrentHDDPassword$ = " ")
 +      set $HDDPWDOptions$ = "--hddpwd=$HDDPassword$ --valhddpwd=$CurrentHDDPassword$"
 +    else
 +      set $HDDPWDOptions$  = "--hddpwd=$HDDPassword$"
 +    endif
 +      Winbatch_BIOS_Config_HDDPWD_x64
 +      set $exitcode$ = getLastExitcode
 +      for %s% in $ErrorCodesList$ do Sub_Check_Exitcode
 +      opsiServiceCall_report_new_HDD_password
 +
 +  endif
 +
 +  if $SetBIOSPassword$ = "True"
 +    if  NOT ($CurrentHDDPassword$ = " ")
 +    set $BIOSPWDOptions$ = "--setuppwd=$BIOSPassword$ --valsetuppwd=$CurrentBIOSPassword$"
 +    else
 +      set $BIOSPWDOptions$  = "--setuppwd=$BIOSPassword$"
 +    endif
 +    Winbatch_BIOS_Config_BIOSPWD_x64
 +    set $exitcode$ = getLastExitcode
 +    for %s% in $ErrorCodesList$ do Sub_Check_Exitcode
 +    opsiServiceCall_report_new_BIOS_password
 +
 +  endif
 +
 +  if $SetWOL$ = "True"
 +    Winbatch_BIOS_Config_WOL_x64
 +    set $exitcode$ = getLastExitcode
 +    for %s% in $ErrorCodesList$ do Sub_Check_Exitcode
 +
 +
 +  endif
 +endif
 +
 +
 +; ----------------------------------------------------------------
 +; - 32Bit                           -
 +; ----------------------------------------------------------------
 +if $INST_SystemType$ = "x86 System"
 +  if $SetHDDPassword$ = "True"
 +      Winbatch_BIOS_Config_HDDPWD_x64
 +      set $exitcode$ = getLastExitcode
 +      for %s% in $ErrorCodesList$ do Sub_Check_Exitcode
 +      opsiServiceCall_report_new_HDD_password
 +  endif
 +
 +
 +  if $SetBIOSPassword$ = "True"
 +    Winbatch_BIOS_Config_BIOSPWD_x64
 +    set $exitcode$ = getLastExitcode
 +    for %s% in $ErrorCodesList$ do Sub_Check_Exitcode
 +    opsiServiceCall_report_new_BIOS_password
 +  endif
 +
 +
 +  if $SetWOL$ = "True"
 +    Winbatch_BIOS_Config_WOL_x64
 +    set $exitcode$ = getLastExitcode
 +    for %s% in $ErrorCodesList$ do Sub_Check_Exitcode
 +  endif
 +endif
 +
 +
 +if $RebootWanted$ = "True"
 +  ExitWindows /Reboot
 +endif
 +
 +
 +[Winbatch_BIOS_Config_HDDPWD_x64]
 +%scriptpath%\files\x86_64\cctk.exe $HDDPWDOptions$
 +
 +[Winbatch_BIOS_Config_BIOSPWD_x64]
 +%scriptpath%\files\x86_64\cctk.exe $BIOSPWDOptions$
 +
 +[Winbatch_BIOS_Config_WOL_x64]
 +%scriptpath%\files\x86_64\cctk.exe --wakeonlan=$WOL$ --valsetuppwd=$CurrentBIOSPassword$
 +
 +
 +[opsiServiceCall_report_new_BIOS_password]
 +"method": "setProductProperty"
 +"params": [
 +"dfn_dellbiosconfig",
 +"2_current_BIOS_Password",
 +"$BIOSPassword$",
 +"%hostid%"
 +]
 +
 +
 +[opsiServiceCall_report_new_HDD_password]
 +"method": "setProductProperty"
 +"params": [
 +"dfn_dellbiosconfig",
 +"1_current_HDD_Password",
 +"$HDDPassword$",
 +"%hostid%"
 +]
 +
 +
 +[Sub_Check_Exitcode]
 +SetLogLevel = 5
 +if takeString(0, splitString ("%s%",  ".")) = $ExitCode$
 +  if not ($ExitCode$ = "0")
 +    LogError takeString(1, splitString ("%s%",  ".")) +" (ExitCode " +$ExitCode$+" )"
 +    isFatalError $ExitCode$
 +  else
 +    message "BIOS Command was Successful"
 +  EndIf
 +endif
 </code> </code>
  
userspace/dellbios.txt · Last modified: 2021/08/23 08:37 (external edit)