• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
ControlUp Community

ControlUp Community

Connect, Learn, and Grow

  • Blog
  • Podcast
  • Meetups
  • Archives
  • Categories
    • ControlUp One Platform
    • ControlUp for Apps
    • ControlUp for Compliance
    • ControlUp for Desktops
    • ControlUp Scripts & Triggers
    • ControlUp Synthetic Monitoring
    • ControlUp for VDI
  • Topics
  • Events
    • Logos & Wallpaper
    • ControlUp.com
  • Join

Troubleshooting a Script to Disable Maintenance Mode in Cloud-Managed Citrix DaaS

Posted on November 7, 2022

A user had troubles with a script for taking a machine out of maintenance mode in cloud-managed Citrix DaaS. It was suggested to check the parameters and to compare the script for enabling maintenance mode. The issue was solved by installing the Citrix SDK, saving credentials to a secureclient.csv file, and including the Set-XDCredentials command in the Disable script. It was recommended to update the scripts for the Cloud environment.


Read the entire ‘Troubleshooting a Script to Disable Maintenance Mode in Cloud-Managed Citrix DaaS’ thread below:

Anyone have a working script to take a machine out of maintenance mode that works in solve for cloud managed citrix Daas? I have one working for “enable” mm but having trouble getting the “disable” to work properly


I don’t have a script lying around, but what is the nature of the problem?


says it cant find the machine


all i did was edit the one I had to Enable MMthis one works.Odd, would not know top of my head what the reason is. I compared the Enable and Disable scripts we have, the only difference is literally the -InMaintenanceMode $true vs $false and the text for the output.

As a double check, try the original Disable XenDesktop Maintenance Mode script, just in case?

These scripts have been around a long time, it seems the command Get-BrokerSharedDesktop is deprecated: https://developer-docs.citrix.com/projects/citrix-virtual-apps-desktops-sdk/en/latest/Broker/Get-BrokerSharedDesktop/

That does not explain why it would work for Enabling maintenance mode but not for Disabling it though.


yeah i had to change it to BrokerPrivateDesktop


maybe i need to change it to BrokerDesktop.THere is still this line that uses a deprecated command as well though:

$TargetMachine = Get-BrokerSharedDesktop "*\$machineName"

Line 21.

SHouldn’t that be Get-BrokerPrivateDesktop as well then?


but yeah all i did was change $true to $false.


I have not looked at these commands for a long time, but if it is VDI I suspect you may need Get-BrokerPrivateDesktop instead of shared, just from the name.

It could be a quirk that Get-BrokerSharedDesktop works for a machine that is not in maintenance but not for a machine IN maintenance.


Are you erroring out on line 21: Unable to determine desktop status – possibly insufficient administrative privileges

Or does it happen later, and what is the exact error message?


yes which is so odd because it works in the

enable" script. Let me check my parameters in controluphere is enable


Yeah, looks fine.


AHA!


There is no argument specified for the Disable script. That would casue the problme!man its nice to have someone to bounce stuff off of. thank you sirIt’s a tad later here, got my logic the wrong way around 🙂

Yes, the machine is not found at all. That is why it gets to line 40.

Removing the old comments. Not because I’m hiding I messed up, but I don’t want to confuse anybody else coming across this thread and not reading the conclusion.

Whoops?

😁


Glad to help Chris, even if I got my logic backwards at first.so for anyone interested here’s the Disable Maintenance Mode for cloud-managed CVAD. I got it to work by installing the Citrix SDK on the ControlUp broker machines and console machines. I saved my credential information to login in the file secureclient.csv


You’d obviously have to change this line with your information and have the .CSV file on each server that may run the script (ControlUp console servers, or monitors if you want to make it an automated action) : Set-XDCredentials -CustomerId [ENTER YOUR ID] -SecureClientFile "[ENTER YOUR PATH]\secureclient.csv" -ProfileType CloudApi -StoreAs "CloudAdmin"I had to include the Set-XDCredentials in the script because for some reason the Get-XDCredentials stopped working after a while. So I just set it and get it each time the script runs. Kinda dumb. It should work just pointing to the Profile NameThe original versions of these scripts were not written with Cloud in mind

I will ask @member to take a look at these two scripts to bring them up to date. He wrote the https://www.controlup.com/script-library-posts/manipulate-citrix-virtual-apps-and-desktops-tags/ script as well, that also can put machines in and out of maintenance.

Continue reading and comment on the thread ‘Troubleshooting a Script to Disable Maintenance Mode in Cloud-Managed Citrix DaaS’.  Not a member? Join Here!


Categories: All Archives, ControlUp Scripts & Triggers
Topics: Citrix, Cloud Computing, ControlUp Solve, Credentials, DaaS, Scripts, VDI

Ask Us Anything, Connect, Learn, and Grow with the ControlUp Community!

Login to the ControlUp Community to ask us anything, stay up-to-date on what’s new and coming soon and meet other like-minded techies like you.

Not already a member? Join Today!

Primary Sidebar

ControlUp Academy

Enroll in ControlUp Academy for expert-led technical training, equipping you with skills to effectively deploy, manage, and grow your ControlUp investment.

Learn here >

Rotating Images

Hidden Gem from our Community on Slack!

ControlUp Betas - What's Coming Next?
NEW ControlUp Features - Stay Up-to-Date!
ControlUp Scripts - Scripting, Zero to Hero
Latest KB Articles - Be the First to Learn
Did you Know - with Sivan Kroitoru
Practical Perspectives Technical Use Case Training

Video Tutorials Library

Visit our technical how-to videos, offering step-by-step tutorials on advanced features, troubleshooting, and best practices.

Watch here >

ControlUp Blog

Check out the ControlUp blog for expert advice and in-depth analysis.

Read here >

ControlUp Script Library

Visit the ControlUp technical script library, which offers a multitude of pre-built scripts and custom actions for your monitoring and troubleshooting requirements.

See here >

ControlUp Support

Visit the ControlUp support home and to delve deeper into ControlUp solutions.

Browse here >

Download ControlUp RealTime DX

Start with ControlUp for real-time end-user environment insights, swift troubleshooting, and unprecedented performance optimization. Download now.

Download here >

Footer

      

ControlUp Community
Of Techie, By Techie, For Techie!

Terms of Use | Privacy Policy | Security
Dive Deeper, Learn more at ControlUp.com

  • facebook
  • twitter
  • youtube
  • linkedin

© 2023–2025 ControlUp Technologies LTD, All Rights Reserved.

We use cookies to ensure that we give you the best experience on our website. by continuing to use this site you agree to our Cookie policy..