Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > PowerShell

process execution with impersonation

Closed Thread
 
Thread Tools Display Modes
Old 05-07-2008   #1 (permalink)
bobuva
Guest
 
Posts: n/a

process execution with impersonation

Is it possible to replace the process launcher in PowerShell? I'd like
to pass a flag and Windows identity information to have exe's that are
launched by a script and which inherit the script's identity. Right
now it is not possible to pass impersonation credentials to the
process when launched from a PowerShell script. This is for PowerShell
version 1. I know that version 2 in CTP provides some support for
impersonation but I need it now.

Thanks,
Bob
 
Old 05-08-2008   #2 (permalink)
Joel (Jaykul) Bennett
Guest
 
Posts: n/a

Re: process execution with impersonation

You can use this method:
[Diagnostics.Process]::Start(String fileName, String userName,
SecureString password, String domain)

There's several overloads including one which takes a ProcessStartInfo
object which lets you specify just about everything ;-)

bobuva wrote:
Quote:

> Is it possible to replace the process launcher in PowerShell? I'd like
> to pass a flag and Windows identity information to have exe's that are
> launched by a script and which inherit the script's identity. Right
> now it is not possible to pass impersonation credentials to the
> process when launched from a PowerShell script. This is for PowerShell
> version 1. I know that version 2 in CTP provides some support for
> impersonation but I need it now.
>
> Thanks,
> Bob
 
Old 05-08-2008   #3 (permalink)
bobuva
Guest
 
Posts: n/a

Re: process execution with impersonation

On May 8, 9:34 am, "Joel (Jaykul) Bennett" <Jay...@xxxxxx>
wrote:
Quote:

> You can use this method:
> [Diagnostics.Process]::Start(String fileName, String userName,
> SecureString password, String domain)
>
> There's several overloads including one which takes a ProcessStartInfo
> object which lets you specify just about everything ;-)
>
> bobuva wrote:
Quote:

> > Is it possible to replace the process launcher in PowerShell? I'd like
> > to pass a flag and Windows identity information to have exe's that are
> > launched by a script and which inherit the script's identity. Right
> > now it is not possible to pass impersonation credentials to the
> > process when launched from a PowerShell script. This is for PowerShell
> > version 1. I know that version 2 in CTP provides some support for
> > impersonation but I need it now.
>
Quote:

> > Thanks,
> > Bob
I found that, Joel, and it works. What I would really like is to avoid
having any script that has to call an exe to call my special function
that would call the Process.Start. In that way, anyone who writes a
script won't have to remember this rule.

Thanks,
Bob
 
 
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vista: Impersonation across Intergrity Levels Alex Chmut Vista security 4 01-26-2007 07:55 AM
Impersonation in Powershell =?Utf-8?B?ZGg=?= PowerShell 3 07-21-2006 01:05 PM
User Guide: Suggestion re impersonation Andrew Watt [MVP] PowerShell 0 06-18-2006 04:06 PM








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49