#Allows to use SharePoint cmdlets from inside the Windows PowerShell command window
If ((Get-PsSnapin |?{$_.Name -eq “Microsoft.SharePoint.PowerShell”})-eq $null)
{
Add-PsSnapin Microsoft.SharePoint.PowerShell | Out-Null
}
$w = Get-SPWebApplication “http://sprootsite/”
$w.Properties[“portalsuperuseraccount”] = “i:0#.w|AD\xxx_SP_Farm”
$w.Properties[“portalsuperreaderaccount”] = “i:0#.w|AD\xxx_SP_Farm”
$w.Update()