Hi,
I am trying to capture MAC address and unable to capture just the mac address, it gives the following :
@{MacAddress=00:50:56:83:03:9X}
Have used these:
$nics_server = Get-WmiObject win32_networkadapterconfiguration | where {$_.ipEnabled -eq $True} | select MacAddress
Write-Host $nics_server
and
$nics_server = Get-WmiObject win32_networkadapter | where {$_.NetEnabled -eq $True} | select MacAddress
Write-Host $nics_server
how do i just capture "00:50:56:83:03:9X"?
Mac address capture
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Mac address capture
Get-WmiObject win32_networkadapter -filter 'NetEnabled=True' |
ForEach-Object { $_.MacAddress }
Start by studying the basics of WMI then the basics of hwo to obtain values in PowerShell. Most of this kind of quesion will become obvious.
ForEach-Object { $_.MacAddress }
Start by studying the basics of WMI then the basics of hwo to obtain values in PowerShell. Most of this kind of quesion will become obvious.