SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to do the following but I have some exceptions, I dont know whats wrong with this.

Update 2:

    $site = Get-SPSite -Identity "http://url/workspaces/TS1/"
$list = $site.RootWeb.GetList("/workspaces/TS1/Lists/WorkspaceAccessRights")

I tried this simple 1. and it says

Exception calling "GetList" with "1" argument(s): "Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"
At line:15 char:30
+ $list = $site.RootWeb.GetList <<<< ("/workspaces/TS1/Lists/WorkspaceAccessRights/")
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException
share|improve this question

Rather than using

$spList = $spWeb.GetList("/Lists/Mylist")


$spList = $spWeb.Lists["My list"]


$spList = $spWeb.GetList("/sitename/Lists/Mylist")

It seems like all the errors are related to the fact that $spList is null.

share|improve this answer
pls see my update, last line is throwing Cannot convert value to type System.String. At line:31 char:18 + Write-Host "$spWe <<<< b" + CategoryInfo : NotSpecified: (:) [], RuntimeException + FullyQualifiedErrorId : RuntimeException – Esteban V Apr 11 '12 at 12:47
Is this a typo? $spList = $web.Lists["Workspace Access Rights"] where you have $web instead of $spWeb? – Robert Kaucher Apr 11 '12 at 13:04
psl see the edit, now access denied?, this is weird – Esteban V Apr 11 '12 at 13:28
up vote 1 down vote accepted

I have solved with this blog:

Perhaps I should have mentioned that I am using POWERGUI, after checking the logs at the exact same time of the script execution, I could copy and paste the error and find the blog above.

I blogged about this here:

share|improve this answer
Don't forget to select this as the answer. Also, it would be a good idea to give a short explanation of what was going on in case the post is deleted or the site goes away. – Robert Kaucher Apr 11 '12 at 14:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.