We help IT Professionals succeed at work.
Get Started

Reboot script for Citrix server warn users first

jpletcher1
jpletcher1 asked
on
1,515 Views
Last Modified: 2012-05-12
We have Presentation Server 4.5, but not the edition where I can schedule reboots ( I assume because I don't have a Resource Manager).  I'd like to schedule reboots of the server weekly.  I see there are a couple options, shutdown.exe and tsshutdn.exe.  Are either of these better to use if I want to notify end users ahead of time before the reboot?  Say 15 minutes?  I know you can use comments with the shutdown.exe command.  I'd also like to disable logins when the 15 minutes starts or even before that.  I see there is a command to do this as well from the Windows TS side, but not sure if that translates through to Citrix.  

Here is an example of something I found and I'm not sure if it will work or not for my scenario.

change logon /disable
logevent -S W -C 7311 -e 3603 "AUTOMATED SERVER REBOOT IN 12 MINS"
msg * Please log off and save your work. Automated Scheduled Reboot. The Citrix server is going down in 12 mins.
sleep.exe 300
msg * Please log off and save your work. Automated Scheduled Reboot. The Citrix server is going down in 7 mins.
sleep.exe 240
msg * Please log off and save your work. Automated Scheduled Reboot. The Citrix server is going down in 3 mins.
sleep.exe 60
net stop lpdsvc
net stop spooler
sleep.exe 120
del c:\WINNT\System32\spool\PRINTERS\*.* /q
change logon /enable
tsshutdn 30 /DELAY:0 /REBOOT
Comment
Watch Question
Lead Technical Architect
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE