Solved

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

Posted on 2015-02-06
2
173 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
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.

724 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