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
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