Programmatically mask the created by and modified by in the SharePoint list edit and display forms
- Vijai Anand Ramalingam
- May 3, 2019
- 1 min read
In this article we will be seeing how to mask the created by and modified by in the SharePoint list edit and display forms as shown in the following
Using C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using System.Xml;
namespace MaskUser
{
class Program
{
static void Main(string[] args)
{
using (SPSite site = new SPSite("http://serverName:1111/"))
{
using (SPWeb web = site.RootWeb)
{
SPList list=web.Lists["cl"];
list.ShowUser = false;
list.Update();
}
}
}
}
}
Using PowerShell:
$site=Get-SPSite "http://serverName:1111/"
$web=$site.RootWeb
$list=$web.Lists["cl"]
$list.ShowUser=$false
$list.Update()
Comments