Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.
The other day I was working with a licensing issue and someone requested my MAC address to track something down. I know I could dig into the adapter properties, but that’s an annoying set of clicks in Windows. I decided to spend that time checking out how to get the MAC address from a command line.
Normal CMD
I tried “ipconfig” at the command line, which I always have open. I got my IP and DNS info, but no MAC. A quick search on Google showed me I needed more detail.
ipconfig /all
This gives me all the info, as you can see below:
PowerShell
I’d prefer PowerShell for many things like this, mostly because I could programmatically extract the values and use them elsewhere. I don’t need that here, but I might for something.
In this case, this is in the WMIObject, which is an ugly command. I’ll never remember this.
Get-WmiObject win32_networkadapterconfiguration | select description, macaddress
However, there’s an easier cmdlet.
Get-NetAdapter |select MacAddress, Name
This will return what I want. I get see which MAC is associated with which adapter.
Both quick ways to get some information.
SQLNewBlogger
I had to get some info, and I took a minute to learn something. This took me just 2-3 minutes to learn how to do this and practice. Then it was less than 10 minutes to do this post.
For reference, I used these links:
Hi Steve, the MAC address shows in ipconfig, it’s just called Physical Address, but I agree, PowerShell is the way to go!
LikeLike