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

Using Python to Automate Video Playing on Ubuntu

This little snippet was generated using ChatGPT with more than a little bit of prompting…

PowerShell: Play with Time

1. Constructor: $timer=[System.Diagnostics.Stopwatch]::StartNew() 2. Accessing a property $totalSeconds=$timer.Elapsed.TotalSeconds 3. Output Time (Usage): $hours=[math]::round($totalSeconds/3600,2)write-host "It has…

PowerShell: Unlimit RDP Sessions

$tsRegHive='REGISTRY::HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server' Set-ItemProperty -Path $tsRegHive -Name fSingleSessionPerUser -value 0 Set-ItemProperty -Path $tsRegHive -Name fdenyTSConnections -value…