HTTP Listener fails to initialize when lacking SeChangeNotifyPrivilege

This article provides a solution to an issue that HTTP Listener fails to initialize when user lacks SeChangeNotifyPrivilege.

Original product version:   Windows Server 2016, Windows Server 2019
Original KB number:   4570992

Symptoms

When initializing a new HTTP Listener using the HttpInitialize function or the .NET HttpListener class, the operation fails and you receive this error message:

HttpInitialize failed with 5 ( -access denied)

Cause

This issue occurs when the account running the code lacks the SeChangeNotifyPrivilege privilege.

Workaround

Grant the Bypass traverse checking user right to the relevant account.

This privilege is granted to the Everyone group by default.