Help on a Windows batch file domain pc query?

I need to be able to query the domain and take all the computer names in the domain name put them into a text file. Then I need to take those results and use them to query all the computer for their system info (name, ip ,mac) Like the DOS systeminfo command with the mac address. And save the ouput as a .csv file that contains all the information for all computers in the domain. I have alot of seperate parts ,but can't tie it al together that good. Any help is appreciated.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

It's tough to query all the remote machines in real time but pretty easy to set up a login script that queries the PC and writes a CSV out on a network share. Is that a possibility? The simplest script would just be one line:

set > \\server\share\%computername%.txt
you can also add another line (if you are going with uter solution) for ip addresses, mac address and computer name ..etc like this:

ipconfig /all >> \\server\share\%computername%.txt

nothe that the >> will append to the file, not delte it.

hope this help
If you really want to get fancy, you can do a

fsutil fsinfo drives

which will list all the drives, then parse those with a for loop and do a

fsutil volume diskfree [drive letter]

to get the free space.

(Beat THAT for obscure DOS commands!) :-)

Top Threats of Q1 & How to Defend Against Them

WEBINAR: Join WatchGuard CTO and our Threat Research Team on Aug. 2nd to hear the findings from our Q1 Internet Security Report! Learn more about the top threats detected in the first quarter and how you can defend your business against them!

sliderwingAuthor Commented:
It is a weird scenario. I have no control over the servers, but total control over about 100 pc's running windows xp. So I won't be able to do the server thing. Thanks though.
You can use the following program to get the information that you require with out the need to have access to the server. It will also automatically export to CSV and scans the network quite quickly.

NBTscan is a program for scanning IP networks for NetBIOS name information. It sends NetBIOS status query to each address in supplied range and lists received information in human readable form. For each responded host it lists IP address, NetBIOS computer name, logged-in user name and MAC address.

Example Usage-

nbtscan.exe -q -s , > list.csv
nbtscan.exe -q -s , > list.csv

just use the above commands in a batch file and replace the IP ranges with your own.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Also have a look at PSTools especially PsExec

PsExec will allow you to run programs remotely over a whole network of computers. The only problem is that it requires you to have a list of al of the computers on the domain. Although you could probably use nbtscan for that or some other tool.
When you said 'domain', do you have Active Directory? You can start your PC name list by exporting the contents of the Users and Computers tool, Computers folder.

The reverse approach, Make an Excel spreadsheet: put the text string "ping -n 1 -a 192.168.0." in cell A1 and copy it down to A254. (change the 192 part to match your IP addresses).
In B1, type 1, then in B2 type 2, use the pattern fill to complete the series down to cell B254.
In C1 type " >c:\pinglog.txt" and copy this all the way down to C254
Save as a text file, open it in notepad
Do a Find/Replace to remove the " and , and then save, rename to ping.bat and run it.

You can do "arp -a" for a list of IP to mac addresses shortly after your scan finishes or change the batch file above to nbtstat -A

These batch file approaches let you inventory your network, but require the PCs to be turned on.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apple Networking

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.