Enumerates NT workstations? 
Author Message
 Enumerates NT workstations?

Brian, If you're using Perl, here's a Perl subroutine that will do the
trick.

- Andrew Sirulnik

sub get_domain_members
     {

     # Summary: Takes the name of a PDC as its argument, and returns
     # an array of domain members.

     my $dc = $_[0];
     use Win32::NetAdmin;
     unless ( $#_ == 0 ) {die 'syntax:
get_domain_members($domain_controller)'}

     Win32::NetAdmin::GroupGetMembers ("\\\\$dc","Domain

          or die "...error: GroupGetMembers($dc) failed: $!";


          {

          if ( $_ =~ s/\$$// )
               {
               # test for and skip any inter-domain trust accounts
               my ($pw, $pwa, $priv, $homedir, $comment, $flags,
$script_path) = ();
               Win32::NetAdmin::UserGetAttributes ("\\\\$dc", "$_\$",
$pw, $pwa, $priv, $homedir, $comment, $flags, $script_path);

               }
          }

     }

Quote:

> NET VIEW /DOMAIN:domainname



> > Does anybody know a command line utility which can enumerate all the NT
> > workstations from a domain and put them into a text file?

> > -Thanks

> > Michale Zhu



Fri, 25 Feb 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Calls to socket() hanging in NTPerl under NT Workstation 3.5

2. NT Members/Workstations

3. Question on using grep to retrive directory on Windows NT workstation 4.0 FAT16

4. Perl on NT workstation with PWS

5. Managing NT Workstations with PERL

6. Beep to another NT-workstation

7. Automation of NT 4.0 Workstation Installation

8. Newbie with Perl 32 on NT workstation

9. Perl binaries for Windows NT 4.0 Workstation

10. setting up perl 5 to work on windows nt workstation 4.0 with peer web services

11. Running NT perl from workstation without full install

12. Locking an NT workstation

 

 
Powered by phpBB® Forum Software