Posted in
Virtual Machine Manager,
Windows Powershell,
Windows Server |
No Comment | 2,283 views | 19/12/2013 10:38
You can get memory reporting of your SCVMM Clouds via this script.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| $Clouds = Get-SCCloud
foreach ($Cloud in $Clouds)
{
$VMs = Get-SCCloud $Cloud | Get-VM
$VMCount = $VMs.Count
$TotalMemory = [math]::round((($VMs | Measure-Object -Sum MemoryAssignedMB).Sum / 1KB), 0)
$AvgMemory = [math]::round(($TotalMemory / $VMCount), 0)
Write-Host "Cloud: $Cloud"
Write-Host "VM Count: $VMCount"
Write-Host "Total Memory: $TotalMemory GB"
Write-Host "Avg Memory: $AvgMemory GB"
Write-Host " "
} |
$Clouds = Get-SCCloud
foreach ($Cloud in $Clouds)
{
$VMs = Get-SCCloud $Cloud | Get-VM
$VMCount = $VMs.Count
$TotalMemory = [math]::round((($VMs | Measure-Object -Sum MemoryAssignedMB).Sum / 1KB), 0)
$AvgMemory = [math]::round(($TotalMemory / $VMCount), 0)
Write-Host "Cloud: $Cloud"
Write-Host "VM Count: $VMCount"
Write-Host "Total Memory: $TotalMemory GB"
Write-Host "Avg Memory: $AvgMemory GB"
Write-Host " "
}
You will also see average memory usage of your virtual machines.