正在从具有活动计算机的目录中删除计算机



我正试图通过powershell从目录中删除XenDesktop中的一台机器,目录中有一堆处于不同状态的机器。浏览命令的参考列表http://support.citrix.com/static/kc/CTX127254/help/,尝试了很多东西,但找不到解决方案。这可能吗?

我正在考虑制定一个解决方案,创建一个虚拟目录,将计算机放在那里,然后删除整个目录,因为"Remove-BrokerCatalog cmdlet从站点删除目录。包含一个或多个桌面组成员计算机的目录无法删除。"但尚未测试。

这就是我目前正在做的事情,结果是机器从PVS中删除,并挂在目录中,只有目录和电源状态信息。欢迎任何想法。

# Remove user from the machine
Remove-BrokerUser $userDomain""$userName -Machine $simpleDomain""$server
# Remove Device from Domain
Mcli-Run RemoveDeviceFromDomain -p deviceName=$server, OrganizationUnit=$ou, Domain=$domain
# Remove Device from Desktop group
Remove-BrokerMachine -MachineName $simpledomain""$server -Force -DesktopGroup $desktopGroupName -AdminAddress $dccName
# Mark Device as Down in PVS
Mcli-Run MarkDown -p deviceMac=$mdevice
# Delete Device from PVS
mcli-delete device -p deviceMac=$mdevice 

解决方案是在不定义桌面组的情况下使用相同的命令,然后桌面组将从目录中删除机器。

# Remove Device from the Catalog
Remove-BrokerMachine -MachineName $simpledomain""$server -Force -AdminAddress $dccName

最新更新