N
Ninja67
Thanks to Thomas Kratz on a previous post, I was able to take the code
he posted and get it to work with just a couple of small modifications.
Here is the code below:
#!C:/Perl/bin/perl.exe
use strict;
use warnings;
use Win32::OLE qw/in/;
Win32::OLE->Option(Warn => 1);
my($domain, $user) = split(/\\/,$ENV{'REMOTE_USER'});
my $path = "WinNT://$domain/$user";
print "Content-type:text/html\n\n";
print "domain=$domain<br />\nuser=$user<br />\npath=$path<br />\n";
my $o_user = Win32::OLE->GetObject($path) or die Win32::LastErr();
print "<br />\nGroup Memberships:<br />\n";
foreach my $group ( in($o_user->Groups()) ) {
print $group->Name, "<br />\n";
}
For test reasons, I'm just printing the results of the Groups() method
to the browser.
I have searched Google and the Perl docs and can not find a list of
methods other than Groups() that are available. Can someone point me
in the right direction? I am trying to see what other information I
can glean from the Win32::OLE->GetObject($path) method such as the
user's full name, etc.
Thanks.
he posted and get it to work with just a couple of small modifications.
Here is the code below:
#!C:/Perl/bin/perl.exe
use strict;
use warnings;
use Win32::OLE qw/in/;
Win32::OLE->Option(Warn => 1);
my($domain, $user) = split(/\\/,$ENV{'REMOTE_USER'});
my $path = "WinNT://$domain/$user";
print "Content-type:text/html\n\n";
print "domain=$domain<br />\nuser=$user<br />\npath=$path<br />\n";
my $o_user = Win32::OLE->GetObject($path) or die Win32::LastErr();
print "<br />\nGroup Memberships:<br />\n";
foreach my $group ( in($o_user->Groups()) ) {
print $group->Name, "<br />\n";
}
For test reasons, I'm just printing the results of the Groups() method
to the browser.
I have searched Google and the Perl docs and can not find a list of
methods other than Groups() that are available. Can someone point me
in the right direction? I am trying to see what other information I
can glean from the Win32::OLE->GetObject($path) method such as the
user's full name, etc.
Thanks.