1

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

1 Answer 1

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
            }
        }
    }
}
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.