> I have written before on this and now I am in pressing need to know
where I am going wrong with this code.
> Can anyone give me any ideas?
Unfortunately, the only "help" I can give you is tell you that you're
not alone here...
I've both Dave Roth's books and tried setting the privileges said to be
required, however it didn't improve the end result a single bit...
As you can see from below, I've added all 4 required attributes (even
though I'm a member of the Domain Admins), and still got the same
"incorrect function". Maybe Dave Roth will want to shed some light on
this? I'm running Windows XP.
[d:\work]"Admin Handbook Examples\chapter2\priv.pl" FMADRUGA
>From the book 'Win32 Perl Scripting: The Administrator's Handbook' by
Dave Roth
DOMAIN\FMADRUGA:
SE_ASSIGNPRIMARYTOKEN_NAME Replace a process level token
SE_INCREASE_QUOTA_NAME Adjust memory quotas for a process
SE_TCB_NAME Act as part of the operating system
SE_CHANGE_NOTIFY_NAME Bypass traverse checking
[d:\work]Teste.pl
Successfully logged on as USER.
Failed.
Error: Incorrect function.
[d:\work]type Teste.pl
use Win32::AdminMisc;
use Win32;
$Domain = 'DOMAIN';
$User = 'USER';
$Password = 'test';
$Process = 'NOTEPAD.EXE';
if (Win32::AdminMisc::LogonAsUser($Domain, $User, $Password,
LOGON32_LOGON_INTERACTIVE)){
$LogonUser = Win32::AdminMisc::GetLogonName();
print "Successfully logged on as $LogonUser.\n";
$Result = Win32::AdminMisc::CreateProcessAsUser( $Process );
if ($Result){
print "Successful! The new PID is $Result.\n";
} else {
print "Failed.\n\tError: " .
Win32::FormatMessage(Win32::AdminMisc::GetError()) . "\n";
}
} else {
print "Failed to logon.\n\tError: " .
Win32::FormatMessage(Win32::AdminMisc::GetError()) . "\n";
}
Yours truly,
Fernando Madruga
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs