第一步:
arp -a 192.168.20.17
image.png
第二步:到得00-15-5d-c7-32-57 我每次都是手动去掉中间的”-“杠,去找主机名
Get-VMNetworkAdapter -all | Where-object {$_.macaddress.Contains((“00155dc73257”).ToUpper())} | Select VMname,MacAddress
注:查询当前服务器上所以机器对应的mac地址
Get-VMNetworkAdapter -all | Select VMname,MacAddress
Get-VMNetworkAdapter -all | Where-object {$_.macaddress.Contains(("00155d80e41b").ToUpper())} | Select VMname,MacAddress,VMId | ConvertTo-Json
网友评论