ip address

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Rob Simmers Rob Simmers 3 years, 10 months ago.

  • Author
    Posts
  • #9783
    Profile photo of yogi gollapudi
    yogi gollapudi
    Participant

    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
    Profile photo of Rob Simmers
    Rob Simmers
    Participant

    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.

You must be logged in to reply to this topic.