Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd rather not run round checking each machine individually, is there some server-side software I can use? It's a mixed linux/windows network (clients and servers) but I'm only interested in the windows clients.

share|improve this question

For Windows clients you can use a WMI script to obtain this. The info here should help get you started.

share|improve this answer
Looks good, but how do I get it to run on all client machines in the domain and report back to me? – Draemon Feb 17 '10 at 11:29
Have a script run at logon that outputs the results to a text file (named with the client computer's name.txt) with the results to a everyone-write-access share? – Bart Silverstrim Feb 17 '10 at 12:33
It should be easy enough to adapt once you have a list of computer names to start with. Loop through the list and call a sub containing most of the code in that link. Results could go to a file share, be sent via email or logged to a database. But we're getting more into the realm of "how to write VBScript" here, which is probably better covered in a separate question once you've made a decision on which way to go. – Le Comte du Merde-fou Feb 17 '10 at 13:22
@mh not really. I know how to write VBScript, but I don't know WMI. What I really meant was "how to run at logon", but I've figured that out. What I didn't realise is that you can do this from one machine given a list of the other machines. – Draemon Feb 17 '10 at 13:30
up vote 1 down vote accepted

Thanks to @mh for the link to WMI. Here's the script I ended up with.

On Error resume next

strDomain = "domain.local"

Set objFSO = CreateObject("Scripting.FileSystemObject")
if err.number <> 0 then Wscript.quit

set domObj = GetObject("WinNT://" & strDomain)
domObj.Filter = Array("computer")
For Each objComputer In domObj
    strComputer = objComputer.Name
    computerName = "UNKNOWN"
    loggedOnUser =""
    sp = ""
    ram = ""
    cpu = ""
    cpuMhz = ""
    xres = ""
    yres = ""

    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")

    if err.number=0 then
    ' Query "BIOS" properties
    ' computer name
    Set colItems = objWMIService.ExecQuery("Select * From Win32_BIOS")
    For Each objItem in colItems
        computerName = objItem.Path_.Server

    ' Query Processor properties
    ' Family
    ' ...
    Set colItems = objWMIService.ExecQuery("Select * From Win32_Processor")
    For Each objItem in colItems
        cpu = objItem.Manufacturer & " " & objItem.Name
        cpuMhz = objItem.MaxClockSpeed

    ' Query Operating System properties
    ' SP Level
    ' RAM
    Set colItems = objWMIService.ExecQuery("Select * From Win32_OperatingSystem")
    For Each objItem in colItems
        sp = objItem.ServicePackMajorVersion
        ram = objItem.TotalVisibleMemorySize

    ' Query Computer System properties
    ' User
    Set colItems = objWMIService.ExecQuery("Select * From Win32_ComputerSystem")
    For Each objItem in colItems
        loggedOnUser = objItem.UserName

    ' Query Display properties
    ' Screen resolution
        Set colItems = objWMIService.ExecQuery("Select * From Win32_DisplayConfiguration")
        For Each objItem in colItems
            xres = objItem.PelsWidth
            yres = objItem.PelsHeight

        strFile = "\\server\data\inventory\" & computerName & ".txt"

        Set objTextFile = objFSO.OpenTextFile(strFile, 2, True)
        if err.number <> 0 then Wscript.quit

        objTextFile.WriteLine("Computer Name: " & strComputer)
        if err.number <> 0 then Wscript.quit

    if loggedOnUser <> "" then objTextFile.WriteLine("User: " & loggedOnUser)
    if cpu <> "" then objTextFile.writeLine("CPU: " & cpu)
    if cpuMhz <> "" then objTextFile.writeLine("CPU MHZ: " & cpuMhz)
    if ram <> "" then objTextFile.WriteLine("RAM: " & ram)
    if sp <> "" then objTextFile.WriteLine("Service Pack: " & sp)
    if xres <> "" then objTextFile.WriteLine("Horizontal resolution: " & xres)
    if yres <> "" then objTextFile.WriteLine("Vertical resolution: " & yres)


    end if
share|improve this answer

You can do this via SCOM but it's a big hammer to crack a small nut to be honest.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.