Solved

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

Posted on 2015-02-06
2
147 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
2 Comments
 
LVL 53

Accepted Solution

by:
Will Szymkowski earned 500 total points
Comment Utility
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
Comment Utility
Thank you so much!!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Microsoft Windows Server Update Service (WSUS) is free for everyone, but it lacks of some desirable features like send an e-mail to the administrator with the status of all computers on the WSUS server. This article is based on my PowerShell script …
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
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 to another domain controller. Log onto the new domain controller with a user account t…

743 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now