Hi ALL,

I need to start a proces on a remote computer like in the sample below
(starts "Calc.exe"). However, I am clueless on how to provide alternate
credentials for that. How can I pass the proper user/password?

Thanks in advance!

strComputer = "."
strExe = "Calc.exe"
' Connect to WMI
set objWMIService = getobject("winmgmts://"& strComputer & "/root/cimv2")

' Obtain the Win32_Process class of object.
Set objProcess = objWMIService.Get("Win32_Process")
Set objProgram = objProcess.Methods_( _
"Create").InParameters.SpawnInstance_
objProgram.CommandLine = strExe

Re: Exec with Alternate Credentials - How? by W

W
Tue Apr 11 18:36:05 CDT 2006

Save yourself some time and effort.... Go to
http://www.sysinternals.com/FileAndDiskUtilities.html and download PSTOOLS.
Among the PSTOOLS you will find PSEXEC.EXE. Run PSEXEC from a command
prompt and all the parameters are explained. Freeware. Execellent set of
tools that I use all the time, especially PSLIST and PSKILL.

--


----------------------------------------------------
This mailbox protected from junk email by MailFrontier Desktop
from MailFrontier, Inc. http://info.mailfrontier.com

"Geraldo Rosado" <GeraldoRosado@discussions.microsoft.com> wrote in message
news:E2CFB2AA-803A-4704-991A-0E4A4F4E6170@microsoft.com...
> Hi ALL,
>
> I need to start a proces on a remote computer like in the sample below
> (starts "Calc.exe"). However, I am clueless on how to provide alternate
> credentials for that. How can I pass the proper user/password?
>
> Thanks in advance!
>
> strComputer = "."
> strExe = "Calc.exe"
> ' Connect to WMI
> set objWMIService = getobject("winmgmts://"& strComputer & "/root/cimv2")
>
> ' Obtain the Win32_Process class of object.
> Set objProcess = objWMIService.Get("Win32_Process")
> Set objProgram = objProcess.Methods_( _
> "Create").InParameters.SpawnInstance_
> objProgram.CommandLine = strExe