Running IIS Express without administrator rights

2019-01-31 12:36发布

I've upgraded to iis express 7.5 with VS2010 SP1. Within the release notes it specified that express is able to run WITHOUT administrator permissions. When I try to run from the commandline (powershell cmd line) I receive the same "Access Denied" error (shown below) I was getting running with IIS Express 7.

As far as I can tell admin rights is still required.

Anyone been able to run without admin rights?

The detailed error message is:

Failed to call HttpAddUrl with http://MACHINE-NAME:80/
Failed to register URL "http://MACHINE-NAME:80/" for site "WebSiteName" application "/". Error description: Access is denied. (0x80070005)

3条回答
We Are One
2楼-- · 2019-01-31 13:17

open CMD as administrator and run bellow statement

netsh http add iplisten ipaddress=::

查看更多
啃猪蹄的小仙女
3楼-- · 2019-01-31 13:24

See here for what requires admin access and what doesn't, depending on what you are doing with IIS Express: http://learn.iis.net/page.aspx/1003/running-iis-express-without-administrative-privileges/

Administrative privileges are required in order to perform the following tasks:

* Use a reserved port such as 80 or 443.
* Serve requests for external traffic.
* Configure a custom SSL certificate.
* Run SSL using a port outside the range of 44300 to 44399. 

So if you are doing any of the above, admin access will be required.

This is irrespective of 7 or 7.5.

查看更多
\"骚年 ilove
4楼-- · 2019-01-31 13:24

It is also possible to run IIS Express as a non administrative user on reserved ports and serve requests for external traffic but you need to configure the HTTP service to allow this. The Netsh Commands for Hypertext Transfer Protocol (HTTP) technet page describes this in detail for a Windows 7 machine (also Vista, Server 2008 etc). As you would expect you need to run the configuration command as an administrator. Examples of the command to add and delete the permission are:

netsh http add urlacl url=http://YOUR-MACHINE-NAME:80/ user=DOMAINNAME\GroupOrUserName
netsh http delete urlacl url=http://YOUR-MACHINE-NAME:80/

This works for me on Windows 7 and although I can't verify it, I expect the Httpcfg.exe: HTTP Configuration Utility can be used to allow this on earlier versions of Windows (XP, Server 2003).

查看更多
登录 后发表回答