impersonation issue when executing a Process.Start("Shutdown",strArgs)

M

Mixedmingle

guys,

I am trying to execute a shutdown on a remote machine.
however eventhough I have setup impersonation and according to the
retrieve username it is using the correct user(Domain\genericuser),
the remote machine still tells me the user executing the command is
the domain\Webserver$ account (after giving this account admin
permissions on the remote computer)

What am I missing here?

Code
--------------------------------------------------------------
string strArgs = " /m \\\\" + ServerName + " /r";
WindowsIdentity p = WindowsIdentity.GetCurrent();
WindowsImpersonationContext impersonationContext = p.Impersonate();
System.Diagnostics.Process.Start("Shutdown", strArgs);
impersonationContext.Undo();


---------------------------------------------------------------
web.config

<authentication mode="Windows"/>
<identity impersonate="true" userName="Domain\generiguser"
password="password"/>


----------------------------------------------------------------

please help me out here.

thanks
Regards
Erik
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top