[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 356
  • Last Modified:

Powershell Script to output IP and MAC from Servers text file

I need to come up with a script that can output just the IP Address and MAC address of each server to a CSV file.

I have a file that lists all my server hostnames. ex. C:\Scripts\AllServers.txt

Can someone help me with a powershell script that would do this.

TIA!
0
DBThomson76
Asked:
DBThomson76
  • 3
  • 3
2 Solutions
 
SeanSystem EngineerCommented:
http://techibee.com/powershell/powershell-get-ip-address-subnet-gateway-dns-serves-and-mac-address-details-of-remote-computer/1367

This looks like what you want and a little more. But if you only want IP and MAC address you could use a tool called NetScan. All you need to do is put in a range of IP addresses and it will find all computers that respond and give you the MAC address

https://www.softperfect.com/products/networkscanner/
0
 
DBThomson76Author Commented:
I need to be able to export the Hostname, IP Address, and MAC Address to a CSV file.
0
 
DBThomson76Author Commented:
I was able to get it to provide the information that I needed by using the following command.

Get-IPDetails.PS1 -ComputerName (get-content c:\temp\servers.txt) | export-csv c:\temp\Name_IP_MAC_output.csv -notypeinformation

Thanks for your help!
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
DBThomson76Author Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for DBThomson76's comment #a40525420

for the following reason:

After getting the Get-IPDetails.pl1 powershell script and combining it with the rest of the command line it work as expected.
0
 
SeanSystem EngineerCommented:
Why did you not mark my answer as correct then if your using the link that i sent to you?
0
 
SeanSystem EngineerCommented:
Used link provided to find answer but no credit given
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now