Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pablitocli/4746b8f6f2ea932126fdc9187f5118f2 to your computer and use it in GitHub Desktop.
Save pablitocli/4746b8f6f2ea932126fdc9187f5118f2 to your computer and use it in GitHub Desktop.
Buscavmbymac
Write-Host " BUSCADOR DE MacAddress " -foregroundcolor "black" -backgroundcolor "green"
$macaddress= Read-Host "INGRESAR LA MacAddress, CON EL SIGUIENTE FORMATO EJ: 00:50:56:a3:11:c5"
foreach ($vm in get-vm )
{
$mac= get-networkadapter -vm $vm | select macaddress
if($mac.MacAddress -eq $macaddress)
{
Write-Host " SERVIDOR <"$vm"> " -foregroundcolor "black" -backgroundcolor "YELLOW"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment