semio has asked for the wisdom of the Perl Monks concerning the following question:
I recently started using the Win32::NetAdmin module to assist with routine auditing tasks. For this, I put together the following script that will collect account info on a server.
The problem is, I would like to also include the groups defined on any given server as part of the output of this script...something comparable to GetUsers, such as GetGroups perhaps. Looking through Win32::NetAdmin, it does not appear that this feature is available...I could be wrong though. Any ideas on this?#!perlenv -w use strict; use Win32::NetAdmin qw(UserGetAttributes GetUsers); my @users; my $server = $ARGV[0]; if ( $#ARGV < 0 ) { print "usage: ntinfo.pl <server IP address>"; exit; } GetUsers( $server, 0, \@users ); my ( $user, $password, $passwordAge, $privilege, $homeDir, $comment, $ +flags, $scriptPath ); foreach $user (@users) { UserGetAttributes( $server, $user, $password, $passwordAge, \$privilege, $homeDir, $comment, $flags, $scriptPath ); my $current = time(); my $days = $current - $passwordAge; print "$user:" . scalar( localtime($days) ) . ":$comment\n"; }
cheers, -semio
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using perl to collect NT groups
by LD2 (Curate) on Jan 21, 2003 at 18:00 UTC | |
by semio (Friar) on Jan 21, 2003 at 18:49 UTC | |
|
Re: using perl to collect NT groups
by Mr. Muskrat (Canon) on Jan 21, 2003 at 17:58 UTC | |
|
Re: using perl to collect NT groups
by meetraz (Hermit) on Jan 21, 2003 at 18:45 UTC | |
|
Re: using perl to collect NT groups
by primus (Scribe) on Jan 21, 2003 at 18:18 UTC |