!/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] |
As far as the functions idnopheq recomended, if you click on the function link it will tell you at the bottom which lib it's in. I looked at a couple and they were in either winspool or gdi32. You'll have to check each specific function to see where it resides.
As far as what I'm working on, it's nothing I'm planning on selling. It's going to be basically for me and whoever else wants to use it. I'll probably post it here if and when it's complete.
And regarding AD itself.. it's a much needed improvement over the flat NT domain structure. A Directory Serivce is something that has been noticably lacking. Though I'll agree that there's a lot I consider to be done poorly. AD it's on that list though. There's a whole lot of uglyness in permissions now. They not only give you enough rope to hang yourself, they have already knotted it for you. If you get a chance to set up some servers.. read up on the horrible situation you have with RRAS and permissions. It's not pretty.
obPerl: If you're going to write a module to do this I'd be interested in seeing it. I'm sure there's quite a few others who would benifit from it also..
Rich
| [reply] |