This script will ensure reader permissions to specified user across site collection

$site = Get-SPSite -Identity "http://mysite/"            
$user = Get-SPUser -Identity "mydomain\myuser" -Web $site.RootWeb            
$assignment = New-Object Microsoft.SharePoint.SPRoleAssignment($user)            
$role = $site.RootWeb.RoleDefinitions[[Microsoft.SharePoint.SPRoleType]::Reader]            
$assignment.RoleDefinitionBindings.Add($role);            
             
foreach ($web in $site.AllWebs) {            
    if ($web.HasUniquePerm) {            
        $web.RoleAssignments.Add($assignment)            
    }            
}

Note: You need to be Site Collection Admin to use this script.
Keep in mind: This is not the right way to deal with permissions issues!

Other languages

This article is also available in the following languages: