General discussion

  • Creator
    Topic
  • #2266141

    Dell Express Service Code

    Locked

    by dan.cox ·

    Does anyone know how to read the Dell Express service code using VBScript?
    We are currently reading the service tag and model from the bios but would like to get the express service code.
    We don’t know the syntax to read that object.
    If anyone knows please let me know.

    This is what I have so far.
    ***********************************
    On Error Resume Next
    strComputer = “.”
    Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)
    Set colItems = objWMIService.ExecQuery(“Select * from Win32_BIOS”,,48)
    For Each objItem in colItems
    Wscript.Echo “BIOSVersion: ” & objItem.BIOSVersion
    Wscript.Echo “BuildNumber: ” & objItem.BuildNumber
    Wscript.Echo “Caption: ” & objItem.Caption
    Wscript.Echo “Description: ” & objItem.Description
    Wscript.Echo “Manufacturer: ” & objItem.Manufacturer
    Wscript.Echo “Name: ” & objItem.Name
    Wscript.Echo “SerialNumber: ” & objItem.SerialNumber
    Wscript.Echo “Version: ” & objItem.Version
    Next
    ******************************************

    Thanks.

All Comments

  • Author
    Replies
    • #2585756

      Figured it out

      by dan.cox ·

      In reply to Dell Express Service Code

      Thanks, I figured it out.
      If you have dell machines and need to get the Dell Express Service Code using a script you can use this.

      =============================================
      strComputer = “.”
      Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)
      Set colItems = objWMIService.ExecQuery(“Select * from Win32_BIOS”,,48)
      For Each objItem in colItems
      strSerial = objItem.SerialNumber
      Next

      Function Base2Base(InputNumber,InputBase,OutputBase)
      Dim J, K, DecimalValue, X, MaxBase, InputNumberLength
      Dim NumericBaseData, OutputValue
      NumericBaseData = “0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ”
      MaxBase = Len(NumericBaseData)
      if (InputBase > MaxBase) OR (OutputBase > MaxBase) then
      Base2Base = “N/A”
      Exit Function
      end if
      ‘Convert InputNumber to Base 10
      InputNumberLength = Len(InputNumber)
      DecimalValue = 0
      for J = 1 to InputNumberLength
      for K = 1 to InputBase
      if mid(InputNumber, J, 1) = mid(NumericBaseData, K, 1) then
      DecimalValue = DecimalValue+int((K-1)*(InputBase^(InputNumberLength-J))+.5)
      end if
      next
      next
      ‘Convert the Base 10 value (DecimalValue) to the desired output base
      OutputValue = “”
      while DecimalValue > 0
      X = int(((DecimalValue/OutputBase)-int(DecimalValue/OutputBase))*OutputBase+1.5)
      OutputValue = mid(NumericBaseData, X, 1)+OutputValue
      DecimalValue = int(DecimalValue/OutputBase)
      Wend
      Base2Base = OutputValue
      Exit Function
      End Function

      Wscript.Echo Base2Base(strSerial, 36, 10)
      ================================================

    • #2585755

      Figured it out

      by dan.cox ·

      In reply to Dell Express Service Code

      Thanks, I figured it out.
      If you have dell machines and need to get the Dell Express Service Code using a script you can use this.

      =============================================
      strComputer = “.”
      Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”)
      Set colItems = objWMIService.ExecQuery(“Select * from Win32_BIOS”,,48)
      For Each objItem in colItems
      strSerial = objItem.SerialNumber
      Next

      Function Base2Base(InputNumber,InputBase,OutputBase)
      Dim J, K, DecimalValue, X, MaxBase, InputNumberLength
      Dim NumericBaseData, OutputValue
      NumericBaseData = “0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ”
      MaxBase = Len(NumericBaseData)
      if (InputBase > MaxBase) OR (OutputBase > MaxBase) then
      Base2Base = “N/A”
      Exit Function
      end if
      ‘Convert InputNumber to Base 10
      InputNumberLength = Len(InputNumber)
      DecimalValue = 0
      for J = 1 to InputNumberLength
      for K = 1 to InputBase
      if mid(InputNumber, J, 1) = mid(NumericBaseData, K, 1) then
      DecimalValue = DecimalValue+int((K-1)*(InputBase^(InputNumberLength-J))+.5)
      end if
      next
      next
      ‘Convert the Base 10 value (DecimalValue) to the desired output base
      OutputValue = “”
      while DecimalValue > 0
      X = int(((DecimalValue/OutputBase)-int(DecimalValue/OutputBase))*OutputBase+1.5)
      OutputValue = mid(NumericBaseData, X, 1)+OutputValue
      DecimalValue = int(DecimalValue/OutputBase)
      Wend
      Base2Base = OutputValue
      Exit Function
      End Function

      Wscript.Echo Base2Base(strSerial, 36, 10)
      ================================================

      • #2514238

        Good or Evil?

        by joshland ·

        In reply to Figured it out

        I am impressed by what you accomplished, but this is also a significantly disturbing piece of work.

        Please see this page for the python equiv., including grabbing the info from the system:

        http://pacopablo.com/wiki/pacopablo/blog/2007/10/02/23.30

        He used your post when confirming the base-36 nature of the System Tag. Look at the pythonic means of conversion:

        str(int(service_tag,36))

        Things like this are why python rules.

      • #2817014

        More complicated than it has to be

        by paulcat ·

        In reply to Figured it out

        simply go to a DOS window and type WMIC /node bios get serialnumber

        This will query the bios of the remote computer and produce the asset tag.

    • #2570211

      Dell Express Service

      by esampa ·

      In reply to Dell Express Service Code

      Hi… You can do the following

      Set colItems = objWMIService.ExecQuery(“Select * from Win32_ComputerSystemProduct”,,48)
      For Each objItem in colItems
      strComputerSystem_IdentifyingNumber = objItem.IdentifyingNumber
      Next
      End If

      So now you got the TAG… let’s calc the express service

      Dim strTAG, ExpressCode, Index, count1, count2, count3, count4
      Dim strRevTAG, fator, strTArray(7), tmp

      Index = Array(0,1,2,3,4,5,6,7,8,9,”A”,”B”,”C”,”D”,”E”,”F”,”G”,”H”,”I”,”J”,”K”,”L”,”M”,”N”,”O”,”P”,”Q”,”R”,”S”,”T”,”U”,”V”,”W”,”X”,”Y”,”Z”)

      strTAG = InputBox(“Please, type your TAG”)
      strTAG = UCase(strTAG)
      strRevTAG = StrReverse(strTAG)

      count1 = Len(strTAG) ‘ Length of TAG
      count3 = (count1-1) ‘ Array Size

      ReDim fator(Len(strTAG))
      ReDim ExpressCode(Len(strTAG))
      For count2=0 To count3
      strTArray(count2) = CStr(Left(strRevTAG, 1))
      strRevTAG = Right(strRevTAG, Len(strRevTAG)-1)
      Next

      For count2=0 To count3
      If (count2=0) Then
      fator(count2) = 1
      Else
      fator(count2) = (36 ^ count2)
      End If
      For count4=0 To UBound(Index)
      If strTArray(count2) = CStr(Index(count4)) Then
      tmp1 = fator(count2)
      ExpressCode(count2) = tmp1 * count4
      End If
      Next
      Next
      tmp = 0
      For count2=0 To UBound(ExpressCode)
      tmp = tmp + ExpressCode(count2)
      Next
      Wscript.Echo “Your Express Service Code: ” & tmp

Viewing 2 reply threads