Title: RE: Creating interactive process on remote clients with WMI

truthfully a good way around this is to create the process as a scheduled job (using WMI) and make sure it is set to go off 1-2 mins ahead of the current time... we use it and from what I can tell a lot of "Microsoft Certified Partners" do the same tasks when dealing with remote installs and other processes that may require a interactive session on the remote machine... =) hope this helps

-----Original Message-----
From: Scott Campbell [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 25, 2003 6:46 AM
To: 'Jangale V-S SPEL-TIT'; [EMAIL PROTECTED]
Subject: RE: Creating interactive process on remote clients with WMI


I have tried to do this, and emailed the forum, but with no reponse.
>From all my reading of the msdn site, it appears that when creating
remote processes via WMI, they cannot be interactive, for security
reasons.  If creating a process locally via WMI, it can be interactive.
Someone may correct me if I'm wrong, but this is where I ended up.

Scott Campbell
Senior Software Developer
Somix Technologies
http://www.somix.com



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Jangale V-S SPEL-TIT
Sent: Wednesday, June 25, 2003 7:02 AM
To: '[EMAIL PROTECTED]'
Subject: Creating interactive process on remote clients with WMI


Dear All,

I am using W2K, SP3

I trying to launch a process on remote computer
using WMI. However this process need to interactive.

Following is my attempt

use Win32::OLE qw( in );
use Win32::OLE::Variant;

$Machine = "." unless( $Machine = shift @ARGV );
$Machine =~ s#^[\\/]+## if( $Machine =~ m#^[\\/]{2}# );
$CLASS = "WinMgmts:{impersonationLevel=impersonate}!//$Machine";
$WMI = Win32::OLE->GetObject( $CLASS )   || die "Unable to connect to
$Machine:" . Win32::OLE->lastError();

$PROCESSSTARTUP = $WMI->Get("Win32_ProcessStartup")->SpawnInstance_;

$PROCESSSTARTUP->{WinstationDesktop} = "winsta0\\default";
$PROCESSSTARTUP->{ShowWindow} = 1;

print "$PROCESSSTARTUP->{WinstationDesktop}\n";

$Process = $WMI->Get( "Win32_Process" )   || die "Unable to get the
process
list:" . Win32::OLE->LastError();

$vPid = Variant( VT_I4 | VT_BYREF, 0 );
$test =join( " ", @ARGV );
if( 0 == $Process->Create( join( " ", @ARGV ), undef, $PROCESSSTARTUP,
$vPid
) )
{
    print "Process successfully created with PID $vPid\n";
}
else
{
    print "Failed to create process.\n";
}


However, the process created on remote desktop is not interactive !

How can I make the process interactive ??


With Best Regards,

V.S. Jangale

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

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

Reply via email to