|
|
#1 |
|
Member
Join Date: Jun 03
Posts: 42
![]() |
Dell Service Tag
Hey guys this might be a weird question but....
Does anyone know if there is a way to write a program and pull the service tag information from the bios off Dell Computers. Cause I just found out that dell is replacing all the hard drives from a whole bunch of machines that we got from them which particular service tags. Now I have access to those machine via VPN but I don't know how I can write a program that with run through a whole subnet of ip's for example 192.168.1.0 - 192.168.1.254 and display the service tag for all the ip's it scanned through.. If anyone has any idea comments/suggestion they are more than welcommed. Thanks ScarEye |
|
|
|
|
|
#2 |
|
Moderator.NET
Join Date: Nov 01
Location: NJ - USA (Near NYC)
Posts: 22,435
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Dell Service Tag
I can't say if its possible to get the service tag info via VB (i would guess the answer is NO, but I could be wrong)
what I can say is there IS in fact a way to do it via code, there is no way you could do it without running the code on the machine itself... for example you couldn't just run an app from one computer that can check the bios of another computer simply by its IP...
__________________
Using VB.NET 2010/.NET 2.0 through 4.0 * Please mark you thread resolved using the Thread Tools above ![]() PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!! * If you found a post useful then please Rate it! Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup ZerosAndTheOne.com -=Matt=- |
|
|
|
|
|
#3 |
|
MS SQL Powerposter
Join Date: Mar 04
Location: CT
Posts: 12,366
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Dell Service Tag
Last month I watched a DELL service guy (actually independent tech) replace the mother board on a laptop at one of my customer sites...
When he was done he then popped a CD into the machine and not only displayed the service tag but also changed it to match the old motherboard. If DELL is doing this to you - maybe you can ask them for a program to display the service tag.
__________________
*** Read the sticky in the DB forum about how to get your question answered quickly!! *** Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post". Some Informative Links: [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ] [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ VB.Net Database Class ] [ Loading Pictures from DB ] MS MVP 2006, 2007, 2008 |
|
|
|
|
|
#4 |
|
Member
Join Date: Jun 03
Posts: 42
![]() |
Re: Dell Service Tag
okay after doing some research I found using Windows Managment Instrumentation can show me the the serial number that is stored in the bios. Now there has to be a way I can connect to my remote machine WMI and pull this info.
Does this information help any ? The Win32_BIOS WMI class represents the attributes of the computer system's basic input/output services (BIOS) that are installed on the computer.. But I think this applies to VB5 & VB6 =( there has to be something for .net also. kleinma, thanks for your reply. But what do you think about the information I posted above ? szlamany, I called up Dell and the tech that I spoke to said it can't be done. And I say YES it can. Also the software that your are talking about where I can change the information inside the BIOS to refelect another motherboard I have that and you can probably download it. It's called Dell Portable Asset Tag Utility. Any more thoughts ??? Thanks ScarEye |
|
|
|
|
|
#5 | |
|
MS SQL Powerposter
Join Date: Mar 04
Location: CT
Posts: 12,366
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Dell Service Tag
Quote:
__________________
*** Read the sticky in the DB forum about how to get your question answered quickly!! *** Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post". Some Informative Links: [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ] [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ VB.Net Database Class ] [ Loading Pictures from DB ] MS MVP 2006, 2007, 2008 |
|
|
|
|
|
|
#6 | |
|
Moderator.NET
Join Date: Nov 01
Location: NJ - USA (Near NYC)
Posts: 22,435
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Dell Service Tag
Quote:
I think you would still need a "client" app running on each machine in order for you to connect to these machines via IP to get ANY information from them out of the BIOS... there just isn't a way you can take an IP, and using that IP obtain BIOS information from the remote computer, WMI doesn't have any "remote" capabilities like what you describe
__________________
Using VB.NET 2010/.NET 2.0 through 4.0 * Please mark you thread resolved using the Thread Tools above ![]() PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!! * If you found a post useful then please Rate it! Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup ZerosAndTheOne.com -=Matt=- |
|
|
|
|
|
|
#7 |
|
Member
Join Date: Jun 03
Posts: 42
![]() |
Re: Dell Service Tag
kleinma,
I am just doing some research and I did find this. Tell me what you think. I am still a n00b so that's why I am asking for everyones help http://msdn.microsoft.com/library/de...e_computer.asp Thanks |
|
|
|
|
|
#8 |
|
Member
Join Date: Jun 03
Posts: 42
![]() |
Re: Dell Service Tag
I can almost guarantee someone else is going to be looking for this badly.
Anyway after a whole bunch of research and trial and error I got it. Take this open up notepad, save it as whatever you want .vbs PLEASE NOTE **This Will Display The Service Tag On Dell Computers** So far every Dell machine I have tried it has worked. it will basically just read the serial number that is located in the BIOS. Just happens that with Dell the Serial Number = Service Tag = The information I need... lol I didn't need any other information so that's all I coded in there. strComputer = "PRIVATE IP ADDRESS OR DNS NAME GOES HERE" Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator") Set objWMIService = objSWbemLocator.ConnectServer _ (strComputer, "root\cimv2", _ "DOMAIN\USER", "PASSWORD") Set colSMBIOS = objWMIService.ExecQuery _ ("Select * from Win32_SystemEnclosure") For Each objSMBIOS in colSMBIOS Wscript.Echo "Serial Number: " _ & objSMBIOS.SerialNumber Next Fill in - strComputer = "192.168.1.1" or strComputer = "domaincontroller" Fill in - strComputer, "root\cimv2", _ "DC\ID10T", "PEBKAC") Now will this work over a public IP ? I would think so |?|?| it might as long as you accept whatever port is required on the other end. But I am not 100% sure I haven't tried it. But I know this code work perfectly as long as the WMI is running on the machine your trying to connect to. NO other client software is required. I am going to make this alittle better and I will post it up here when I am done. It's 4:17am time to go to bed. Enjoy ScarEye P.S. this does scan through a whole subnet or anything just single IP. I know of a way to have a iplist.txt file and put all your private ip's in that list and it will just go through every single one of them and just do a loop. If you need that just reply to this thread. Hopefully I am still alive by then. Last edited by ScarEye; Feb 26th, 2005 at 03:30 AM. |
|
|
|
|
|
#9 |
|
Addicted Member
Join Date: Apr 05
Location: Ann Arbor
Posts: 182
![]() |
Re: Dell Service Tag
At work here I had to do the same thing. The problem is that WMI doesen't let you use IP address like this. Somehow your going to have to turn that IP address into a NetBios name that you can use WMI with. Once you have that the rest is easy.
|
|
|
|
|
|
#10 | |
|
Member
Join Date: Jun 03
Posts: 42
![]() |
Re: Dell Service Tag
Quote:
You are wrong my friend. I don't know why you would say WMI does not let you use and IP address and that we have to use Netbios, I have ran this script on 400 computers over a vpn throughout the 5 borough's of New York and this has worked PERFECTLY. Using strictly IP address. Last edited by ScarEye; May 5th, 2005 at 12:45 PM. |
|
|
|
|
|
|
#11 |
|
New Member
Join Date: May 05
Posts: 1
![]() |
"P.S. this does scan through a whole subnet or anything just single IP. I know of a way to have a iplist.txt file and put all your private ip's in that list and it will just go through every single one of them and just do a loop. If you need that just reply to this thread. Hopefully I am still alive by then."
Can you post that for me please? (To make the iplist.txt and make your program go thru that list) Thank you |
|
|
|
|
|
#12 |
|
New Member
Join Date: Jun 06
Posts: 6
![]() |
Re: Dell Service Tag
Hey, for what it's worth, we did get this working at my work - we have a vb script that we run on our server, it connects to each PC and collects a variety of information - including the dell service tag number - and puts it all into an xml form (or csv file? I can't remember).
Anyway, if you still need it, I can see about pulling the required info from our vbscript and post it on here. |
|
|
|
|
|
#13 |
|
Moderator.NET
Join Date: Nov 01
Location: NJ - USA (Near NYC)
Posts: 22,435
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Dell Service Tag
i sure hope they aren't still looking for a solution a year later
__________________
Using VB.NET 2010/.NET 2.0 through 4.0 * Please mark you thread resolved using the Thread Tools above ![]() PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!! * If you found a post useful then please Rate it! Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup ZerosAndTheOne.com -=Matt=- |
|
|
|
|
|
#14 |
|
Banned
Join Date: Nov 05
Posts: 2,367
![]() ![]() ![]() ![]() |
Re: Dell Service Tag
Either way, it still beats Dell's turnaround time for service. :X
|
|
|
|
|
|
#15 |
|
New Member
Join Date: Jun 06
Posts: 6
![]() |
Re: Dell Service Tag
Haha... I didn't even notice the date on it! My mistake
You're right though, Dell does take forever to respond. |
|
|
|
|
|
#16 | |
|
Moderator.NET
Join Date: Nov 01
Location: NJ - USA (Near NYC)
Posts: 22,435
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Dell Service Tag
Quote:
__________________
Using VB.NET 2010/.NET 2.0 through 4.0 * Please mark you thread resolved using the Thread Tools above ![]() PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!! * If you found a post useful then please Rate it! Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup ZerosAndTheOne.com -=Matt=- |
|
|
|
|
|
|
#17 |
|
MS SQL Powerposter
Join Date: Mar 04
Location: CT
Posts: 12,366
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Dell Service Tag
For what it's worth...
My DELL experiences have been great... LCD monitor over a year outside of warranty - but had a black-line traveling from top to bottom - they replaced it anyway... SERVER started to die - seemed like network card issues - ended up being an attack on the OS from a hacker - DELL support helped figure that out with us so we could nuke the machine and re-install... Just thought I would mention that Gateway, 6 years ago, would put me on hold - and then after 5 minutes come back on and say (electronically!) "there was no one able to help me in a reasonable amount of time" and then hang up on me - but they aren't really around anymore - are they?
__________________
*** Read the sticky in the DB forum about how to get your question answered quickly!! *** Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post". Some Informative Links: [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ] [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ VB.Net Database Class ] [ Loading Pictures from DB ] MS MVP 2006, 2007, 2008 |
|
|
|
|
|
#18 |
|
Moderator.NET
Join Date: Nov 01
Location: NJ - USA (Near NYC)
Posts: 22,435
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Dell Service Tag
just another reason why I build my own PCs
__________________
Using VB.NET 2010/.NET 2.0 through 4.0 * Please mark you thread resolved using the Thread Tools above ![]() PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!! * If you found a post useful then please Rate it! Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup ZerosAndTheOne.com -=Matt=- |
|
|
|
|
|
#19 |
|
New Member
Join Date: Jun 06
Posts: 6
![]() |
Re: Dell Service Tag
Dell is usually alright I guess, but we've had quite a few disasters with them in the past. They came to replace a fan in one of our servers once, and the muppet they sent ended up wiping all the data out! Thankfully we had a full backup of everything... After that day, we always made sure one of our engineers was on site whenever a Dell engineer would show up. *sigh*
|
|
|
|
|
|
#20 |
|
New Member
Join Date: Jun 06
Posts: 2
![]() |
Re: Dell Service Tag
found these forums through Google and joined right away. Hey b_girl if I could get you to post your working service tag code that would be great.
|
|
|
|
|
|
#21 |
|
Moderator.NET
Join Date: Nov 01
Location: NJ - USA (Near NYC)
Posts: 22,435
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Dell Service Tag
Headin, you could even try to send her a private message.
__________________
Using VB.NET 2010/.NET 2.0 through 4.0 * Please mark you thread resolved using the Thread Tools above ![]() PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!! * If you found a post useful then please Rate it! Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup ZerosAndTheOne.com -=Matt=- |
|
|
|
|
|
#22 |
|
New Member
Join Date: Jun 06
Posts: 2
![]() |
Re: Dell Service Tag
ya, just found those features, thanks
|
|
|
|
|
|
#23 |
|
New Member
Join Date: Jun 06
Posts: 6
![]() |
Re: Dell Service Tag
The code below is done in VB Script... It'll pull out the Service Tag and display it in a pop up window. Hope that helps.
![]() Set objWMIservice = GetObject("winmgmts:\\.\root\cimv2") set colitems = objWMIservice.ExecQuery("Select * from Win32_BIOS",,48) For each objitem in colitems Wscript.echo "Dell Service Tag: " & objitem.serialnumber Next |
|
|
|
|
|
#24 |
|
Hyperactive Member
Join Date: Sep 05
Location: Alaska
Posts: 435
![]() |
Re: Dell Service Tag
If you had LANDesk, you could do it.
|
|
|
|
|
|
#25 |
|
Junior Member
Join Date: Jul 06
Posts: 27
![]() |
Re: Dell Service Tag
Can anyone translate that to VB.net instead of VB script...sorry I am just not clear enough on WMI to get the translation down. (just need to pull service tag from local system)
|
|
|
|
|
|
#26 |
|
New Member
Join Date: Jun 06
Posts: 6
![]() |
Re: Dell Service Tag
Hey, I'm actually new to VB.Net and VB so I'm afraid I won't be much help with 'translating' from VB script.
Sorry... |
|
|
|
|
|
#27 |
|
Hyperactive Member
Join Date: Jul 05
Posts: 296
![]() ![]() |
Re: Dell Service Tag
Assuming:
you have added a reference to System.Management you have the line VB Code:
VB Code:
I can't test this next function, for retrieving remote compter info. I get Access Denied errors with my home workgroup based network. It should be fine if you have a domain network and use a suitable user account. More on connecting here: msdn: connecting to wmi on a remote computer VB Code:
|
|
|
|
|
|
#28 |
|
Junior Member
Join Date: Jul 06
Posts: 27
![]() |
Re: Dell Service Tag
Thanks soooo much. Turns out the sloppy conversion I did from script to VB acually worked, just my test system did not have a service code in its bios.... next dell I went to worked like a charm.
|
|
|
|
|
|
#29 |
|
New Member
Join Date: Jul 06
Posts: 3
![]() |
Re: Dell Service Tag
I have written a script that shows user name, computer ID, and Dell Service Tag. When I output the info using Wscript.echo it will output each of the three listed above in individual messageboxes. I change the code so it outputs to one message box but i cant get the output to go to a newline. It displays all on the same line. Here is my code.
' VBScript source code Option Explicit Dim objWshShell, colitems, objWMIservice, objitem, strUserName, strComputerName Set objWshShell = CreateObject("WScript.Shell") strUserName = objWshShell.ExpandEnvironmentStrings("%USERNAME%") ' Locates Username strComputerName = objWshShell.ExpandEnvironmentStrings("%COMPUTERNAME%") ' Locates Computer Name Set objWMIservice = GetObject("winmgmts:\\.\root\cimv2") set colitems = objWMIservice.ExecQuery("Select * from Win32_BIOS",,48) For each objitem in colitems ' Locates Dell Service Tag Wscript.echo " User Name: " + strUserName & " Computer Name: " + strComputerName &_ " Dell Service Tag: " & objitem.serialnumber ' Displays Next What is the code to make the output UserName ***** then have Computer name go to the Newline? |
|
|
|
|
|
#30 |
|
New Member
Join Date: Aug 06
Posts: 1
![]() |
Re: Dell Service Tag
'Connect to WMI namespace
Dim objWshShell, colitems, objWMIservice, objitem, strUserName, strComputerName Set objWshShell = CreateObject("WScript.Shell") strUserName = objWshShell.ExpandEnvironmentStrings("%USERNAME%") ' Locates Username strComputerName = objWshShell.ExpandEnvironmentStrings("%COMPUTERNAME%") ' Locates Computer Name Set objWMIservice = GetObject("winmgmts:\\.\root\cimv2") set colitems = objWMIservice.ExecQuery("Select * from Win32_BIOS",,48) For each objitem in colitems ' Locates Dell Service Tag 'Output Wscript.echo " User Name: " & strUserName & vbcr _ & " Computer Name: " & strComputerName & vbcr _ & " Dell Service Tag: " & objitem.serialnumber Next that shoud do the trick for you |
|
|
|
|
|
#31 |
|
New Member
Join Date: Mar 08
Posts: 1
![]() |
Here is a utility that I use within my network to get service tag and other info from my desktop. It will also let you know who is logged on to the machine if someone is logged on.
Just copy the text below and paste into a notepad. then rename the file with .vbs extention. I would suggest running the script with elevated rights so that any active directory authentication or what not can be detoured. When you run the script just type in the computer name or IP address. enjoy. ---------copy from here down--------- vb.net Code:
|
|
|
|
|
|
#32 |
|
Member
Join Date: Jun 03
Posts: 42
![]() |
Re: Dell Service Tag
Cool, thanks for the new script. =)
|
|
|
|
|
|
#33 |
|
Powered By Medtronic
Join Date: Dec 07
Location: Pointless Forest 38.517,-92.023
Posts: 4,759
![]() ![]() ![]() ![]() ![]() ![]() |
Re: Dell Service Tag
The date span on this thread is amazing.
__________________
Links-Subnet Planner,Tips, Use Decimal for Currency, Random Number Generator, Serial Port, Network Info, XO,Misc. Date
< Ban Ping-Then-Do > < Mark Thread Resolved - if it is > < Rate Posters That Help > Looking for Work - 65101 -160001000000- My First ComputerIf my answers seem harsh it is because I assume that you wrote the code for the PC in my chest. If you screw-up I'm dead. |
|
|
|
|
|
#34 |
|
Moderator.NET
Join Date: Nov 01
Location: NJ - USA (Near NYC)
Posts: 22,435
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Dell Service Tag
I've seen much much worse... 5+ years sometimes...
__________________
Using VB.NET 2010/.NET 2.0 through 4.0 * Please mark you thread resolved using the Thread Tools above ![]() PLEASE INDICATE WHAT VERSION OF VB YOU USE!!!!!!!!!!! * If you found a post useful then please Rate it! Code Bank:Manipulate HTML Page content in the Web Browser Control from VB - Drag Drop from Windows into Win Form - Launch new default browser instance to open URL - Display Internet Image in Picturebox - Download Files From Web With Progress Bar - IP Textbox User Control - Installing .NET Framework with INNO Setup ZerosAndTheOne.com -=Matt=- |
|
|
|
|
|
#35 |
|
New Member
Join Date: Mar 08
Posts: 2
![]() |
Re: Dell Service Tag
I've been using a little VB script that can pull the Service Tag from the pc's on the network when I know the computer name. This is what I have -
strComputer = inputbox("Type the name of the computer with out \\ or an IP address to find out the service tag") if strComputer = "" then wscript.quit Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colSMBIOS = objWMIService.ExecQuery ("Select * from Win32_SystemEnclosure") For Each objSMBIOS in colSMBIOS Wscript.Echo "Service tag (serial number): " & objSMBIOS.SerialNumber Next Now I need one that can give me the computer name when I know the Service Tag. Can anyone help? Last edited by LPlater; Mar 24th, 2008 at 08:26 PM. |
|
|
|
|
|
#36 |
|
New Member
Join Date: Mar 08
Posts: 2
![]() |
Re: Dell Service Tag
Is there anyone out there than can help with the script above that I'm using and use any of the following code to locate the COMPUTER NAME on a network if I have the SERVICE TAG already?
Can anyone put the two together to give me what I'm after. PLEEEASE! 'Connect to WMI namespace Dim objWshShell, colitems, objWMIservice, objitem, strUserName, strComputerName Set objWshShell = CreateObject("WScript.Shell") strUserName = objWshShell.ExpandEnvironmentStrings("%USERNAME%") ' Locates Username strComputerName = objWshShell.ExpandEnvironmentStrings("%COMPUTERNAME%") ' Locates Computer Name Set objWMIservice = GetObject("winmgmts:\\.\root\cimv2") set colitems = objWMIservice.ExecQuery("Select * from Win32_BIOS",,48) For each objitem in colitems ' Locates Dell Service Tag 'Output Wscript.echo " User Name: " & strUserName & vbcr _ & " Computer Name: " & strComputerName & vbcr _ & " Dell Service Tag: " & objitem.serialnumber Next |
|
|
|
|
|
#37 |
|
New Member
Join Date: Apr 08
Posts: 1
![]() |
Re: Dell Service Tag
On Error Resume Next
do while strcomputer = "" and a < 2 strcomputer = Inputbox ("Please enter IP address or Computer name","Remote Computer Information Display","IP is preferred search method") strcomputer = trim(strcomputer) a = a + 1 loop if not strComputer <> "" then wscript.echo "No computer name entered, ending script" wscript.quit end if On Error Resume Next Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") if err.number <> 0 then if err.number = -2147217405 then wscript.echo "You do not have sufficient access rights to this computer" wscript.quit else wscript.echo "Could not locate computer" &vbcrlf& "Please check IP Address/Computer Name and try again" wscript.quit end if end if Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_BIOS") Set colItems1 = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem") Set colItems2 = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration Where IPEnabled = True") Set colitems3 = objWMIService.ExecQuery("SELECT * FROM Win32_computersystem") Set colitems4 = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkLoginProfile") Set colitems5 = objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk Where DriveType = 3") Set objExplorer = CreateObject("InternetExplorer.Application") objExplorer.Navigate "about:blank" objExplorer.ToolBar = 0 objExplorer.StatusBar = 0 objExplorer.Width = 800 objExplorer.Height = 600 objExplorer.Left = 100 objExplorer.Top = 100 objExplorer.Visible = 1 Do While (objExplorer.Busy) Loop Set objDocument = objExplorer.Document objDocument.Open objDocument.Writeln "<html><head><title>Computer Information</title></head>" objDocument.Writeln "<body bgcolor='white'>" ' Computer Detals For Each objItem In colItems serial = objitem.serialnumber next For Each objItem In colItems1 hostname = objitem.caption make = objitem.manufacturer model = objitem.model next objDocument.Writeln "<FONT color='red' size=4>Computer Information For: " & Ucase(hostname) & "</FONT><BR><BR>" objDocument.Writeln "<FONT face='Courier' color='black'>Serial : " & Serial & "</FONT><BR>" objDocument.Writeln "<FONT face='Courier' color='black'>Make : " & make & "</FONT><BR>" objDocument.Writeln "<FONT face='Courier' color='black'>Model : " & Model & "</FONT><BR>" For Each objItem In colItems5 driveletter = objitem.name capacity = ((objitem.size / 1024) / 1024) / 1024 free = ((objitem.FreeSpace / 1024) / 1024) / 1024 free = FormatNumber (free,2) capacity = FormatNumber (capacity,2) objDocument.Writeln "<FONT face='Courier' color='black'>Capacity of " &driveletter& " - " & capacity & "GB</FONT><BR>" objDocument.Writeln "<FONT face='Courier' color='black'>Free Space on " &driveletter& " - " & Free & "GB</FONT><BR>" next objDocument.Writeln "<BR><FONT color='Blue' size=4>Please Wait, gathering more information...</FONT><BR><BR>" ' User Details For Each objItem In colItems3 loggedon = objitem.username next For Each objItem In colItems4 cachedlog = objitem.name username = objitem.FullName passwordexpire = objitem.passwordexpires badpassword = objitem.badpasswordcount if loggedon = cachedlog then objDocument.Writeln "<FONT color='red' size=4>User Information For...</FONT><BR>" objDocument.Writeln "<FONT color='red' size=4>" & username & "</FONT><BR><BR>" objDocument.Writeln "<FONT face='Courier' color='black'> User Name :" & loggedon &"</FONT><BR>" objDocument.Writeln "<FONT face='courier' color='black'> Incorrect Password Attempts : " & badpassword &"</FONT><BR>" on error resume next Set objaccount = GetObject("WinNT://scit84.sagchip.org/" &objitem.caption & ",user") if Err.Number <> 0 Then objDocument.Writeln "<FONT face='courier' color='black'>unable to retrieve password expiration information</FONT><BR>" Else If objAccount.PasswordExpired = 1 Then objDocument.Writeln "<FONT face='courier' color='red'>Password has Expired!</FONT><BR>" Else objDocument.Writeln "<FONT face='courier' color='black'>Password Expires " & objAccount.PasswordExpirationDate & " </FONT><BR><BR>" end if end if end if next ' Network Adapter Details For Each objItem In colItems2 ipaddress = objitem.ipaddress(0) description = objitem.description DHCP = objitem.DHCPserver Domain = objitem.DNSdomain mac = objitem.MACaddress DNS = objitem.dnsserversearchorder(0) DNS1 = objitem.dnsserversearchorder(1) DNS2 = objitem.dnsserversearchorder(2) wins1 = objitem.winsprimaryserver wins2 = objitem.winssecondaryserver if not ipaddress = "0.0.0.0" then objDocument.Writeln "<FONT color='red' size=4>Network Adapter Details For...</FONT><BR>" objDocument.Writeln "<FONT color='red' size=4>" & description & "</FONT><BR><BR>" objDocument.Writeln "<FONT face='Courier' color='black'> IP Address :" & ipaddress &"</FONT><BR>" objDocument.Writeln "<FONT face='courier' color='black'> DHCP Server : " & DHCP &"</FONT><BR>" objDocument.Writeln "<FONT face='courier' color='black'> Domain Name : " & domain &"</FONT><BR>" objDocument.Writeln "<FONT face='courier' color='black'> MAC Address : " & mac &"</FONT><BR>" objDocument.Writeln "<FONT face='courier' color='black'> Primary DNS : " & DNS &"</FONT><BR>" objDocument.Writeln "<FONT face='courier' color='black'> Secondary DNS : " & DNS1 &"</FONT><BR>" objDocument.Writeln "<FONT face='courier' color='black'> Tertiary DNS : " & DNS2 &"</FONT><BR>" objDocument.Writeln "<FONT face='courier' color='black'> Primary WINS : " & wins1 &"</FONT><BR>" objDocument.Writeln "<FONT face='courier' color='black'> Secondary WINS : " & WINS2 &"</FONT><BR><BR>" end if next objDocument.Writeln "<FONT color='Blue' size=4>Script Finished</FONT><BR><BR>" |
|
|
|
|
|
#38 |
|
New Member
Join Date: Jun 08
Posts: 1
![]() |
Re: Dell Service Tag
ComputerName = InputBox("Machine Name To Query")
winmgmt1 = "winmgmts:{impersonationLevel=impersonate}!//"& ComputerName &"" Set SerialN = GetObject( winmgmt1 ).InstancesOf ("Win32_BIOS") For each Serial in SerialN MsgBox "Serial Number: " & Serial.SerialNumber Next |
|
|
|
|
|
#39 |
|
New Member
Join Date: Jul 08
Posts: 1
![]() |
Thanks guys. I coded it in ruby, based on what you were saying in the thread.
Made a "class" out of it. At the bottom is a example of "calling" the methods, to get the service tag. Now I'm going to wrap it in a Rails application to have a compete "pc" inventory application. http://mentalpagingspace.blogspot.co...number-in.html |
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|