Something like this:
use Win32::Lanman;
use strict;
my @users;
if(!Win32::Lanman::NetGroupGetUsers("\\\\server", "ciit-citrix_users",
\@users))
{
print "Sorry, something went wrong; error: ";
# get the error code
print Win32::Lanman::GetLastError();
exit 1;
}
#open(INFILE, "<c:\\data\\scripts\\cii.txt") || die "could not open input
file!";
#while (<INFILE>) {
# chomp;
foreach my $user1 (@users)
{
my $user=${$user1}{'name'};
my $PDC="\\\\server";
# my %wtsuser = ("brokentimeoutsettings" => 0,
# "fallowlogonterminalserver" => 1,
# "fdeviceclientdefaultprinter" => 1,
# "fdeviceclientdrives" => 1,
# "fdeviceclientprinters" => 1,
# "finheritinitialprogram" => 1,
# "initialprogram" => '',
# "modemcallbackphonenumber" => '',
# "modemcallbacksettings" => 0,
# "reconnectsettings" => 0,
# "shadowingsettings" => 1,
# "terminalserverhomedir" => '',
# "terminalserverhomedirdrive" => '',
# "terminalserverprofilepath" =>
"\\\\n358s-data1\\Profiles\$\\$user",
# "terminalserverremotehomedir" => 0,
# "timeoutsettingsconnections" => 0,
# "timeoutsettingsdisconnections" =>
0,
# "timeoutsettingsidle" => 0,
# "workingdirectory" => '');
my %wtsuser = ("terminalserverprofilepath" =>
"\\\\domain1\\Profiles\$\\$user",
"terminalserverhomedir" =>
"\\\\domain1\\$user\$",
"terminalserverhomedirdrive"
=> 'H:');
if(!Win32::Lanman::WTSSetUserConfig($PDC, $user, \%wtsuser))
{
print "Sorry, something went wrong; error: ";
# get the error code
print Win32::Lanman::GetLastError();
exit 1;
}
print "Set complete: $user\n";
}
-----Original Message-----
From: Harald Wopenka [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 21, 2002 9:39 AM
To: Win32-Admin Perl
Subject: Terminal Server
Hi there,
I want to change all users' TerminalServiceProfile on a Windows 2000 Server
(Userpfofilepath, Drivemap, set the checkbox to grant access). I think
someone did this before and might share a snippet... :)
TIA Harry
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs