Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...just the few hours I've spent on this site I have learned a lot. I can now implement features that will be very useful to my company, and some of those I never knew existed..."

Geography

Where in the world do Tek-Tips members come from?
timbath (IS/IT--Management)
18 May 09 13:10
I have two terminal servers running Windows 2000 Advanced Server, one in application mode and the other in admin mode. Recently the print spooler has started to stop unexpectedly, more often on the application server (this serves 25+ users). Rather than wait for my users to complain that there are no printers available to them and then restart the spooler manually can anyone help me with a way I could get an e-mail alert that the service had stopped or, even better, get it to restart automatically?

Any help would be very much appreciated.

Thanks
North323 (TechnicalUser)
18 May 09 13:19
im sure you can write a script or batch file to check the status and try restart
TechyMcSe2k (TechnicalUser)
18 May 09 19:26
in the properties of the print spooler services, does it have options you can set upon failure to restart and then 3rd try can run a script.

_______________________________________
Great knowledge can be obtained by mastering the Google algorithm.

timbath (IS/IT--Management)
19 May 09 4:19
Thanks TechyMcSe2K. Have set to restart service three times. That should sort it as I use shutdown to restart every night.
Seaspray0 (TechnicalUser)
22 May 09 17:41
Open the performance monitor and create some alerts on performance object "print queue".  Then you can set the action to run a script that sends emails, send a network message, as well as log it into the event log.

Start, Help.  You'll be surprised what's there.  A+/MCP/MCSE/MCDBA

markdmac (MIS)
26 May 09 17:48
Is the spooler actually stopping?  Or is it hanging?

I have seen this many times before and it is usually due to a bad print driver.  The problem though is that the spooler usually hangs and does not actually shut down.

I hope you find this post helpful.  

Regards,

Mark

Check out my scripting solutions at http://www.thespidersparlor.com/vbscript

Work SMARTER not HARDER.  The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier!  Save time, get more work done, get the Admin Script Pack.

timbath (IS/IT--Management)
27 May 09 4:26
Thanks markdmac

I think it may just be stopping as there is nothing in the event log.
markdmac (MIS)
27 May 09 9:30
An alternative that carries a little risk is to give the TS users a web page that allows them to restart the Spooler service if it is hung.  Then problem here is that it can result in data loss.  People with print jobs that were stuck will need to resend.

CODE

<%@ Language=VBScript %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%
'==========================================================================
'
' NAME: RestartSpooler.asp
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL   : http://www.thespidersparlor.com    
' COPYRIGHT (C) 2009 All rights reserved
' DATE  : 11/24/2006
'
' COMMENT: Restarts the spooler service
'
'
'    THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
'    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
'    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
'    PARTICULAR PURPOSE.
'
'    IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
'    BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
'    DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
'    WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
'    ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
'    OF THIS CODE OR INFORMATION.
'==========================================================================
Sub Window_Onload
    TableArea.InnerHTML = GetServices    
End Sub
Function GetServices
    Dim objWMIService, objItem, objService, strServiceList
    Dim colListOfServices, strComputer, strService, ServiceArea
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colListOfServices = objWMIService.ExecQuery("Select * from Win32_Service Where Name='spooler'")
    For Each objService in colListOfServices
        startButton = "<input class='button' type='button' value='Start' name='start_button' onClick='ModifyService " & Chr(34)& objService.name & Chr(34)&","& Chr(34)& "start" & Chr(34)&"'>"
        stopButton = "<input class='button' type='button' value='Stop' name='stop_button' onClick='ModifyService " & Chr(34) &  objService.name & Chr(34)&","& Chr(34)& "stop" & Chr(34)&"'>"
        ServiceArea = ServiceArea & "<tr><td>" & objService.name & "</td><td>"& objService.state &"</td><td>"& stopButton & "</td><td>"& startButton & "</td></tr>"
    Next
    GetServices = "<table border =1 bgcolor=white><th>Service Name</th><th>Service State</th><th colspan=2>Action</th>"& ServiceArea & "</table>"
End Function
Function ModifyService(strService, action)
    Dim objService
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
    Set colServices = objWMIService.ExecQuery ("Select * from Win32_Service Where Name ='"& strService & "'")
    For Each objService in colServices
        If action = "start" Then
            objService.StartService()
        Else
            objService.StopService()
        End If
    Next
    Location.Reload(True)
End Function

%>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Enumerating Services</title>
</head>

<body><h1>
<strong>Spooler Management</strong></h1>
<span id=TableArea>Connecting To Services, Please Wait</span>
</body>

</html>

I hope you find this post helpful.  

Regards,

Mark

Check out my scripting solutions at http://www.thespidersparlor.com/vbscript

Work SMARTER not HARDER.  The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier!  Save time, get more work done, get the Admin Script Pack.

timbath (IS/IT--Management)
11 Jul 09 10:22
Seems the spooler is hanging, not stopping. When looking at printers they have all disappeared. Then looking at services the spooler appears to be started, can be stopped but then not started again. Reboot sorts it.
markdmac (MIS)
11 Jul 09 12:40
I used to see that on Windows 2000 often.  Has been fixed in 2003.  You should budget for an upgrade to 2003 before you can't buy 2003 anymore.  Also consider that there is no longer support for 2000 so you are not getting security updates like you should.

I hope you find this post helpful.  

Regards,

Mark

Check out my scripting solutions at http://www.thespidersparlor.com/vbscript

Work SMARTER not HARDER.  The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier!  Save time, get more work done, get the Admin Script Pack.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close