December 22, 2024

Citrix Workflow Studio – Does it add capabilities that we didn’t have before?

I ran across an article about how to use Citrix Workflow Studio to alert when the print spooler service crashes.

You can find that article here:
http://support.citrix.com/article/ctx119979

Kind of interesting… I know that it isn’t a “new” type of process… But do you need the Workflow Studio to do this? Absolutely not.

I wrote a script about 3 years ago, that let’s me know when print spoolers crash, and then can restart the spooler. Here is a sample (not the code I’m using, but similar)

'********************************
'* Citrix Printer Warning Script
'* printwarn.vbs
'* 'simple version'
'* 2/5/2009
'********************************

'Setup the normal VBS Wscript Stuff
Set WshNetwork = WScript.CreateObject("WScript.Network")
Set WshShell = Wscript.CreateObject("Wscript.Shell")

'Grab the ComputerName
strComputerName = WshNetwork.ComputerName


'Setup the Commands
strStopCmd = "net stop spooler"
strStartCmd = "net start spooler"

'Stop the Spooler
Set objExec = wshshell.Exec(strStopCmd)

'Start the Spooler
Set objExec = wshshell.Exec(strStartCmd)


'Setup the mail
Set objMessage = CreateObject("CDO.Message")
objMessage.From = "from@domain.com"
objMessage.To = "to@domain.com"
objMessage.Subject = strComputername _
& " has a print spooler service issue"
objMessage.Textbody = strComputername _
& " has a print spooler service issue"

'We are talking to a remote SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
& "mail.domain.com"

'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objMessage.Configuration.Fields.Update

'==End remote SMTP server configuration section==

objMessage.Send

Now what do I need to do to have this fire off?

I made a batch file called “citrixprintwarning.bat”, and put it somewhere on my C: drive. This is the file that will execute the vbs.

Here are the simple contents:
c:printerwarn.vbs

Now I set the Windows Print Spooler Service Recovery options to run the batch file in the event of a failure.


When things fail, I get an e-mail, and the service gets restarted.

I actually got a little fancy with my prod script. I pull a list of users on the system, so I can try to track down whether I have a user that is constantly causing issues or not.

And I didn’t have to get the Citrix Workflow Studio to do it.