Prerequisites

Replace the following placeholders with values:
<WebApplication> is the name of the Web application to which the accounts will be added.
<SuperUser> is the account to use for the Portal Super User .
<SuperReader> is account to use for the Portal Super Reader .

Grant Logon as a Service for both accounts in Local Policies on the web server.

Powershell

$wa = Get-SPWebApplication -Identity "<WebApplication>"
$wa.Properties["portalsuperuseraccount"] = "<SuperUser>"
$wa.Properties["portalsuperreaderaccount"] = "<SuperReader>"
$wa.Update()


Claims based authenticated provider Add  “i:0#.w|”

$
wa = Get-SPWebApplication -Identity "<WebApplication>"
$wa.Properties["portalsuperuseraccount"] = "i:0#.w|”<SuperUser>"
$wa.Properties["portalsuperreaderaccount"] = "i:0#.w|”<SuperReader>"
$wa.Update()

Default Cache Users

$wa = Get-SPWebApplication -Identity "<WebApplication>"
$wa.Properties["portalsuperuseraccount"] = "SYSTEM"
$wa.Properties["portalsuperreaderaccount"] = "NT Authority\Local Service"
$wa.Update()


Remove Cache Users

$wa.Properties.Remove("portalsuperreaderaccount")
$wa.Properties.Remove("portalsuperuseraccount")