Lab 37 Checking the Status of a Print Server
In this lab, you will check the status of a print server, and if the server is not OK, you will cancel all print jobs on the box. This script is based on the FilterPrinterStatus.vbs script, so you use a starter file.
Lab Instructions
Open Notepad.exe.
Open the Lab37Starter.vbs file, and save it as Lab37Solution.vbs.
Delete the entire subEvalstatus subroutine from the bottom of the script. This subroutine looks like the following:
Sub subEvalStatus Select Case objItem.PrinterStatus Case 1 strStatus = "Other" Case 2 strStatus = "Unknown" Case 3 strStatus = "Idle" Case 4 strStatus = "Printing" Case 5 strStatus = "Warmup" Case 6 strStatus = "Stopped Printing" Case 7 strStatus = "Offline" End Select End sub
Get Microsoft® Windows® Scripting Self-Paced Learning Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.