Greetings
I am writting a script that will add jobs to computers scheduler via the Win32::AdminMisc::scheduleadd function. However, I noticed all the jobs would terminate with security errors eventhough the Domain Admin was doing this.
Somebody suggested the I needed to impersonate an id to get the jobs to load correctly.
I have been playing with the function, I made the 3 rights changes that are required but it does not seem to work. Here is the snippet:
use Win32::AdminMisc; use warnings; my $domain = Win32::DomainName(); my $userid = "test"; my $pass = "junk01id"; my $id = Win32::AdminMisc::LogonAsUser( $domain, $userid, $pass); if ( $id ) { my $currentid = Win32::AdminMisc::GetLogonName(); print "Successfully, impersonating $currentid \n"; Win32::AdminMisc::LogoffAsUser; } else { print "Failed Logon\n"; print "Win32::FormatMessage( Win32::GetLastError() ); }
The output always says Failed Logon. Now this is running on a W2K server. I am wondering if you can impersonate on a server? Or with a domain account?
Any ideas? Thanks in advance
In reply to Win32::AdminMisc::LogonAsUser does not seem to work. by Marza
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |