Jump to content
  • 0

Set Maintenance-Mode from VDA-side in StartUp-Script (PowerShell)

Donald Donovan




I want to use Citrix broker-cmdlets in a Computer StartUp-script on the VDAs.
For example I want to enable Maintenance-Mode, prepare the VDA and then disable Maintenance-Mode again.


Ofc I have installed the PowerShell-SnapIn on the VDA and I am able to use it. For example I can run the following command with my user:

Set-BrokerMachine -MachineName "domain.local\$env:COMPUTERNAME" -AdminAddress "DeliveryController.domain.local" -InMaintenanceMode $True

But when I use such a command in a Computer StartUp-script it is not working, because the script is running in context of the system-user.

The system-user may be powerful, but it does not have permissions in Citrix XenApp. I did simulate it with PSExec:



I think I am not the first one, who has such a demand.

What are the possibilities? Do you have any good ideas?


I did workaround by using Invoke-Command with New-PSSession running the command remotly on the Delivery-Controller, but this involves a lot of things and I don' like this solution.


Thank you!

Link to comment

6 answers to this question

Recommended Posts

I gathered that, but what do you need to do to "prepare" an image once it's started up? Do you have a set of tasks, scripts, software deployments etc? Are you using mcs, pvs or no provisioning?


Tools such as BIS-F can delay the start up of the citrix desktop service for a set amount of time, which delays registration - but there are also other things that may help depending on what your specifics are 

Link to comment

I am using PVS. Everything else is not relevant in this context.

As with XenApp 6.5 the part looked like this:

Change Logon /Disable

# Run relevant tasks

Change Logon /Enable


I want to get back to the request in my first post - In short:

I have the demand to run Citrix broker-cmdlets (PowerShell) in a Computer startup-script, which is running in context of system-user. (details in first post)

Link to comment


This topic is now archived and is closed to further replies.

  • Create New...