Contents

PowerShell script to Enable and Disable Maintenance Mode XenApp 7.6

Website Visitors:
Contents

Checkout the script to enable and disable maintenance mode on xenapp 7.6 environment.

Script:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11

Function Global:Enable-MaintenanceMode([string]$servername) {
Add-PSSnapin citrix*
$name = (Get-BrokerSharedDesktop -HostedMachineName $servername).MachineName
set-BrokerSharedDesktop $name -InMaintenanceMode $true
}
Function Global:Disable-MaintenanceMode([string]$servername) {
Add-PSSnapin citrix*
$name = (Get-BrokerSharedDesktop -HostedMachineName $servername).MachineName
set-BrokerSharedDesktop $name -InMaintenanceMode $false
}

Usage:

Enable-MaintenanceMode -servername SERVER

Disable-MaintenanceMode -servername SERVER

Want to learn more on Citrix Automations and solutions???

Subscribe to get our latest content by email.

If you like our content, please support us by sponsoring on GitHub below: