Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET or Win32 Equivalent of "netsh http add urlacl" command

Tags:

There are several questions around how to allow a self-hosted WCF application to use BasicHttpBinding with HTTP.SYS without requiring administrative privileges. It boils down to needing to grant permission (from an admin context) to the URL, then the user can host whatever at the specified URL.

netsh http add urlacl url=http://+:80/MyService

I would like to be able to query and add registered URLs without resorting to parsing commandline output of the "netsh" or "httpconfig" commandline tools.

Is there is a public Win32 or .NET API that I can call for this functionality?

like image 307
Travis Avatar asked Jul 27 '11 20:07

Travis


1 Answers

The Win32 API to use is HttpSetServiceConfiguration.

like image 73
Duncan Smart Avatar answered Sep 24 '22 08:09

Duncan Smart