Announcement

Collapse
No announcement yet.

Custom tool SMS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Custom tool SMS

    I am trying to figure out how I would be able to obtain the serial number of a machine on the network by using Hyena and an SMS snap-in called explore.msc. The command that I am trying to use at this point is

    cmd /x /c net use \\%P1:Machine ID%\ipc$ /user:administrator * & C:\SMSADMIN\bin\i386\explore.msc -s -h \\%P1:Machine ID%

    But am unable to gain a connection to the machine with the explore.msc snap-in. Everything else works, just getting a connection failed message with tieing in the machine id and explore.msc.

    Any ideas?

  • #2
    Re: Custom tool SMS

    Obviously authentication is not happening with the IPC connection. Connecting through the IPC is tricky at best, and depending on the application, you may not get the results due to the account under which you attempt to execute.

    Anyway, if you want the serial number, and this may not be what you want, plus it is hit or miss, as not all hardware manufacturers seem to play in the same sandbox ;-) , try this:

    Create a file named BIOSSN.VBS
    Insert the following:
    ============================================
    Option Explicit

    Dim WshShell, objArgs, objTargetComp 'as String
    Dim BiosSet, System, Bios_serial, strResponseText

    Set WshShell = WScript.CreateObject("WScript.Shell")

    Set objArgs = WScript.Arguments ' create object with collection

    objTargetComp = objArgs(0) 'assign the passed computer name to a variable

    Set BiosSet = GetObject("Winmgmts://" & objTargetComp).InstancesOf ("Win32_BIOS")
    for each System In BiosSet
    Bios_serial = System.SerialNumber
    Next

    strResponseText = "BIOS SN: " & Bios_serial


    WshShell.Popup strResponseText, 0,"Serial Number (from BIOS)"
    ============================================

    Next, create a tool in Hyena, with the command line of:
    ===================================
    cscript.exe //Nologo BIOSSN.VBS %E%
    ===================================

    WMI is required on the remote machine, but 2K/XP and on up have it installed by default. VBScript is required on the local machine to run the cscript.exe. And like I said, it's hit and miss. In my tests, 95% of the time it matched the label on the box.

    Hope this helps.

    (modified to say 2K/XP)

    [This message has been edited by The Supply Guy (edited 05-19-2003).]

    Comment


    • #3
      Re: Custom tool SMS

      This works ok if I have the vbs residing on my machine. How can I utilize this like the rest of my tools off the network share where your other scripts sit?

      [This message has been edited by Trammel (edited 04-04-2003).]

      Comment


      • #4
        Re: Custom tool SMS

        I figured it out, this works!
        wscript.exe "\\vo-phx-fs05\Scripts\HyenaTools\Utilities\BIOSSN.vbs" //NoLogo %E%

        Comment

        Working...
        X