Link to home
Start Free TrialLog in
Avatar of ndr-itsolutions
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.
Avatar of Ian Eskriett
Ian Eskriett
Flag of United Kingdom of Great Britain and Northern Ireland image

Are the two NICs bridged? if so, right click on them and unbridge them
Avatar of ndr-itsolutions
ndr-itsolutions

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
get-netipinterface -InterfaceAlias North | get-NetIPAddress | ft IPAddress
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 ?
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
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
Avatar of Mohammed Khawaja
Mohammed Khawaja
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Unfortunately, the output has carriage returns and line feeds, need to try and remove these.