| Unstable applications can cause an unstable environment. Rebooting the system helps the operating system from becoming unstable. This allows the system to recover from applications leaking memory and other system resources. I also like to take the opportunity to do some proactive maintenance to the server. i.e., clean hung print jobs out of the spooler folder and if you are using Microsoft Access as the IMA data store can take this time to backup the data store and copy it to a remote file store that is backed up on a daily basis. The following procedures describe how to create and schedule the recycling of your MetaFrame servers. 1. Create a folder off the root of C: called REBOOT. 2. Open Notepad and enter the following script and save it as shutdown.cmd | change logon /disable msg * Please log off and save your work. The server is going down in 5 mins. sleep.exe 5 net stop spooler sleep.exe 30 del c:\WINNT\System32\spool\PRINTERS\*.* /q REM ** unremark the next three lines if you are using Microsoft Access as the IMA data store. REM net stop independent management console REM sleep.exe 30 REM copy C:\Program Files\Citrix\Independent Management Architecture\mf20.bak \\backupserver\share sleep.exe 30 tsshutdn.exe /REBOOT | The SHUTDOWN.CMD script will do the following: Disable any additional users from logging on Sends a message to all currently logged on users to notifying them the server will be rebooted in 5 minutes. Stops for 5 seconds Stops the Spooler server Waits 30 seconds for the spooler service to stop Deletes any print jobs in the print spooler directory NOTE: You might need to change this file path in case you changed the default spool directory as recommended in the Tweak Windows 2000 / MetaFrame XP section of this document. If you are using Microsoft Access as the IMA data store then you will want to take this opportunity to backup the database and copy it to a remote file server for disaster recovery. o Stops the IMA service o Waits 30 seconds for the data store to stop. You might need to tweak this time to make sure you give enough time for the service to be stopped. o Copy the IMA database (mf20.bak) to a remote file server. Sends a message to all logged in users notifying them the server will be shutdown in 1 minute Sends a message to all logged in users notifying them the server will be shutdown in 30 seconds Logs off all logged in users Schedule nightly server reboots. You will want to stagger servers reboots in at least 15 minute intervals. Note: TSSHUTDOWN.EXE is supplied natively with Microsoft Windows 2000. You can download the above script and sleep.exe from http://www.dabcc.com/projectinabox/RebootScript.zip Important! If is important to stagger the reboot time on each MetaFrame server. I recommend 15 minute intervals and to recycle the MetaFrame XP Data Collector server first. 3. Click on the Start button Settings Control Panel double click on the Scheduled Tasks icon double click on the Add Scheduled Task icon.  4. Click Next  5. Click Browse  6. Browse to the reboot folder you created in step 1 and select shutdown.cmd and click Open  7. Enter a name for the task and select how often you would like the task to run and click Next.  8. Select the time and day you want the server to be rebooted and click Next. Note: As stated above you will want to stagger server reboots. This is very important!  9. Enter a username and password that has access to reboot the MetaFrame server and click Next.  10. Click Finish.  You have now successfully scheduled the server to automatically reboot. |