Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Security (http://www.velocityreviews.com/forums/f62-asp-net-security.html)
-   -   impersonation issue when executing a Process.Start("Shutdown",strArgs) (http://www.velocityreviews.com/forums/t770017-impersonation-issue-when-executing-a-process-start-shutdown-strargs.html)

Mixedmingle 01-23-2009 03:26 PM

impersonation issue when executing a Process.Start("Shutdown",strArgs)
 
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


All times are GMT. The time now is 06:34 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.