![]() |
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 08:17 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.