Site.AllWebs access denied

05/02/2014 11:05

I encoutered following access denied error when trying to enumerate collection

$site = new-object Microsoft.Sharepoint.SPSite($siteUrl)

$site.AllWebs


 

Check

========


 

1. Make sure you have sufficient permissions in content database (your account what runs powershell)

2. Make sure you have Full control rights for Web Application in Central administration(Application Management/Policy for web application for SP 2007)