Navaneeth K N
Navaneeth K N

Reputation: 15501

Process.Start() and user impersonation

I have a MSI installer custom action which calls Process.Start() to run a batch file which internally does lot of operations and finally calls iisreset. But on few computers, this is failing with access denied error. Interestingly, the user running the MSI can do iisreset from a command prompt. It only fails when executed through my process.

So I am wondering, is Process.Start() spawning new process as the current user with less privileges? If yes, how can I say to run as the same user with all privileges user has? Can any one help me to understand this better and diagnose on why this fails.

MSI created using : Visual Studio 2008
Server : Windows Server 2008
UAC Status : Off

Error Message

Restart attempt failed. Access denied, you must be an administrator of the remote computer to use this command. Either have your account added to the administrator local group of the remote computer or to the domain administrator global group

Any help would be appreciated.

Upvotes: 2

Views: 1279

Answers (1)

Frédéric Hamidi
Frédéric Hamidi

Reputation: 262939

You should set the msidbCustomActionTypeNoImpersonate flag (0x800) on your custom action to avoid issues with the User Access Control feature of recent Windows systems.

See this blog for details.

Upvotes: 2

Related Questions