Monitor print spooler

I need a notification that alerts my application when the print spooler is stopped/restarted.  I have an application that uses FindFirstPrinterChangeNotification/FindNextPrinterChangeNotification and this works fine for the events I need to monitor.  However if the print spooler is stopped and restarted this stops working because the notification obect is no longer valid.  I need to be able to monitor the print spooler and when it restarts I can start again with FindFirstPrinterChangeNotification.  I can't seem to find anything that will do this.  Help please.  OS is server 2003/2008
PeterC_UKDirectorAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Brad HoweConnect With a Mentor DevOps ManagerCommented:
Ok,
I would suggest requesting this moved to ASP.NET. A simple windows service that does the following.
Monitor Print Spooler.
Notify of it offline.
Restart your custom task/service.
Would be a better approach. You could also use SCOM (System Center Operations Manager) to monitor and automate but a simple windows service may be a better approach given your requirements.
Just a thought,
-Hades666
0
 
Brad HoweDevOps ManagerCommented:
what is the OS 2003 OR 2008?
You can create a triggered email event in 2008 to monitor the print spooler eventlog Event when it stops.
-Hades666
0
 
PeterC_UKDirectorAuthor Commented:
Thanks but it must work on 2003 as well and I need notification that enables my program to refresh automatically when the spooler starts

Peter
0
 
PeterC_UKDirectorAuthor Commented:
Thanks - this pushed me in the right direction.  I solved it by using a named pipe from the InitializePrintMonitor2 call in a port monitor to notify my application that the spooler had started.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.