Saturday, February 1, 2014

PowerShell Script to Mask User

SharePoint Survey Lists have the option to mask the Created By and Modified By fields, but unfortunately no other lists have this option.

If you need to mask the Created By and Modified By names on a SharePoint list, use the script below:

#Get Web and List objects
$spweb = Get-SPWeb http://SiteUrl
$splist = $web.Lists["List Name"]
#Mask Created By/Modified By
$splist.ShowUser = $false
$splist.Update()
$spweb.Dispose()


You could also modify the view to not show the Created By/Modified By fields and customize the template to not display those fields, however, if you use mobile SharePoint apps on a tablet or SmartPhone, the fields may still appear.  Using this script, however, the fields' values are either masked or the fields are not shown (at least in the apps I have tried).

No comments:

Post a Comment