0

我们经常在 Horizo​​n 服务器上的手动桌面池中添加和删除计算机。注册机器是通过安装脚本完成的。当我们用完一台机器后,我们想从服务器上注销它。我们发现这样做的唯一方法是登录门户网站并手动删除每一个。当我们有大量机器要注销时,这既麻烦又耗时。

需要取消注册的机器将具有相似的名称。有没有办法使用 PowerCLI 自动执行此操作?

4

2 回答 2

0

Not sure if you had this question answered already, but there are a couple of ways that you can do this, depending on the version of PowerCLI that you have installed. The easiest way right now is to get the latest version of PowerCLI and make sure that you install the View module along with it. From here, peruse through the View API (https://code.vmware.com/web/dp/explorer-apis?id=58)

VMware also has a helper PSM1 script in their Example gallery, which is available via github: https://github.com/vmware/PowerCLI-Example-Scripts/tree/master/Modules/VMware.Hv.Helper

于 2018-01-11T13:53:15.560 回答
0

当然可以,

$VM = Get-VM -Name nameOfVM
Remove-VM $VM

您可以在此处找到完整示例

于 2017-08-14T09:29:58.127 回答