How to identify which systems are using a specific DNS IP

Muhammad Hussain 201 Reputation points
2021-07-27T04:46:24.037+00:00

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
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,100 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ian Xue 37,106 Reputation points Microsoft Vendor
    2021-07-27T06:25:34.677+00:00

    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.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.