0

I am executing the below script to get all libraries name in subsite:

Get-SPweb http://server:80/sites/sitename/subsitename |
   Select -ExpandProperty Lists |
   Where { $_.GetType().Name -eq "SPDocumentLibrary" } |
    Select Title

I am getting error: Cannot find an SPWeb object with id or url :......

1 Answer 1

1

I don't recall the reason, but I had also faced this problem and the solution was to first create SPSite object and use it in get-spweb.

$siteURL = "http://server:80/sites/sitename"
$webURL = "/subsitename"
$site = get-spsite $siteURL
get-spweb -site $site $webURL

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.