Hi folks,

After much futzing around figuring out how to install Win32::Lanman on ActiveState Perl 5.8.3, and searching in vain for usage documentation, I finally have the following "best attempt" at getting Win32::Lanman::WTSQueryConfig to work. Unfortunately, given a valid username as an argument, it still produces:

Failed to query user config info
error = 2
message = 0

I am trying to get the information from the local machine, thus I left the server name blank - but I have tried using the actual server name, and localhost, qualified hostname, etc.

The code follows.  Any ideas?

Thanks,
Lyle Kopnicky

-----------

use strict;
use Win32::Lanman;

my $userName = $ARGV[0];
my $config;

if (Win32::Lanman::WTSQueryConfig('', $userName,
 [Win32::Lanman::WTSUserConfigAll], $config)) {
   foreach (sort keys %{$config}) {
       print "$_ => $config->{$_}\n";
   }
} else {
   my $error = Win32::Lanman::GetLastError();
   my $errmsg = Win32::Lanman::FormatMessage($error);
   print "Failed to query user config info\n";
   print "error = $error\n";
   print "message = $errmsg\n";
}

_______________________________________________
Perl-Win32-Admin mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to