Solved

powershell script to get TCP IP settingsfor each DC to include DNS, and WINs

Posted on 2015-02-06
2
169 Views
Last Modified: 2015-02-11
Hello,
Could you please provide a script to get all TCP/IP settings that include DNS and WINs for each domain controller. Also, the script that would export the results into the excel file in a readable format. I am new to powershell, so please help.
0
Comment
Question by:creative555
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 500 total points
ID: 40594234
You need to first fine all of the domain controllers. Use the below command...
netdom query dc
Put those names into a text file c:\dclist.txt
Use the following powershell script to accomplish this...

$DClist = get-content "c:\dclist.txt"
Foreach ($DC in $DClist) {
Get-Wmiobject -Class Win32_NetworkAdapterConfiguration -ComputerName $DC | ? {$_.IPAddress -like "192.168.0.*"} | Select $DC, IPAddress, DefaultIPGateway, DNSDomain | out-file "c:\DCNetworkSettings.csv" -append
}

Open in new window


Make sure you change the $_.IPAddress -like "192.168.0.* to what your internal IP scheme is.

WIll.
0
 

Author Closing Comment

by:creative555
ID: 40604120
Thank you so much!!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows theĀ method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlleā€¦
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question