Vmware Tpm Encryption Recovery Key Backup -

$hosts = Get-VMHost foreach ($esxiHost in $hosts) try Out-File -FilePath $keyFile Write-Host "Backed up host: $($esxiHost.name)" -ForegroundColor Green

$report = @() $report += "# TPM Recovery Key Backup Report - $(Get-Date)" $report += "# vCenter: $vCenterServer" $report += " n## Encrypted VMs:" $encryptedVMs | ForEach-Object $report += "- $($_.name)" $report += " n## Hosts with TPM:" $hosts | Where-Object $ .TpmPresent -eq $true | ForEach-Object $report += "- $($ .name)" vmware tpm encryption recovery key backup

catch Write-Host "Failed: $($vm.name) - $ " -ForegroundColor Red $hosts = Get-VMHost foreach ($esxiHost in $hosts) try