Grant-HttpUrlPermission

Grant a principal permission to bind to an HTTP URL.

Syntax

Grant-HttpUrlPermission [-Url] <String> [-Principal] <String> [-Permission] {ListenAndDelegate | Listen | Delegate | Read} [<CommonParameters>]

Description

The Grant-HttpUrlAclPermission functions uses the HTTP Server API to grant a user permission to bind to an HTTP URL.

The HTTP Server API

enables applications to communicate over HTTP without using Microsoft Internet Information Server (IIS). Applications can register to receive HTTP requests for particular URLs, receive HTTP requests, and send HTTP responses.

An application that uses the HTTP Server API must register all URLs it listens (i.e. binds, registers) to. A user can have three permissions:

If the user already has the desired permissions, nothing happens. If the user has any permissions not specified by the Permission parameter, they are removed (i.e. if the user currently has delegate permission, but you don't pass that permission in, it will be removed).

This command replaces the netsh http (add|delete) urlacl command.

Grant-HttpUrlAclPermission was introduced in Carbon 2.1.0.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
Url String

The URL.

true false
Principal String

The user receiving the permission.

true false
Permission HttpUrlAccessRights

The permission(s) to grant the user. There are two permissions:

  • Listen, which allows the user to bind to the $Url url
  • Delegate, which allows the user to "reserve (delegate) a subtree of this URL for another user" (whatever that means)
  • ListenAndDelegate, which grants both Listen and Delegate permissions
true false

EXAMPLE 1

Grant-HttpUrlAclPermission -Url 'http://+:4833' -Principal 'FALCON\HSolo' -Permission [Carbon.Security.HttpUrlAccessRights]::Listen

Demonstrates how to grant a user permission to listen to (i.e. "bind" or "register") an HTTP URL. In this case user FALCON\HSolo can listen to http://+:4833.

EXAMPLE 2

Grant-HttpUrlAclPermission -Url 'http://+:4833' -Principal 'FALCON\HSolo' -Permission [Carbon.Security.HttpUrlAccessRights]::Delegate

Demonstrates how to grant a user permission to delegate an HTTP URL, but not the ability to bind to that URL. In this case user FALCON\HSolo can delegate http://+:4833, but can't bind to it.

EXAMPLE 3

Grant-HttpUrlAclPermission -Url 'http://+:4833' -Principal 'FALCON\HSolo' -Permission [Carbon.Security.HttpUrlAccessRights]::ListenAndDelegate

Demonstrates how to grant a user permission to listen (i.e "bind" or "register") to and delegate an HTTP URL. In this case user FALCON\HSolo can listen to and delegate http://+:4833.