Files
Zack Meier 1d304511b8 update
2026-04-15 15:45:50 -05:00

40 lines
1.0 KiB
PowerShell

<#
.Synopsis
Retreives list of all VMs, and lists their corresponding vSphere Replication RPO settings, if applicable.
.DESCRIPTION
Long description
.EXAMPLE
Get-ITDVMwareRPO
#>
function Get-ITDVMwareVMRPO {
[CmdletBinding()]
Param
(
)
Begin {
}
Process {
$VMs = Get-VM -Name itddohslimsp2.nd.gov | Where-Object PowerState -EQ PoweredOn
$result = @()
ForEach ($VM in $VMs) {
Write-Verbose $VM.Name
$RPOMinutes = ($VM.ExtensionData.Config.extraconfig | Where-Object key -EQ hbr_filter.rpo).Value
$DatastoreTag = ($VM | Get-TagAssignment -Category "VR Datastores").Tag.Name
$Cluster = ($VM | Get-Cluster).Name
$obj = [PSCustomObject]@{
'Name' = $VM.Name;
'Cluster' = $Cluster;
'Datastore' = $DatastoreTag;
'RPO' = $RPOMinutes;
}
Write-Warning $obj
$result += $obj
}
}
End {
Write-Output $result
}
}