I'm trying to find a *simple* way to enumerate just the workstations in my
NT domain (NT4 and W2K Pro systems only).  In Lanman and AdminMisc I seem to
be able to find servers and various flavors of them easily but not just the
workstations.  I was enumerating the domain and checking the registry but
I'd like to eliminate the 2 step process there.
 
I'm using ActivePerl build 633 and was noodling around with
Win32::Lanman::NetServerEnum which looks promising.  The keys enumerate as
follows but I can't find a reference for what the values are or what they
describe.  It looks as if the type key could be parsed for workstations, but
I'm not sure.  Any ideas?
 
     version_major=5
     comment=Bruderer #4
     platform_id=500
     type=69635
     version_minor=0
     name=URBDC06C
 
==<< Sample code >>==
use Win32::Lanman;
if(!Win32::Lanman::NetServerEnum("\\\\myPDC", "myDomain", SV_TYPE_NT,
\@info))
 {
        print "Sorry, something went wrong; error: ";
        # get the error code
        print Win32::Lanman::GetLastError();
        exit 1;
 }
 foreach $server (@info)
 {
        @keys = keys %$server;
        foreach $key(@keys)
        {
                print "$key=${$server}{$key}\n";
        }
 }
................................................................

Regards

Glenn Deans

"It's not what you look at that matters,
it's what you see."
Henry David Thoreau
American Essayist and Poet

Reply via email to