Good Job!

Looks like we started this one about the same time.

This is mine. I have to be able to login to WMI on some workstations.

code:
Function RemoteRun ($RemoteCommand, Optional $RemoteStartDir, Optional $ComputerName, Optional $AdminName, Optional $AdminPassword, Optional $NameSpace)
Global $RemoteProcessPid
If Not $ComputerName Or $ComputerName = ''
$ComputerName = @Wksta
EndIf
If $NameSpace = ''
$NameSpace = 'root\cimv2'
EndIf
$SystemLocator = CreateObject ('WbemScripting.SWbemLocator')
$SystemSet = $SystemLocator.ConnectServer($ComputerName, $NameSpace, $AdminName, $AdminPassword)
If @Error <> 0
$WMIQuery = ''
Exit @Error
EndIf
$SystemSet.Security_.ImpersonationLevel = 3
$ObjProcesses = $SystemSet.Get('Win32_Process')
$ObjProcessIns = $ObjProcesses.Methods_('Create').InParameters.SpawnInstance_
$ObjProcessIns.CommandLine = $RemoteCommand
If $RemoteStartDir And $RemoteStartDir <> ''
$ObjProcessIns.CurrentDirectory = $RemoteStartDir
EndIf
$ObjProcessOut = $SystemSet.ExecMethod('Win32_Process', 'Create', $ObjProcessIns)
If @Error = 0
$RemoteProcessPid = $ObjProcessOut.processid
Else
$RemoteProcessPid = ''
EndIf
Exit $ObjProcessOut.returnvalue
EndFunction

Have you tried finding out who the owner of the process is (GetOwner)? I have not been able to get the use and domain from it. It just returns zero.

Thanks
_________________________
Kelly