5 thoughts on “Get DNS Settings From Remote Servers

  • But very grateful to you Sir. Just incase someone wants to copy, I'll save you the trouble:

    ===
    CLS

    $Servers = Import-Csv -Path "D:PowershellServerList.csv"

    foreach($Server in $Servers)
    {
    if($Servers.Selected -eq "x")
    {
    Write-Host " "
    Write-Host $Server.Name
    $Networks = Get-WmiObject Win32_NetworkAdapterConfiguration -Computer $Server.Name | ? {$_.IPEnabled}

    foreach ($Network in $Networks)
    {
    Write-Host " DNS:" $Netowrk.DNSServerSearchOrder
    Write-Host " IP:" $Network.IpAddress[0]
    Write-Host " Subnet:" $Network.Subnet[0]
    Write-Host " Gateway:" $Network.DefaultIPGateway
    Write-Host " DHCP Enabled:" $network.DHCPEnabled
    Write-Host ""
    }

    }

    }
    ===

  • The NIC command was never explained…. that would have been great instead of just going over that

Comments are closed.