Not tried it, but have a look at this link from reddit recently..
http://implbits.com/active-directory/2012/04/13/dont-rejoin-to-fix.html
PowerShell: Reset-ComputerMachinePassword [-Credential ] [-Server ]
Andrew
On Tuesday, 2 June 2015, Angela <angela_smith9@xxxxxxxxxxx> wrote:
Hi
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
failed
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
via:
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.
Thanks
Ang