?
Solved

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

Posted on 2015-02-06
2
Medium Priority
?
178 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 2000 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

Independent Software Vendors: 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

Let's recap what we learned from yesterday's Skyport Systems webinar.
Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses
Course of the Month11 days, 23 hours left to enroll

752 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