Yes, it can be done using citrix way of automation.
However, you will need to try several options to make your automation robust.
In other words it will require more testing time and fixing them to get the automation run in all possible cases.
So it is a doable task I have done as a POC.