简体   繁体   English

使用活动机器从目录中删除机器

[英]Deleting Machine from Catalog with Active Machines

I'm trying to delete a machine in XenDesktop from a Catalog with bunch of machines in different states via powershell. 我正在尝试通过Powershell从目录中删除XenDesktop中的计算机,其中有一堆处于不同状态的计算机。 Went through the reference list of commands http://support.citrix.com/static/kc/CTX127254/help/ , tried bunch of stuff, but couldn't find a solution. 浏览了命令参考列表http://support.citrix.com/static/kc/CTX127254/help/ ,尝试了一堆东西,但是找不到解决方案。 Is it even possible? 可能吗

I'm thinking on making a workaround by Creating a dummy catalog, placing the machine there and then deleting the whole catalog as " The Remove-BrokerCatalog cmdlet deletes catalogs from the site. A catalog containing one or more machines that are members of desktop groups cannot be deleted. " Haven't tested it yet though. 我正在考虑通过创建虚拟目录,将计算机放置在此处,然后将整个目录删除为“ Remove-BrokerCatalog cmdlet来从站点中删除目录。这是一个包含一台或多台属于桌面组成员的计算机的目录无法删除。 “尚未测试。

This is what I'm doing at the moment and the outcome is that machine is deleted from PVS and is hanging in the Catalog with only Catalog and Power State information. 这是我目前正在执行的操作,结果是计算机已从PVS中删除,并且仅包含目录和电源状态信息而挂在目录中。 Any and all ideas are welcome. 任何想法都欢迎。

# 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 

Solution is to use the same command without defining the desktopGroup, which will then delete the machine from the Catalog. 解决方案是使用相同的命令而不定义desktopGroup,这将随后从目录中删除计算机。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM