Well, me again...  I thought all was well, but alas it's not, or at least 
it's interesting anyway.

I've got my domains and trusts all straight this time at least, and am 
operating under the proper privileges...  It seems when I entered this from 
the command line, I got this:

$ perl -e 'use Win32::Lanman; $h = {}; Win32::Lanman::WTSQueryUserConfig( "\\\\
LABBOX", "testdude", [Win32::Lanman::WTSUserConfigAll()], $h ); foreach (sort k
eys %{$h}) { print "$_: $h->{$_}\n" }'
brokentimeoutsettings: 0
fallowlogonterminalserver: 1
fdeviceclientdefaultprinter: 1
fdeviceclientdrives: 1
fdeviceclientprinters: 1
finheritinitialprogram: 1
initialprogram:
modemcallbackphonenumber:
modemcallbacksettings: 0
reconnectsettings: 0
shadowingsettings: 1
terminalserverhomedir: \\dude\here
terminalserverhomedirdrive: E:
terminalserverprofilepath: \\server\profile\path
terminalserverremotehomedir: 1
timeoutsettingsconnections: 0
timeoutsettingsdisconnections: 0
timeoutsettingsidle: 0
workingdirectory: c:\working\directory

Cool.  No problems there.  When I enter this from the command line, I get 
"Did it" as a success:

$ perl -e 'use Win32::Lanman; $h = { terminalserverprofilepath => "\\\\server\\
profiles\\olivec", terminalserverhomedirdrive => "X:", terminalserverhomedir =>
  "\\path\\to\\use", terminalserverremotehomedir => 1 }; $rv = 
Win32::Lanman::WT
SSetUserConfig( "\\\\LAB01BDC", "olivec", $h ); unless ($rv) { print "Error $rv
\n" } else { print "Did it\n" }'
Did it

Seems fine.  BUT....  The Terminal Services Local Directory has 
"\path\to\use" in it, and not "Connect [X:](dropdown) [\path\to\use](form 
field fillin)" as one would expect when inspecting the ADS User Admin CP.

Then, when I run this script, I get an Error 1:

===
#!/usr/bin/perl -w

use strict;
use Win32::Lanman;

my $server   = shift || Error( "Need server name" );
my $username = shift || Error( "Need username" );

my $h = {
    terminalserverhomedir       => "\\\\server\\path",
    terminalserverhomedirdrive  => "x:",
    terminalserverprofilepath   => "\\\\server\\profiles\\path",
    terminalserverremotehomedir => 1,
};

unless (my $rv = Win32::Lanman::WTSSetUserConfig( "\\\\$server", $username, 
$h )) {
    print qq{Set TS settings on $server for $username\n};
} else {
    print STDERR qq{Error ($rv) setting TS settings on $server for 
$username\n};
}

sub Error { foreach (@_) { print STDERR qq{$_\n} } exit }
===

Executed as: $ testtssetup.pl LABBOX testdude
Printed result is: "Error (1) setting TS setting on LABBOX for testdude"

So, I'm getting partial success, but that only from the command line, which 
isn't what I need, and not all of that.  Don't know if anyone sees anything 
obvious, but I don't.  If someone has a sample outside of what is included 
in the Win32::Lanman documentation I'd love to see it.  Gotta get this to 
work.  Unless there is another module that does the same thing?  Lanman 
works great for so many things though, it's gotta be something I'm missing.

Chris
-----
Chris Olive
[EMAIL PROTECTED]

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

Reply via email to