Solved

Powershell Script to output IP and MAC from Servers text file

Posted on 2014-12-31
6
274 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
  • 3
  • 3
6 Comments
 
LVL 9

Assisted Solution

by:Sean
Sean earned 100 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

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 9

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 9

Expert Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Usually shares are where we want them for our users and we tend to take them for granted. There are times, however, when those shares may disappear causing difficulty for your users. One of the first things to try is searching for files that shou…
Hyper-convergence systems have taken the IT world by storm and have quickly started to change our point of view of how the data center should and could be architected. In this article, I’ll explain the benefits of employing a hyper-converged system …
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now