For IIS 7 (Vista/7 and Windows Server 2008)
netsh http add urlacl url=http://+:80/MyUri user=DOMAIN\user
The other commands are detailed here: http://msdn.microsoft.com/en-us/library/ms733768.aspx
The error you'll get if the user does not have this right is:
System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:80/serviceurl/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). ---> System.Net.HttpListenerException: Access is denied
at System.Net.HttpListener.AddAll()
at System.Net.HttpListener.Start()
at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
--- End of inner exception stack trace ---
at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
at System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.HttpChannelListener.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open()
at ...
Incidentally, this is one of the best cases of a stacktrace containing a useful link that will help you solve the problem.
Reference:
Thanks for this - just fixed an issue with a 3rd party app on our Windows 2008 server.
ReplyDeleteUAC in a server environment sure is messy!