SmartCode Solutions Web Forum




VB Script to show Serial Number or Service tag

Author Message
 Posted Wednesday, May 21, 2008
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Wednesday, May 21, 2008
Posts: 1, Visits: 2
Hey guys,  I have just started using VNC Manager and I have to say it is very impressive!  well worth the cost! 

anyway,

here is a VB Script that you can remote execute to get the Manufacturer of the machine as well as the serial number.   I have tested this with HP and the serial number displays just as it should... I tested it on a dell machine and was plesently suprised to see that it flawlessly displays the service tag so every dell I tried it on.  very handy to have that information remotely at a click of a mouse.

here is the code:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colBIOS = objWMIService.ExecQuery _
    ("Select * from Win32_BIOS")
For each objBIOS in colBIOS
    WScript.StdOut.WriteLine "Manufacturer: " & objBIOS.Manufacturer
    WScript.StdOut.WriteLine "Serial Number: " & objBIOS.SerialNumber
Next

I got this script from HP's website and edited it so the output would work with VNC Manager.

the original script is located here:

http://h41111.www4.hp.com/hps/carepack/emea_middle_east/en/getserial.html

have to give credit where credit is due! Wink

Post #2075
Add to Twitter Add to Facebook
 Posted Monday, August 18, 2008
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Tuesday, August 19, 2008
Posts: 3, Visits: 7
How do we link this .vbs script up to work in VNC manager?

The limited help files only go as far as explaining how to add a .exe file...
Post #2162
Add to Twitter Add to Facebook
 Posted Monday, August 18, 2008
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 39 minutes ago
Posts: 1,625, Visits: 3,045
In case if you want to create an external tool launching a VBscript you should enter the following values into the properties dialog:

Command: cscript.exe
Arguments: [Path to your .vbs file] , you can also enter optional arguments like ($SERVER_IP)

Most probably you would have to have "Keep console window" checkbox checked.



http://www.s-code.com/App_Themes/Default/images/blue_line.gif
We are looking for investors and business partners. Please contact us for more details

Kindest Regards,
SmartCode Solutions Support
Post #2165
Add to Twitter Add to Facebook
 Posted Tuesday, August 19, 2008
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Tuesday, August 19, 2008
Posts: 3, Visits: 7
I have followed your guide above. The problem is though this only returns the localhost service tag and not the remote host.

I would prefer it to return the remote computers service tag.
Post #2168
Add to Twitter Add to Facebook
 Posted Tuesday, August 19, 2008
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: 39 minutes ago
Posts: 1,625, Visits: 3,045
That's because the script posted by jeffs24 has strComputer variable assigned to localhost (".")

You should replace the first line with:
strComputer = WScript.Arguments.Item(0)


http://www.s-code.com/App_Themes/Default/images/blue_line.gif
We are looking for investors and business partners. Please contact us for more details

Kindest Regards,
SmartCode Solutions Support
Post #2169
Add to Twitter Add to Facebook
 Posted Tuesday, August 19, 2008
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: Tuesday, August 19, 2008
Posts: 3, Visits: 7
That works brilliantly now Smile

Cheers
Post #2170
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse