This crashes on line 329 in an Azure ARM environment. >>$Deployment=G
et-AzureDeploym ent -ServiceName $CloudServiceNa me -ErrorAction Stop As far as I can see there is no ARM equivalent of the Get-AzureDeploy ment cmdlet. Does anyone have an alternative? Cheers!
Blair, Have you tried get-azurermreso
urcegroupdeploy ment? I think that's the cmdlet
It appears based on many of the comments that these scripts were written for the ASM sutf. I'm unclear if Clark is still with Microsoft or "maintaining" these scripts, has anyone updated this to ARM?
I have the same issue as Marcus, I tested this script tonight and it left the last server standing in drain mode. Good thing I checked or there would have been trouble in the morning. Ideally, it would put servers in drain mode based on who has the fewest connections as another poster suggested until the MinimumNumberOf
RDSH is reached, but not put the last server in drain mode! Anybody figure out how to fix that yet?
As a temporary measure I just disabled putting servers in drain mode by changing line 603 from <-NewConnection
Allowed NotUntilReboot> to <-NewConnection Allowed Yes> Set-RDSessionHo st -SessionHost $sessionHost.Se ssionHost -NewConnectionA llowed Yes -ConnectionBrok er $ConnectionBrok erFQDN -ErrorAction Stop I'd still love to hear if anybody was able to address that issue :-)
A little more intelligence would be good when shutting down servers in off-peak periods i.e. leave servers running that have the most "active" sessions. At the moment it is quite intrusive as we shut down servers that may have active sessions and leave servers running that have none !
We have a cluster of 6 nodes and it takes about 20 minutes to shut down them due to the log off wait time incurred as each one is processed Would be useful if all servers were processed together, i.e. put all servers into drain mode together, send them all a warning about shutdown, wait for specified period then shut down. At the moment, the user gets disconnected so waits 2 minutes (they are told to do this) logs in again only to find that server starts shutting down too. The end-user gets frustrated therefore can we do something more scalable? Thanks
Hello, Been running this script and have a potential issue. It seems that the script sets all session hosts servers to drain until after reboot. This means that for the servers that don't shut down over night new connections aren't ever allowed. I've had a good look through the script and can't see where they are re-enabled or any servers are excluded from being drained. Thanks, Marcus
Hello Marcus We too get something odd happening on occasion. It seems from the logs that it does the following:- 1) Puts the server into drain mode 2) Inform users to log off 3) Log users off 4) check if there are no users logged in and then shutdown server 5) shut down and decrement running servers by 1 6) repeat The problem is with step 4 (line 681) if for any reason all users are not logged off then the server remains in drain mode but the number of running servers does not decrement by one therefore continues to shut all the servers down leaving the gateway with no servers left to service requests! I am going to remove the check and force the server to shutdown anyhow i.e. comment lines 681, 682 and 711