Welcome to ServerForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

WMI-> oMaster.Printers 800706BA RPC server unavailable

 
   Windows Server (Home) -> Windows Server Scripting RSS
Next:  Beta Testers for New Web Filtering Service  
Author Message
JC1010




Joined: Nov 18, 2011
Posts: 1



(Msg. 1) Posted: Fri Nov 18, 2011 11:57 am
Post subject: WMI-> oMaster.Printers 800706BA RPC server unavailable

I'm looking for a solution to quering my 4 print servers which have 1400 printers on each one.
The script works great on the initial server but when it tries to go to next server (Server02), it comes back with the RPC error. It then continues the loop and moves to the 3rd server (Server03) and captures all the printers on it, it then moves to the 4th server (Server04) and it comes back with the RPC error.

I'm not familiar with CreateObject("PrintMaster.PrintMaster.1"), therefore I'm still trying to figure out why the data capture works on some but not all print servers.

CODE
========
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set dtDateTime = CreateObject("WbemScripting.SWbemDateTime")

sYear = Year(Date-1)
sMonth = Month(Date-1)
sDay = Day(Date-1)

sLogFile = "c:\" & sYear & "-" & sMonth & "-" & sDay & "_Prt_Export.log"

Set oFile = oFSO.OpenTextFile(sLogFile, ForWriting, True, 0)
If Err.Number <> 0 Then
msgbox "File " & sLogFile & " cannot be opened",, "ERROR", vbCritical
Wscript.Quit(1)
End If

set oMaster = CreateObject("PrintMaster.PrintMaster.1")
If Err.Number <> 0 Then
oFile.writeline (vbCrLf & "* Error (PrintMaster.1):" & Hex(Err.Number) & " " & Err.Description & vbCrLf)
Err.Clear
End If
set oPrinter = CreateObject("Printer.Printer.1")
If Err.Number <> 0 Then
oFile.writeline (vbCrLf & "* Error (Set Printer.1):" & Hex(Err.Number) & " " & Err.Description & vbCrLf)
Err.Clear
End If

oFile.writeline ("Server" & vbTab & _
"PrinterName" & vbTab & _
"PortName" & vbTab & _
"Status" & vbTab & _
"Jobcount" & vbTab & _
"JobDate" & vbTab & _
"Attributes" & vbTab & _
"StartTime" & vbTab & _
"UntilTime" & vbTab & _
"Verify")

k = 0
For i=0 to UBound(ArrServer)-1
Err.Clear
Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & ArrServer(i) & "\root\cimv2")
If Err.Number <> 0 Then
oFile.writeline (vbCrLf & "* Error (Set oWMI):" & Hex(Err.Number) & " " & Err.Description & vbCrLf)
Err.Clear
End If

'############ - ERROR STARTS HERE!!

for each oPrinter in oMaster.Printers("\\" & ArrServer(i))
If Err.Number <> 0 Then
oFile.writeline (vbCrLf & "* Error (For oMaster.Printers):" & Hex(Err.Number) & " " & Err.Description & vbCrLf)
Err.Clear
Else
If k <> 0 then ReDim Preserve arrPrinter(10,UBound(arrPrinter,2) + 1)

RESULTS
============
1729 Server1 Printer01 Port01 Ready 0 N/A 64 60 60 0
* Error (For oMaster.Printers):800706BA The RPC server is unavailable.

 >> Stay informed about: WMI-> oMaster.Printers 800706BA RPC server unavailable 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Remapping Printers From One Server To Another - I've recently migrated a bunch of printer shares from one printer to another. I wrote a fairly simple script to read the existing printers and remap them to the new print server. Now, I was working off an XP laptop when I wrote this and it worked..

Delete printers for a given server - (I'm new to Windows scripting.) I'm moving several printers from a Windows 2000 server (let's call it "oldserver") to a Windows 2003 server ("newserver"). My users are not up to the arduous task of deleting the old printer and addi...

Scripting the installation or printers on a server? - Hello, I have a new Windows 2000 sp4 print server that I need to setup over 100 print queues on and would rather not have to create them by hand. Does anyone know how I could script this process? Even if I could script a portion of it, say all of the..

delete all printers jobs on startup w2k server - sorry for my english, i'm italian. my problem is on a printer that don't delete his jobs after printing.. but also when i shootdown the server and after i bootup it, the hold jobs are re-printed.. i must delete with my hands the jobs in the spool..

Adding printers to print server using script - I am working on a project to add 318 printers to a Windows 2003 Standard Edition print server. Using the Windows 2003 Resource Kit, I have retrieved the information of these printers from another print server. I have exported this into a text file and....
   Windows Server (Home) -> Windows Server Scripting All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]