Re: failing Process and impersonation connection
From: Support (RemoveThis_Support_at_mail.oci.state.ga.us)
Date: 02/11/05
- Next message: Support: "Re: failing Process and impersonation connection"
- Previous message: Nicole Calinoiu: "Re: get computer name of client machine"
- In reply to: Support: "failing Process and impersonation connection"
- Next in thread: Support: "Re: failing Process and impersonation connection"
- Reply: Support: "Re: failing Process and impersonation connection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 11 Feb 2005 09:14:16 -0500
This is confirmed when using whoamI - I am NOT the network admin account
when I shell out, so do you know how to start a shell process under an
impersonated account in vb.net ?
Thanks
"Support" <RemoveThis_Support@mail.oci.state.ga.us> wrote in message
news:uU$f$KEEFHA.3492@TK2MSFTNGP12.phx.gbl...
> Hello:
> In vb.net I impersonate a domain administrator
> I confirm this using: WindowsIdentity.GetCurrent().Name))
> then I start a process which shells out and uses CACLS to assign a group
> right to a file and I get an Access Denied error message.
>
> Dim impersonatedUser As WindowsImpersonationContext = newId.Impersonate()
> MsgBox(WindowsIdentity.GetCurrent().Name)) ' to confirm I am the network
> admin
>
> MyProcessString = "cacls.exe """ + ICopyTo + """ /E /G """ + ICopyRights +
> """:R"
> Dim myProcess = New Process()
> myProcess.StartInfo.FileName = "cmd.exe"
> myProcess.StartInfo.Arguments = "MyProcessString"
> myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Maximized
> myProcess.StartInfo.RedirectStandardOutput = False
> myProcess.StartInfo.CreateNoWindow = False
> myProcess.Start()
> myProcess.WaitForExit()
>
> Now, when I logon as under the network domain account on my machine and
> run the CACLS from command line it works.
> Also, when I run loged in as myself using the RUNAS command line, it also
> works.
> It appears that when I create the process, it is NOT using the
> impersonated account but I dont know how to do this...
>
> Any thought s?
>
> Thanks
>
> Terry
>
>
- Next message: Support: "Re: failing Process and impersonation connection"
- Previous message: Nicole Calinoiu: "Re: get computer name of client machine"
- In reply to: Support: "failing Process and impersonation connection"
- Next in thread: Support: "Re: failing Process and impersonation connection"
- Reply: Support: "Re: failing Process and impersonation connection"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|