RSS

Remotely Run IPCONFIG on many PCs and export specific information from the results

13 Apr

I wanted to get the current DNS servers set on all the servers in the domain.

1. I exported the list of servers currently in the domain to a file.

2. I downloaded SysInternals PSTools from Microsoft Technet website.

In these PSTools, we have PSExec command which helps run commands remotely from a computer.

I extracted the PSTools zip to my C: drive.

3. I created a folder for Logs on my PC c:ipconflogs

4. I then created a command file which runs for each server of my list :

“PSExec /accepteula \computer_name ipconfig /all >>c:ipconflogs computer_name.txt”

i. To create the command file, I usually edit an Excel file as you see below.

ii. Then I copy-paste to Notepad and delete all tabs following “” and preceeding “.txt”. After that I replace all tabs remaining by spaces. (This is document edition actually…)

5. Alright, now I run my command and I have a set of .txt files in the c:ipconflogs folder.

6. I run the following command to gather all the information in one csv file:

C:\>cd ipconflogs

C:\ipconflogs>copy *.txt report.csv

7. I then open my csv file in Excel and find that the information is gathered into one column.

8. I then set a filter to only show lines where I have *name* (for the host name) and *172.* (for the IP addresses). Actually this is easy because all my IP addresses are in 172.x.y.z format. If you have many different subnets, I cannot guarantee the filtering will be easy.

9. I am done, I now have all my servers, their IP address(es) and the DNS servers set on them:

I can even filter more by copying this filtered information to another sheet.

I hope this is helpful to you.

Advertisements
 
4 Comments

Posted by on April 13, 2011 in Windows 2003, Windows 2008 R2

 

Tags: , , , , , , , ,

4 responses to “Remotely Run IPCONFIG on many PCs and export specific information from the results

  1. Andy

    November 27, 2012 at 9:57 am

    sadissa,

    I found this topic good, but I think that there is a better solution available for noobies and power users as well. I talk about Remote IP Configuration utility of AdminToys Suite from http://www.admintoyssuite.com/

    It allows you to change network card settings remotely. All information can be dumped to TXT, HTML or CSV to export it to, for example, Excel for further processing.

    Like

     
  2. t e m p a t k i t a

    March 24, 2015 at 1:15 pm

    you also may use CMD> FOR /F %C IN (‘TYPE LIST-SERVERS.TXT’) DO @PSEXEC /ACCEPTEULA \\%C IPCONFIG /ALL>>”C:\IPCONFLOGS\%C.TXT” [enter]

    Like

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s