RG04B – How to set up a Maintanence Shell

By Rob Aarts

 

When scheduling maintenance jobs on workstations, you have probably faced the challenge that you want to manage software or components which can’t be installed or updated while a user is logged on. This article illustrates a good approach to this, by using RES Automation Manager to temporarily change the shell to a custom app which in turn changes the wallpaper of the target computer.

Before we proceed, let’s have a look at our options:

There is of course the (built-in) Wake-on-LAN (WOL) functionality in RES Automation Manager to start the workstations outside business hours. But there are often circumstances, in which you can’t use WOL. For example, due to network policies or perhaps the customer just isn’t happy with starting the machines while no one is around. Finally chances are that WOL just isn’t configured in the network environment (most switches do not allow magic-packets per default)

Another way is rebooting the workstation and disabling the keyboard, so the user cannot log in. But consider for a moment what would happen in case the maintenance job fails and the machine isn’t responding anymore! So…let’s not go there.

guackamoleThere is always the sneakerware approach asking all the users to log off. Have fun with that in a 500+ user environment with multiple locations. You’re likely to be playing whack-a-mole with the users the rest of the day…

My solution

As an alternative I’ve created a solution to work around this conundrum, which I would like to share. My solution replaces the current shell (usually explorer.exe or pwrstart.exe, if you’re using WM) – with a custom (maintenance) shell app. This isn’t exactly a new approach, as you can see from this MSDN article.

My shell executable quite simply displays a picture of your choice, like the one shown here on the right. You can configure the picture and other items such as resolution by using parameters in RES Automation Manager. The buildingblock below has this example picture embedded.

When the maintenance shell is activated, it provides a secret set of hotkeys you can use to bypass it, just in case something goes haywire and you need to manually override the maintenance screen. You can configure these keys to your hearts content, by using the parameters in the project. I’ts all documented fully in the buildingblock, so you’ll have to import it to learn the hotkey sequence as it would defeat the purpose to leave them online here in plain view.

The maintenance shell executable is tested under WinXP, Win7, 2008R2 and Windows 8

 For planning purposes, I would suggest that your maintenance plan should look something like this:

  • Display message about starting the maintenance task
  • Replace the current (maintenance) shell.
  • Display warning message about the planned reboot
  • Reboot
  • Do your maintenance tasks here!
  • Restore the previous shell
  • Reboot

For your convenience, here is a couple of screenshots of the buildingblock in action. It contains a RES Automation Manager Project. The screenshot on the right shows the parameters the Project needs and the one on the left gives you an overview of the modules involved:

modsparm1

 

While I was working on this article and the AM project here, I got a brand new idea which currently is being looked at by RES, I hope to be able to tell you more about that soon. If you have comments or questions to this article and/or the buildingblock, please feel free to comment below as feedback is nice.

You can download the buildingblock – click the brick here: legobrick_red

warning, yellowA word of caution: When using Wireless connections on your Clients make sure they connect to the right network automaticly without the user having to logon, you can do that by selecting the Wireless network en select “ Connect automaticly” . In some cases the Wireless connection is managed by vendor software. Check if it’s possible to configure this software to start the wireless connection at system start, If not you can use the Microsoft “ Wireless Zero Configuration”  service to manage your wireless connections.

Editor’s update Feb 11th: The sourcecode was requested for the Maint.Shell executable. It’s written in AutoIt 3, which you’ll need to download (here) in order to recompile the binary.

Click here to download the source code: au3-icon

Enjoy!

2 Comments

  • By Alex, February 11, 2013 @ 00:59

    Hi there,

    thank you for your buildingblock! As I have seen you created the shell using Autoit. Can you send me the source? Because before I start an exe in our environment I would like to check the sourcecode :)

    Greets Alex

  • By RESguru, February 11, 2013 @ 19:56

    No problem. Rob has supplied me with the sourcecode for sharing, so I’ll update the article above

Other Links to this Post

RSS feed for comments on this post.

Leave a comment

Comments are welcome as always. Just do the math below. * Time limit is exhausted. Please reload the CAPTCHA.