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] |
Hmmm... This is really interesting. As much as I praise the Windows 2000 workstation edition, I'm still new to the Win2k (Active Directory, etc.) scheme of things. Personally, I find it very unstable. However, since you're using Win32::OLE to get the server information, there could be some pretty code down the line. I'd still like to use Win32::API (since it's backwards compatible with 95/98, which some of our workstations still run) to write a module (since one hasn't been written, or, at least, none of us know about it). I'm assuming that the code you're writting will be closed source. I've always been a personal fan of OSS and if I do get an opportunity to write a GOOD module for Win32 printer monitoring, I'd definitely be releasing the code under GPL (and if you do make your code closed, I hope it sells well, cause it's awful clever of you to use ASDI, something which is completely foreign to me). One thing that I wanted to ask however, which DLL contains the printer and spooling functions that are described in SDK? Microsoft says its in the SDK, but I'm pretty sure the DLL has to be local since the Spooler service can monitor the ports.
Necos
secon_kun@hotmail.com
| [reply] |