Check out PortMon from SysInternals. While not a perl answer, it can do remote queries of machines.
Dig a bit on their site. They have all kinds of interesting little bits of information about Win32 systems ...
UPDATE: should one choose to write a module for this, a reference is Printing and Print Spooler Functions from http://msdn.microsoft.com.
UPDATE: I think I found the Win32::OLE lib and properies for this ... check out oleprn 1.0 Type Library in your Win32::OLE::Browser, asphelp and PrtSum.
HTH
--
idnopheq
Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.
| [reply] |
It's funny that you should ask this. I'm currently working on a Perl program that will allow somone to administer printers. When done, it will work for NT and Novell without having to install the driver or map to the printer.
What I'm using (and what you're going to want to look at) is ADSI. Specifically, look at this page. Scroll down till you see IADsPrintQueue and IADsPrintQueueOperations. You'll use Win32::OLE to access these.
Let me know if you need an example and I'll throw one together.
Hope this helps..
Rich | [reply] |
ASDI seems like a nice option. However, that means upgrading my domain to Active Directory (to be able to access the API), which I don't really trust. I know Microsoft has done a lot to AD since the launch of WinNT 5, but it's not something I want to bet my car and college on. I'd be a little more interested in a Win32::API(EnumPrinters()) call (I just got a chance to look at the MSDN Printer reference that was pointed out). This would be a much nicer thing to do (albeit possibly slower) since it would be backwards compatible (I have a thing for backwards compatibility). Maybe I'm just being harsh on Active Directory, but oh well. Thanks for the lead though. It's definitely worth a shot.
Necos
secon_kun@hotmail.com
| [reply] |
!/usr/bin/perl -w
use strict;
use Win32::OLE qw/in/;
#fill in domain and server
my $domain = '';
my $server = '';
my $printer;
my $objServer = Win32::OLE->GetObject("WinNT://$domain/$server");
$objServer->{FILTER} = ["printqueue"];
foreach $printer (in $objServer) {
print "$printer->{NAME}\n";
}
Hope this helps..
Rich | [reply] [d/l] |
When i see windows interaction and 'hack together', i think Win32::API. The module will load a DLL file, and let you use functions from it (but you need to know the functions and arguments). I am not sure the DLL, but that would be my first guess..
can't sleep clowns will eat me
-- MZSanford
| [reply] |