ip address

Welcome Forums General PowerShell Q&A ip address

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
5 years, 4 months ago.

  • Author
    Posts
  • #9783

    Participant
    Points: 0
    Rank: Member

    Hi all,

    i have 50 servers names, i need a script which has to give output of 50 servers ip addresses , if i give servers names.

    can any one help me this script.

  • #9784

    Participant
    Points: 429
    Helping Hand
    Rank: Contributor

    Have you tried anything? A quick Google search "Powershell IP Lookup" produced link: http://blogs.msdn.com/b/powershell/archive/2006/06/26/647318.aspx

    It tells you it can be done with a one-liner:

    [System.Net.Dns]::GetHostAddresses("www.msn.com")

    Using Get-Content (get names from a list) and a foreach loop will provide the data you are looking for from DNS. See if you can put the pieces together and learn.

    If you need actual adapter IP's, like if you are doing NIC teaming and need all IP's, then you will need to look at Win32_NetworkAdapter and Win32_NetworkAdapterConfiguration.

The topic ‘ip address’ is closed to new replies.