ndr-itsolutions
asked on
Retrieving IP Address
I have server's with two NIC's installed, I need to retrieve just the bare ip address of the one labelled NORTH (Interface Alias).
I also need this code to work on PS 2.0 upwards.
Thanks in advance for any ideas or code to this.
I also need this code to work on PS 2.0 upwards.
Thanks in advance for any ideas or code to this.
Are the two NICs bridged? if so, right click on them and unbridge them
ASKER
No, they are not bridged. I'm looking for a piece of code to get the IP address of the NIC that is labelled 'NORTH'.
Thanks
Thanks
get-netipinterface -InterfaceAlias North | get-NetIPAddress | ft IPAddress
ASKER
Thanks
The output gives me the following:
IPAddress
---------------
10.10.0.1
I want to write the ip address to a text file, so I just want 10.10.0.1, any idea how I can parse this ?
The output gives me the following:
IPAddress
---------------
10.10.0.1
I want to write the ip address to a text file, so I just want 10.10.0.1, any idea how I can parse this ?
Refer to the link below which shows you how you could run it remotely as well as log output to file:
https://www.petri.com/manage-network-adapters-powershell-addressing-configuration-info
https://www.petri.com/manage-network-adapters-powershell-addressing-configuration-info
ASKER
Thanks, but that does not solve my issue, I need the results parsed to show only the ip address and not the table.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Unfortunately, the output has carriage returns and line feeds, need to try and remove these.
ASKER
This looks like the answer, but thanks for your help
http://blogs.technet.com/b/gary/archive/2009/07/24/simple-text-parse-with-powershell-using-ipconfig-exe.aspx
http://blogs.technet.com/b/gary/archive/2009/07/24/simple-text-parse-with-powershell-using-ipconfig-exe.aspx