Jump to content


Thomas M

Computer information from WMI

Recommended Posts

I pull this info out in order to have a complete register of all our computer systems in case of theft or insurance issues.

 

DNSHostName=XXX10001

Manufacturer=LENOVO

Version=ThinkCentre A57

Model=970273G

SerialNumber=LMXXXXX

UserName=Domain\Username

FullName=Lastname, Firstname Middlename

Caption=Microsoft Windows 7 Enterprise

Version=6.1.7600

OSArchitecture=64-bit

InstallDate=20100728133244.000000+120

IPAddress={"10.0.0.2","fe80::19da:933c:93c4:51a1"}

MACAddress=00:11:22:33:44:AA

 

Here's the script

 

 

@echo off

WMIC PATH Win32_ComputerSystem Get DNSHostName /Value | FIND "="

WMIC PATH Win32_BIOS Get Manufacturer /Value | FIND "="

WMIC PATH Win32_ComputerSystemProduct Get Version /Value | FIND "="

WMIC PATH Win32_ComputerSystem Get Model /Value | FIND "="

WMIC PATH Win32_BIOS Get SerialNumber /Value | FIND "="

WMIC PATH Win32_ComputerSystem Get UserName /Value | FIND "="

WMIC PATH Win32_UserAccount where name="%username%" get FullName /value | FIND "="

WMIC PATH Win32_OperatingSystem Get Caption /Value | FIND "="

WMIC PATH Win32_OperatingSystem Get Version /Value | FIND "="

WMIC PATH Win32_OperatingSystem Get OSArchitecture /Value | FIND "="

WMIC PATH Win32_OperatingSystem Get InstallDate /Value | FIND "="

WMIC PATH Win32_NetworkAdapterConfiguration where "IPEnabled=true" Get IPAddress /Value | FIND "="

WMIC PATH Win32_NetworkAdapterConfiguration where "IPEnabled=true" Get MACAddress /Value | FIND "="

Share this post


Link to post
Share on other sites

Ps. If anyone has a good solution to format the InstallDate string I'd be very happy.

InstallDate=20100728133244.000000+120

 

Would prefer it to be in a readable format (2010-07-28 13:32:44)

I know this can be done easily in PowerShell, but as we've still got some XP clients without the Powershell client I don't think that can be done.

This is why I've decided to use a simple batch script to be run using the logon script.

 

-Thomas

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...