Printer Problem how can i transfer the queue to the second printer

5 pts.
Tags:
Printer management
Printers
I am using two printers. This time 50 commands in queue, at the same time this printer getting some problem and unable to Print. The question is " how can i transfer the queue to the second printer" Both printers are installed on print server

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hello,
you can do this with Visual Basic Scripting with the following code:

<pre>

Set objWMIService = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2″)
Set colPrintJobs = objWMIService.ExecQuery(“Select * from Win32_PrintJob”)
For Each objPrintJob in colPrintJobs
intTotalJobs = intTotalJobs + 1
Next
If intTotalJobs > 50 Then
Call MoveQueue
End If

Sub MoveQueue
Set objWMIService = GetObject(“winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2″)
Set objPrinter = objWMIService.Get(“Win32_Printer.DeviceID=’ArtDepartmentPrinter’”)
objPrinter.PortName = “IP_192.168.1.10″
objPrinter.Put
End Sub
</pre>

The initial part checks the printer queues (you can limit the search by adjusting the query to meet you printer name) and counts the total jobs, if it is > than 50 it calls the subroutine that moves the jobs to “<i>ArtDepartmentPrinter</i>” queue.

I Hope this helps.

P.S. I suggest you downloading <a href=”http://www.microsoft.com/downloads/details.aspx?FamilyID=B4CB2678-DAFB-4E30-B2DA-B8814FE2DA5A”>TechNet Script Center Sample Scripts</a>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following