IP address information from Pinned Servers

Hi All,

Newbie. First post.

Can someone point me to a script where I am able to discover what IP addressess on our vast server enterprise that are pinned to our Domain controllers.
This is needed in order to identify what the primary & secondary IP DNS configuration of our member servers are connected to our 15 domain controllers. As we are in the process of rebuilding some of our DC’s and having some issues.
Any help or advice to get a script that can interogate member servers for their DNS IP Addressess would be very useful.

Regards.

Hi Peter,

Welcome! What have you tried so far? Have you found anything searching online to see if anything may fit the bill for you or sounds close? First thing that comes to mind is Resolve-DnsName (DnsClient) | Microsoft Learn

For example, this might be all you need :

Resolve-DNSName -Name 'DomainControllerName'

Since you have 15 of them you’ll need to capture those in an array and loop through them.

$DomainControllers = 'DC1', 'DC2'
$DomainControllers | ForEach-Object {
Resolve-DNSName -Name $_
}

However, if this isn’t what you’re looking for please provide additional details.

Hi dotnVo,

Thanks very much for the information.

The particular information will be very useful, however, I need to know what the member servers DNS primary & secondary connection IP addressess are.

I am running a project where we are upgrading our DC servers. Before a DC upgrade we switch off the Server for 4 hours and wait for any issues in our server estate. If we get complaints about some applications etc no working correctly and it’s related to DNS then we can check DNS Settings of that server to establish if its pinned to the server that has been shut down.

So basically I would need to check all the member servers for the resolve-dnsname(DnsClient).

Once again thanks for taking the time out to help. Its appreciated.

Resolve-DNSName gets you the IP of a server. It now sounds like what you want is you want to see what DNS server is configured on each server in your environment. Can you confirm this? Otherwise you may need to specify what you mean by ‘pinned’. It’s best to use specific language and give us a full spectrum of details, as we don’t know anything about your environment or the terms your team uses to communicate. For example, what you’re doing has never been needed in my environment and we run a huge environment.

Also can you please answer the previous questions I asked? What have you tried so far? What code have you written? What research have you done? Do you have access remotely via winRM to all these servers? Have you looked at Get-DnsClientServerAddress (DnsClient) | Microsoft Learn?

Hi dotnVo,

Thanks very much for taking the time out and helping.

It now sounds like what you want is you want to see what DNS server is configured on each server in your environment. Can you confirm this?
A. Yes confirmation - I would like to get the Primary $ Secondary IP addressess of our Member servers.

The reason for the ask is that we have had problems with member servers when we switch one of the DC’s off to test if any of the member servers have their Primary or Secondary DNS IP Address pinned to the server that has been powered down.

Also can you please answer the previous questions I asked? What have you tried so far? What code have you written? What research have you done? Do you have access remotely via winRM to all these servers? Have you looked at Get-DnsClientServerAddress (DnsClient) | Microsoft Learn
A. I have not written any code as yet. I am pretty new to PS and thought I could ask the question on this forum so that someone could provide some guidance and help to create the script needed.

Should you require any further information please get back to me.

Regards.

Hey Peter,

Please look at the doc I provided and try to write some code to do what you want. This is a good time to mention that we’re here to help, but the expectation isn’t that we’re going to write a script for you. Sure, in some cases folks have been nice enough to write code for others, but ultimately it is your responsibility to author code for your environment. If you are simply looking for someone to write the script for you, you may want to look into sub-contracting for your organization.

In this case, I’d ask you to look at the help document I provided, and additionally look into using the Active Directory PowerShell module which can help you with gathering a list of computers to run the command against. Start authoring some code and trying out commands to see what works. The best way to learn PowerShell, is to just start writing it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.