Reporting on Anonymous surveys

SharePoint enables the creation of anonymous surveys, but how anonymous are they?   If you want a truly anonymous survey, then you will want to create a new web application that allows anonymous access without authentication.  Here’s a TechNet article with some good guidance on doing that.

If you create an anonymous survey in a web application with authentication, the user information is captured, but is hidden to users, and even within the .NET Object model.   SharePoint will gladly create audit logs of access that can expose the survey use.    Note that a site administrator with Full Control can change a survey to non-anonymous and expose the users.

Using PowerShell, we can temporarily expose the users, report on them, then restore the anonymity.  This is useful when needing to chase down non-respondents to a survey, without exposing which survey was completed by whom.  Here’s the PowerShell I wrote to achieve this.  The console output is structure to allow text-to-column conversion or CSV reading in Excel, then easily pivot-table reporting on the results:

$web=Get-SPWeb href="http ://sharepoint/sites/EXEC
$lists=$web.Lists;
Write-Host "List or Survey,Creator of List or Survey,List Creation Time,List Edit Time,Person completing Survey,Modified Date of list entry"
for ($i=0; $i -lt $lists.count; $i++)
{
$list=$lists[$i]
if (!$list.get_ShowUser())
{
$reversion=$true;
$list.set_ShowUser($true)
$list.update()
}
else
{
$reversion=$false;
}
foreach ($item in $list.Items)
{
Write-Host "$($list.title), $($List.get_author()) , $($List.LastItemModifiedDate), $($List.Created), $($item['Author']),$($item['Created'])"
}
if ($reversion)
{
$list.set_ShowUser($false)
$list.Update();
}
}

During the running of the script, the survey becomes non-anonymous briefly, so do consider only running this off-hours