Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

run a function within a script with different credentials

35 views
Skip to first unread message

RG

unread,
Dec 18, 2009, 6:46:01 PM12/18/09
to
I have a powershell script that is launching a process on a remote machine.
I would like to have it so the script prompts for the persons username and
password (get-credential) and then takes those credentials and uses them to
launch the process. The script works find if I launch powershell with the
credentials that need to launch the process on the remote machine, but if I
launch the powershell script with credentials that don't have access to that
machine it fails. Could somebody provide an example of this?

David Trimboli

unread,
Dec 22, 2009, 4:13:18 PM12/22/09
to

Here is a blog that indicates you can do it with a
System.Diagnostics.ProcessStartInfo object:

http://tinyurl.com/yje49rx

--
David Trimboli
Windows Systems Analyst
Cold Spring Harbor Laboratory

0 new messages