question

MHussainArif-5163 avatar image
0 Votes"
MHussainArif-5163 asked IanXue-MSFT answered

How to identify which systems are using a specific DNS IP

We have a DNS server on win server 2008 and want to discontinue it but this is a very old server that's why too many servers are still using this server. Please suggest the way/script to identify which domain-joined systems/network cards still using that DNS IP.

I've tried many websites and scripts but nothing worked for me. Need your expert opinion,

windows-server
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT answered

Hi,

Please try the below PowerShell script. I assume you have enabled WinRM on the remote computers.

 $address = "xxx.xxx.xxx.xxx"
 $file = "C:\temp\interfaces.csv"
 Get-ADComputer -Filter *  | ForEach-Object {
     Invoke-Command -ComputerName $_.Name -ScriptBlock {Get-DnsClientServerAddress} | ForEach-Object {
         if ($address -in $_.ServerAddresses) {
             $_ | Select-Object InterfaceAlias,PSComputerName
         }
     }
 } | Export-Csv -NoTypeInformation -Path $file

Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.