Add a new VIProperty: KMSserver for VM
As Mike suggested, add a new VI Property to retrieve the KMSserver ClusterId for encrypted VMs.
This commit is contained in:
@@ -59,6 +59,13 @@ New-VIProperty -Name Locked -ObjectType VirtualMachine -Value {
|
|||||||
($vm.extensiondata.Runtime.ConnectionState -eq "invalid") -and ($vm.extensiondata.Config.KeyId)
|
($vm.extensiondata.Runtime.ConnectionState -eq "invalid") -and ($vm.extensiondata.Config.KeyId)
|
||||||
} -BasedOnExtensionProperty 'Runtime.ConnectionState','Config.KeyId' -Force | Out-Null
|
} -BasedOnExtensionProperty 'Runtime.ConnectionState','Config.KeyId' -Force | Out-Null
|
||||||
|
|
||||||
|
New-VIProperty -Name KMSserver -ObjectType VirtualMachine -Value {
|
||||||
|
Param ($VM)
|
||||||
|
if ($VM.Encrypted) {
|
||||||
|
$VM.EncryptionKeyId.ProviderId.Id
|
||||||
|
}
|
||||||
|
} -BasedOnExtensionProperty 'Config.KeyId' -Force | Out-Null
|
||||||
|
|
||||||
New-VIProperty -Name Encrypted -ObjectType HardDisk -Value {
|
New-VIProperty -Name Encrypted -ObjectType HardDisk -Value {
|
||||||
Param ($hardDisk)
|
Param ($hardDisk)
|
||||||
$hardDisk.ExtensionData.Backing.KeyId -ne $null
|
$hardDisk.ExtensionData.Backing.KeyId -ne $null
|
||||||
|
|||||||
Reference in New Issue
Block a user