Skip to content

Computer information from WMI

Featured Replies

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 "="

  • Author

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

  • 3 years later...

@echo off
FOR /F "usebackq tokens=2 delims==" %%A in (`WMIC PATH Win32_OperatingSystem Get InstallDate /VALUE^|FIND "="`) DO SET i=%%A
SET InstallDate=%i:~0,4%-%i:~4,2%-%i:~6,2% %i:~8,2%:%i:~10,2%:%i:~12,2%
ECHO InstallDate=%InstallDate%

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.