Run WMIC command across network

command linewmic

Instead of typing this in a command prompt one at a time:

wmic /node:ipaddress /user:administrator /password:mypassword bios get serialnumber

How can I run that against one entire subnet and output to a text document? Since I do this every couple months to verify our inventory of computers, I would assume there would be a much of easier way I could put this in a batch script instead of doing it manually.

Best Answer

You may put a list after node: node:ip1,ip2,ip3, or use a file node:@file - so just put all your ip addresses into a file and then run:

wmic /node:@nodes.txt /user:administrator /password:mypassword /output:out.csv bios get serialnumber /format:csv

That assumes user/password is the same on all machines.