Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $root = New-Object Microsoft.SharePoint.SPSite($webSiteUrl)
- foreach ($sites in $root.AllWebs) {
- foreach ($webs in $arySites) {
- if ($webs.ToString() -eq $sites.Url.ToString())
- {
- Write-Host "Match found! "
- $root.OpenWeb($webs)
- if ([Microsoft.SharePoint.Publishing.PublishingWeb]::IsPublishingWeb($webs)) {
- Write-Host "Reviewing pages in"$web.Title"site...."
- $publishingWeb = [Microsoft.SharePoint.Publishing.PublishingWeb]::GetPublishingWeb($webs)
- $publishingPages = $publishingWeb.GetPublishingPages()
- foreach ($publishingPage in $publishingPages)
- {
- if ($publishingPage.ListItem.File.CheckOutStatus -eq "None")
- {
- Write-Host "Checking out page: " $publishingPage.Title
- }
- else
- {
- Write-Host "This page is checked out. :("
- }
- }
- }
- else
- {
- Write-Host "But it's not a pub web! :( "
- }
- }
- }
Add Comment
Please, Sign In to add comment