Posted On July 15, 2022

PowerShell: Find Duplicate Mac Addresses of Guest VMs in Virtual Machine Manager

kimconnect 0 comments
blog.KimConnect.com >> Codes , Virtualization >> PowerShell: Find Duplicate Mac Addresses of Guest VMs in Virtual Machine Manager

Here’s a quick snippet to check whether you have any duplicate mac addresses on existing virtual machines in the cluster:

import-module virtualmachinemanager
$macAddresses=get-vm | Get-VirtualNetworkAdapter | select name,EthernetAddress

$a=$macAddresses.EthernetAddress

$b=$a | select –unique

Compare-object –referenceobject $b –differenceobject $a

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: Process Watcher – Restart Stopped Services

# processWatcher.ps1 # User Input $computername=$env:computername $serviceName='remoteregistry' $desiredStatus='Running' $action={ param($serviceName) $erroractionpreference='stop' try{ start-service $serviceName return…

Basic JavaScript: Manipulate Arrays With push()

// Setupvar myArray = [["John", 23], ["cat", 2]];// Add a dog... ezmyArray.push(["dog",3]);

PowerShell: Start-Job, Get-Job, Receive-Job Examples

Demo 1: Obtain Public IP of a Windows Machine # Commands to run locally$command1={(Invoke-WebRequest -URI…