Share via

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 for business | Windows Server | User experience | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    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.

    Was this answer helpful?

    0 comments No comments

Your answer

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