我看到手动导出密钥时
(双击虚拟帐户->身份验证->公钥->导出)
我得到的密钥与使用脚本导出的密钥不同。不知道我的代码的哪一部分不正确。
$ErrorActionPreference = "Stop"
$cfg = new-object -com "BssCfg815.BssCfg815"
$result = $cfg.settings.Load()
if ($result.failure) { Write-Error $result.Describe() }
foreach ($account in $cfg.settings.access.virtAccounts.entries)
{
Write-Host "Virtual account $($account.virtAccount) "
$filename = $account.virtAccount
$cfg.keypairs.Load()
$keys = $cfg.PublicKey.GetItem(0).ExportPublicKeyToBase64String($cfg.enums.PublicKeyFormat.ssh2)
write-Host $keys
}