1

How to retrieve the URL of all Discussion Board in a web application using PowerShell?

1

Iterate through each site collection and web site to find a matching list.

This could take a while, and you will need appropraite permissions (e.g. a web application policy).

$discussionLibraryTemplateId = 108
# http://mirusp2010.blogspot.com.au/2013/03/list-template-id.html

# Find all site collections for a web app.
$sites = Get-SPSite -WebApplication http://tugboatTours.com

foreach($site in $sites)
{
    // Iterate through each web site.
    foreach($web in $site.AllWebs)
    {
        foreach($list in $web.Lists)
        {
            if ( (-not $list.Hidden) -and $list.BaseTemplate -eq $discussionLibraryTemplateId)
            {
                write-output $list.Name $list.Url
            }
        }
    }
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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