how to incorporate two WMIC commands to print results on same line - TechRepublic
Question
May 12, 2009 at 07:03 AM
knowledgebased

how to incorporate two WMIC commands to print results on same line

by knowledgebased . Updated 17 years ago

I am using WMIC to pull info from a range of IP addresses (also using FOR command to point to range). I can pull User logged in, Model number and Computer Name. I need to be able to pull the Dell SVC Tag and have all the results appear on the same line. The problem is that one uses computersystem as a switch/alias and the other uses csproduct

A basic example of my command so far:
prompt>wmic /node:127.0.0.1 computersystem get name, username, model

The following command will pull SVC tag:
prompt>wmic /node:127.0.0.1 csproduct get identifyingnumber

How can I incorporate these two commands so that the results from each IP address are grouped. I am exporting this data to a spreadsheet and each row of the spreadsheet will show USER, COMP NAME, MODEL, and SVC TAG. This will be done for over 100 PCs so it should be as automated as possible.

This discussion is locked

All Comments