Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

batchjob to logoff users and restart server

Status
Not open for further replies.

128meg

IS-IT--Management
Sep 25, 2003
23
SE
Im trying to wright a batch jobb that will restart our servers a night, the only thing that is left it to auto logoff users before the server restart, and maby empty recycle bin.

Does anyone know a dos command for loging of all users on ICA conections?
 
128 meg,
Here you go. It wouldn't empty out the recycle bin but it will reboot your server.
If you are running MF XP, you can simply right click on the server within CMC and make a reboot schedule.
I ran this batch file when I was running MF 1.8.
Hope that helps.

**************************************
REM * Citrix reboot file
REM * reboot this server
***************************************

REM * Disable logon so new users can't logon
change logon /disable
REM * Broadcast Server Shutdown
msg * Server will reboot in 5 minutes, please save all work and log off, you may immediately log back in and continue working.
REM * Pause first 3 minutes
C:\WINNT\wait.exe 180 seconds
REM * Broadcast Server Shutdown again
msg * Server will reboot in 2 minutes, please log off.
REM * Pause for 120 seconds
C:\WINNT\wait.exe 120 seconds
REM * Reset all ICA/TCP sessions
echo y | reset session ica-tcp
REM * Stop print spooler for 30 seconds
net stop spooler
C:\WINNT\wait.exe 30 seconds
REM * Delete all stalled print jobs and delay for 20 seconds
Del /S /F /Q C:\Winnt\system32\spool\printers\*.*
C:\WINNT\wait.exe 20 seconds
REM * Shutdown Server
C:\WINNT\system32\tsshutdn.exe 0 /reboot /delay:00
 
Oh I forgot to let you know that you will need to find the "wait.exe" executable out on the web.
It took me a while but I was able 2 find it.

thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top