locked
WSS 3.0 Team Site anonymous access details in Content Database RRS feed

  • Question

  • Hi All,

    I have 1500 team sites in my WSS 3.0 environment and I want to find out the list of all sites which has anonymous access enable on it.

    Is there any flag stored in content DB so that I will just query to content DB and get the list ?


    Thanks, Sachin Jagtap


    Tuesday, May 14, 2013 3:50 PM

Answers

  • Querying the database is not supported. The SPWeb.AnonymousState property contains the anonymous configuration at the site level (I'm assuming you have anonymous authentication enabled at the web application level).

    If you have PowerShell installed on the server, you could run the following to get a list of Sites and the AnonymousState:

    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    $farm = [Microsoft.SharePoint.Administration.SPFarm]::Local
    $websvcs = $farm.Services | where -FilterScript {$_.GetType() -eq [Microsoft.SharePoint.Administration.SPWebService]}
    $webapps = @()
    foreach ($websvc in $websvcs) {
        foreach ($webapp in $websvc.WebApplications) {		
            foreach ($site in $webapp.Sites) {
                $Site.AllWebs | Select Url, AnonymousState
    		
            }
        }
    }

    (HT to Gary Lapointe for the code to get the web app).

    This will result in output that will look something like this:

    Url                                          AnonymousState
    ---                                          --------------
    http://example.com                                 Disabled
    http://example.com/searchcenter                    Disabled
    http://example.com/sites/Test                            On
    http://example.com/sites/Test/Site1                      On
    http://example.com/sites/Test/Site1/SubSite              On


    Jason Warren
    Infrastructure Architect

    Tuesday, May 14, 2013 7:29 PM