Update VMware.VMEncryption.psm1
This commit is contained in:
committed by
GitHub
parent
13649b8e35
commit
29719d6ca7
@@ -81,6 +81,13 @@ New-VIProperty -Name Encrypted -ObjectType HardDisk -Value {
|
|||||||
$hardDisk.ExtensionData.Backing.KeyId -ne $null
|
$hardDisk.ExtensionData.Backing.KeyId -ne $null
|
||||||
} -BasedOnExtensionProperty 'Backing.KeyId' -Force | Out-Null
|
} -BasedOnExtensionProperty 'Backing.KeyId' -Force | Out-Null
|
||||||
|
|
||||||
|
New-VIProperty -Name KMSserver -ObjectType VMHost -Value {
|
||||||
|
Param ($VMHost)
|
||||||
|
if ($VMHost.CryptoSafe) {
|
||||||
|
$VMHost.ExtensionData.Runtime.CryptoKeyId.ProviderId.Id
|
||||||
|
}
|
||||||
|
} -BasedOnExtensionProperty 'Runtime.CryptoKeyId.ProviderId.Id' -Force | Out-Null
|
||||||
|
|
||||||
New-VIProperty -Name EncryptionKeyId -ObjectType HardDisk -Value {
|
New-VIProperty -Name EncryptionKeyId -ObjectType HardDisk -Value {
|
||||||
Param ($Disk)
|
Param ($Disk)
|
||||||
if ($Disk.Encrypted) {
|
if ($Disk.Encrypted) {
|
||||||
@@ -976,7 +983,7 @@ Function Set-VMDiskEncryptionKey {
|
|||||||
C:\PS>$KMSCluster = Get-KMSCluster | select -last 1
|
C:\PS>$KMSCluster = Get-KMSCluster | select -last 1
|
||||||
C:\PS>$VM = Get-VM -Name win2012
|
C:\PS>$VM = Get-VM -Name win2012
|
||||||
C:\PS>$HardDisk = get-vm $vm|Get-HardDisk
|
C:\PS>$HardDisk = get-vm $vm|Get-HardDisk
|
||||||
C:\PS>$HardDisk|$Set-VMEncryptionKey -VM $VM -KMSClusterId $KMSCluster.Id -Deep
|
C:\PS>$HardDisk|Set-VMDiskEncryptionKey -VM $VM -KMSClusterId $KMSCluster.Id -Deep
|
||||||
|
|
||||||
Deep rekeys all the disks of the $VM using a new key.
|
Deep rekeys all the disks of the $VM using a new key.
|
||||||
The key is generated from the KMS whose clusterId is $KMSCluster.Id.
|
The key is generated from the KMS whose clusterId is $KMSCluster.Id.
|
||||||
@@ -1681,7 +1688,7 @@ Function Get-KMServerStatus {
|
|||||||
[String] $KMSClusterId
|
[String] $KMSClusterId
|
||||||
)
|
)
|
||||||
|
|
||||||
Begin {
|
Begin {
|
||||||
# Confirm the connected VIServer is vCenter Server
|
# Confirm the connected VIServer is vCenter Server
|
||||||
ConfirmIsVCenter
|
ConfirmIsVCenter
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user