I'd like to execute a VB script on a remote system with credentials
different from the one launching the script- currently, I've been
using SysInternal's PSEXEC to do this, but, I would rather not call an
external exe, I'd like to keep everythng within VBS. The CreateScript
method looks like what I want, but I can't figure out how impersonate
an account with this.

Can anyone tell me how or point me in the right direction on how to do
this?

Thanks!

RE: Emulate PSEXEC/RunAS with the CreateScript method? by CoreyThomasMCSEMCSAMCDBA

CoreyThomasMCSEMCSAMCDBA
Fri Mar 07 16:02:01 CST 2008

Trin,

Use the runas command to launch the vbscript. You can pass the user name
and then use the wscript.sendkeys method to send the password.

It's not a great solution because your password is now in the script, but it
will work.

-Corey Thomas
MCSE/MCSA/MCBDA

"Trin Yuthasastrakosol" wrote:

> I'd like to execute a VB script on a remote system with credentials
> different from the one launching the script- currently, I've been
> using SysInternal's PSEXEC to do this, but, I would rather not call an
> external exe, I'd like to keep everythng within VBS. The CreateScript
> method looks like what I want, but I can't figure out how impersonate
> an account with this.
>
> Can anyone tell me how or point me in the right direction on how to do
> this?
>
> Thanks!
>