Automate turning drain mode back to off after certain time period

%3CLINGO-SUB%20id%3D%22lingo-sub-3294732%22%20slang%3D%22en-US%22%3EAutomate%20turning%20drain%20mode%20back%20to%20off%20after%20certain%20time%20period%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3294732%22%20slang%3D%22en-US%22%3E%3CP%3EDoes%20anyone%20know%20of%20a%20way%20to%20automate%20azure%20to%20turn%20drain%20mode%20off%20on%20AVD's%20after%20either%20a%20certain%20time%20period%20or%20at%20the%20same%20time%20each%20day.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3296037%22%20slang%3D%22en-US%22%3ERe%3A%20Automate%20turning%20drain%20mode%20back%20to%20off%20after%20certain%20time%20period%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3296037%22%20slang%3D%22en-US%22%3EHi%20Johan%2C%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20pretty%20much%20what%20i%20ended%20up%20doing%2C%20works%20a%20treat%20set%20to%2030%20run%20every%2030%20mins%2C%20Thanks%20for%20the%20response%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3295973%22%20slang%3D%22en-US%22%3ERe%3A%20Automate%20turning%20drain%20mode%20back%20to%20off%20after%20certain%20time%20period%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3295973%22%20slang%3D%22en-US%22%3Ethere%20is%20a%20powershell%20command%20for%20this%20so%20you%20could%20create%20a%20logic%20app%20with%20the%20powershell%20code%20and%20let%20in%20run%20at%20certain%20moments.%3CBR%20%2F%3EHere%20is%20the%20link%20to%20the%20powershell%20code%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-desktop%2Fdrain-mode%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-desktop%2Fdrain-mode%3C%2FA%3E%3C%2FLINGO-BODY%3E
Contributor

Does anyone know of a way to automate azure to turn drain mode off on AVD's after either a certain time period or at the same time each day.

2 Replies
there is a powershell command for this so you could create a logic app with the powershell code and let in run at certain moments.
Here is the link to the powershell code
https://docs.microsoft.com/en-us/azure/virtual-desktop/drain-mode
Hi Johan,

This pretty much what i ended up doing, works a treat set to 30 run every 30 mins, Thanks for the response