Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Powershell Script to output IP and MAC from Servers text file

Posted on 2014-12-31
6
Medium Priority
?
341 Views
Last Modified: 2015-01-02
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
Comment
Question by:DBThomson76
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 11

Assisted Solution

by:Sean
Sean earned 300 total points
ID: 40525370
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
 

Author Comment

by:DBThomson76
ID: 40525391
I need to be able to export the Hostname, IP Address, and MAC Address to a CSV file.
0
 

Accepted Solution

by:
DBThomson76 earned 0 total points
ID: 40525420
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

 

Author Comment

by:DBThomson76
ID: 40525614
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
 
LVL 11

Expert Comment

by:Sean
ID: 40525536
Why did you not mark my answer as correct then if your using the link that i sent to you?
0
 
LVL 11

Expert Comment

by:Sean
ID: 40525615
Used link provided to find answer but no credit given
0

Featured Post

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Requirements: root access via SSH, telnet, or other.. Alternately, access from the server administrator to run a counter-strike server, and the proper access rights to do so. Enough free disk space (and allowed to use this much, eg disk quota): 6…
New style of hardware planning for Microsoft Exchange server.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

596 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question