{"id":116,"date":"2009-02-05T07:40:00","date_gmt":"2009-02-05T14:40:00","guid":{"rendered":"http:\/\/www.jasemccarty.com\/blog\/2009\/02\/citrix-workflow-studio-does-it-add-capabilities-that-we-didnt-have-before.html"},"modified":"2009-02-05T07:40:00","modified_gmt":"2009-02-05T14:40:00","slug":"citrix-workflow-studio-does-it-add-capabilities-that-we-didnt-have-before","status":"publish","type":"post","link":"https:\/\/www.jasemccarty.com\/blog\/citrix-workflow-studio-does-it-add-capabilities-that-we-didnt-have-before\/","title":{"rendered":"Citrix Workflow Studio &#8211; Does it add capabilities that we didn&#8217;t have before?"},"content":{"rendered":"<p>I ran across an article about how to use Citrix Workflow Studio to alert when the print spooler service crashes.<\/p>\n<p>You can find that article here:<br \/>http:\/\/support.citrix.com\/article\/ctx119979<\/p>\n<p>Kind of interesting&#8230; I know that it isn&#8217;t a &#8220;new&#8221; type of process&#8230; But do you need the Workflow Studio to do this?  Absolutely not.<\/p>\n<p>I wrote a script about 3 years ago, that let&#8217;s me know when print spoolers crash, and then can restart the spooler.  Here is a sample (not the code I&#8217;m using, but similar)<\/p>\n<pre>'********************************<br \/>'* Citrix Printer Warning Script<br \/>'* printwarn.vbs<br \/>'* 'simple version'<br \/>'* 2\/5\/2009<br \/>'********************************<br \/><br \/>'Setup the normal VBS Wscript Stuff<br \/>Set WshNetwork = WScript.CreateObject(\"WScript.Network\")<br \/>Set WshShell = Wscript.CreateObject(\"Wscript.Shell\")<br \/><br \/>'Grab the ComputerName<br \/>strComputerName = WshNetwork.ComputerName<br \/><br \/><br \/>'Setup the Commands<br \/>strStopCmd = \"net stop spooler\"<br \/>strStartCmd = \"net start spooler\"<br \/><br \/>'Stop the Spooler<br \/>Set objExec = wshshell.Exec(strStopCmd)<br \/><br \/>'Start the Spooler<br \/>Set objExec = wshshell.Exec(strStartCmd)<br \/><br \/><br \/>'Setup the mail<br \/>Set objMessage = CreateObject(\"CDO.Message\")<br \/>objMessage.From = \"from@domain.com\"<br \/>objMessage.To = \"to@domain.com\"<br \/>objMessage.Subject = strComputername _<br \/>&amp; \" has a print spooler service issue\"<br \/>objMessage.Textbody = strComputername _<br \/>&amp; \" has a print spooler service issue\"<br \/><br \/>'We are talking to a remote SMTP server<br \/>objMessage.Configuration.Fields.Item _<br \/>(\"http:\/\/schemas.microsoft.com\/cdo\/configuration\/sendusing\") = 2<br \/><br \/>'Name or IP of Remote SMTP Server<br \/>objMessage.Configuration.Fields.Item _<br \/>(\"http:\/\/schemas.microsoft.com\/cdo\/configuration\/smtpserver\") = _<br \/>&amp; \"mail.domain.com\"<br \/><br \/>'Server port (typically 25)<br \/>objMessage.Configuration.Fields.Item _<br \/>(\"http:\/\/schemas.microsoft.com\/cdo\/configuration\/smtpserverport\") = 25<br \/><br \/>objMessage.Configuration.Fields.Update<br \/><br \/>'==End remote SMTP server configuration section==<br \/><br \/>objMessage.Send<br \/><\/pre>\n<p>Now what do I need to do to have this fire off?<\/p>\n<p>I made a batch file called &#8220;citrixprintwarning.bat&#8221;, and put it somewhere on my C: drive.  This is the file that will execute the vbs.<\/p>\n<p>Here are the simple contents:<br \/>c:printerwarn.vbs<\/p>\n<p>Now I set the Windows Print Spooler Service Recovery options to run the batch file in the event of a failure.<\/p>\n<p><a onblur=\"try {parent.deselectBloggerImageGracefully();} catch(e) {}\" href=\"http:\/\/www.jasemccarty.com\/blog\/uploaded_images\/printwarn-745069.jpg\"><img decoding=\"async\" style=\"margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 183px; height: 200px;\" src=\"http:\/\/www.jasemccarty.com\/blog\/uploaded_images\/printwarn-745052.jpg\" alt=\"\" border=\"0\" \/><\/a><br \/>When things fail, I get an e-mail, and the service gets restarted.<\/p>\n<p>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.<\/p>\n<p>And I didn&#8217;t have to get the Citrix Workflow Studio to do it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-116","post","type-post","status-publish","format-standard","hentry","category-citrix"],"_links":{"self":[{"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/comments?post=116"}],"version-history":[{"count":0,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/posts\/116\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/media?parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/categories?post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jasemccarty.com\/blog\/wp-json\/wp\/v2\/tags?post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}