Not tried it, but have a look at this link from reddit recently..
PowerShell: Reset-ComputerMachinePassword [-Credential ] [-Server ]
On Tuesday, 2 June 2015, Angela <angela_smith9@xxxxxxxxxxx> wrote:
I have an issue with my Windows 2008 R2 Server with XenApp 6.5 where the
server is not joined to the domain anymore. I get the following error:
The trust relationship between this workstation and the primary domain
I also don’t know the local admin password which I require to login to the
server so I can remove and re-add to the domain.
Does anyone know how I can remove this server from the Citrix farm? I
obviously cannot login to do it the correct way using Add/Remove Programs.
I logged on to the Zone Data Collector and tried to do this via AppCenter
Server\Other Tasks\Remove from Farm
It fails with:
"The server is still online and cannot be removed from the farm. It should
be removed by the uninstall program."
Is there another way I can uninstall this Citirx software? Need to remove
it cleanly from the farm then I can format the server and start again.