Get Web Sites Owners Listing (Powershell to Text File)

I created this script to gather a listing of web site owners within a Site Collection.  It has been set to only gather the first tier of sites.  If you wish to go deeper, change the comparision.

if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) {
    Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
function IterateSubSites ([Microsoft.SPWeb]$subSite)
{
    if ($subSite -ne $null)
    {
        if($subSite.Webs -ne $null)
        {
            foreach($subsites in $subSite.Webs)
            {
                IterateSubSites($subsites)
            }
        }
    }
}
 
$webApplicationURL = "http://contoso.com"
$webApp = Get-SPWebApplication $webApplicationURL
 
foreach($site in $webApp.Sites)
{
    foreach($subWeb in $site.AllWebs)
    {
       if(($subWeb.Url.Split("/") | measure-object).Count -lt 5)
{
        $output += $subWeb.Url + "`r`n`r`n"
        foreach($group in $subWeb.Groups)
        {
            if($group.Name -like "*Owners*")
            {
                $output += "Owner(s): " + "`r`n`r`n"
                foreach($user in $group.Users)
                {$output += $user.Name + " - " + $user.Email + "`r`n`r`n"; }
            }
        }
}
    }
    if($subWeb.IsRootWeb -ne $true)
    {
        IterateSubSites($subWeb)
    }
    $subWeb.Dispose()
}
$site.Dispose()
$output | Out-File "C:\owners.txt" 

Can not convert claims identity to windows token. This may be due to user not logging in using windows credentials.

Can not convert claims identity to windows token. This may be due to user not logging in using windows credentials.

saml-ssrs-before

If you receive this message when trying to run a report after upgrading your SharePoint environment to 2013, make sure that you have enabled the Claims To Windows Token Service on the SAME server that you have Reporting Services running on.  This will take care of that error.

If after that you receive an error message indicating that you cannot logon as “NT Anonymous” you will further need to go in and set up your SharePoint Service account to have “AllowedDelegateTo” permission to the SQL Server you are trying to connect to.

In Active Directory Users and Computers, change the msDS-AllowedToDelegateTo attribute to include entries to your SQL Server(s).

msds-allowedtodelegateto

You may also wish to set it to allow any protocol.

useanyauth