Sharepoint Forum

 
Home » Forum » Sharepoint       Ask a questionRSS Feeds

Error in Powershell script to create XML sitemap

  Date: Sep 17, 2011      Category: Sharepoint      Views: 102
 

Trying to loop through the site collection to get all sites:

$site=Get-SPSite $Url
$list = $site.Allwebs | ForEach { $_.Lists } | ForEach-Object -Process
{$_.Items}| ForEach-Object -Process {$_.web.url.Replace(" ","%20") + "/" +
$_.url.Replace(" ","%20")}


It works for some site collection, but some site collection return 0 sites.

when we try to run $list = $site.Allwebs for those SC, it return nothing.

Any idea?

Tagged:                

 

2 Answers Found

 
Answer #1       Answered On: Sep 17, 2011       

What user context are you running under? The operation is going to be
security trimmed based on that, maybe those sites are not accessible by
the process UID?

 
Answer #2       Answered On: Sep 17, 2011       

I just run in in Powershell scripts with Local Administrator permission. How can
I check if those site are accessible by Process UID?
Or any other alternatives?

 
Didn't find what you were looking for? Find more on Error in Powershell script to create XML sitemap Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].