Heres my sample code for retrieving a list of users on a WinNT Server or Workstation. Please keep in mind that
this is only a code example, and while it does work on my site, there is no warranty implied, nor do I endorse this code as being fit for merchantability for any purpose.
USE THIS CODE AT YOUR OWN RISK!
get_users.pl
#!perl -w
# amonotod
# 15 Oct 1999
# drive_space.pl, for use on WinNT Servers
# Partly mine, partly by others...
# Thank you to the others!
use Win32::NetAdmin;
&get_all_users;
exit;
sub get_all_users{
if (Win32::NetAdmin::GetUsers('', UF_PRIV_ADMIN,\@users)) {
print "<html>\n<body>\n";
#print "@users <br>";
Win32::NetAdmin::GetDomainController($server, $domain, $returnedName);
#print "server is $server, domain is $domain, and name is $returnedName<br>",$CRLF;
&display_current_users;
}
else {
print "could not get list of users";
}