I let this sit for awhile before deciding to finish it, from what I can see it works perfect for our environment. function Get-Updates ($VMHost) { $VMMServer = Get-VMMServer "SCVMM IP Adress" $SCOMServer = "SCOM Server FQDN" New-PSDrive -Name:Monitoring -PSProvider:OperationsManagerMonitoring -Root:\ | Out-Null New-ManagementGroupConnection -ConnectionString:$SCOMServer | Out-Null Set-Location "Monitoring:\$SCOMServer" function StartMaintenance { $SCOMAgent = [...]
Lately a couple of our Cluster Shared Volumes have been hitting a high percentage of usage, to alleviate any issues, I wanted a simple way to find out which VMs had the largest disk usage on those volumes. I chose to query volumes that were over 70% usage and the top 5 storage hogging VMs from those. [...]
I changed this around in my last script to verify the operational status of a host via SCVMM instead of the Hyper-V server itself. function CheckHostStatus { $HostState = Get-VMHost $VMHost if (($HostState.ComputerState -match "Responding") -and ($HostState.ClusterNodeStatus -match "Running") -and ($HostState.VirtualServerState -match "Running") -and ($HostState.VirtualServerStateString -match "Running") -and ($HostState.CommunicationStateString -match "Responding") -and ($HostState.CommunicationState -match "Responding")) [...]
I’m now in charge of roughly 30 Hyper-V servers, half in an HA cluster, and the rest are standalone. Rather than doing updating each server manually I decided to take it upon myself to automate it via PowerShell. In my environment, we use SCVMM and SCOM, so doing this is rather easy, we also have [...]