Hi All,
I have trawled the archives for 2 days looking for the answer to this
problem.
I want to add a global group into the Administrators Local group on a list
of servers.
I am attaching to each server with a variety of admin accounts hence the
ConnectIPC subroutine.
The Win32::Lanman::GetLastError function always returns a 2226 error;
pretty much regardless of what combination of ' or " or backslashes I use to
send me variables to the Win32::Lanman::NetLocalGroupAddMembers function, I
even get the same code using the similar NetAdmin and Win32API functions
which I have commented out.
what im I doing wrong?
Can anyone tell what this 2226 error is?
or where I can find out what it means?
any other tips warmly received, im pretty new to this perl malarkey..
many thanks.
Conal.
foreach my $server (keys %server_hash)
{
my $item=0;
my $authd = 0;
while (@domain)
{
$item++;
Log2 ("attempting logon to $server as
$domain[$item]\\$user[$item] : ");
$authd = ConnectIPC($server, $userpass[$item],
$user[$item], $domain[$item]);
if ($authd == 1) # Null Session
successfull
{
Log("Successful\n");
if
(Win32::Lanman::NetLocalGroupAddMembers("\\\\$server", "Administrators",
['CMEU\Domain Admins']))
## if
(Win32API::Net::LocalGroupAddMembers("\\\\$server", "Administrators",
['CMEU\Domain Admins']))
## cusrmgr.exe -m \\remotecomputer -alg
localgroup -u globalgroup
## if
(Win32::NetAdmin::LocalGroupAddUsers("\\\\$server", "Administrators",
['CMEU\Domain Admins']))
{
Log ("Successfully added CMEU\Domain Admins
to $group on $server");
}
else
{
Log ("group add
failed:".Win32::Lanman::GetLastError());
Log
(Win32::FormatMessage(Win32::GetLastError()));
}
Disconnect($server);
}
else { Log("Failed\n"); }
last if ($authd ==1);
}
if ($authd==0)
{
Log("unable to access server")
}
}
}
"This email and any files transmitted with it are confidential and are intended solely
for the use of the individual or entity to whom they are addressed. This communication
represents the originator's personal views and opinions, which do not necessarily
reflect those of CP Ships. If you are not the intended recipient or the person
responsible for delivering the email to the intended recipient, be advised that you
have received this email in error, and that any use, dissemination, forward, printing,
or copying of this email is strictly prohibited. If you received this email in error,
please immediately notify the CP Ships Help Desk on +44 (0) 1293 582800"
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs