Introduction:In SharePoint, when a new item is created in the list or library a new icon will appear. In this article we will be seeing how to change the duration of the new icon and how to delete the new icon for the list or library.
Set the duration of the new icon: In this section, we will be seeing how to set the duration of the new icon using object model and PowerShell. Using Object Model: using System; using System.Collections.Generic; using System.Linq; using System.Text; using Microsoft.SharePoint; using Microsoft.SharePoint.Administration; namespace NewIcon { class Program { static void Main(string[] args) { SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://serverName:1111/")); Console.WriteLine(webApp.DaysToShowNewIndicator.ToString()); webApp.DaysToShowNewIndicator = 3; webApp.Update(); Console.WriteLine(webApp.DaysToShowNewIndicator.ToString()); Console.ReadLine(); } } } Using PowerShell: $webApp=Get-SPWebApplication "http://serverName:1111/" write-host -f Magenta $webApp.DaysToShowNewIndicator $webApp.DaysToShowNewIndicator=3 $webApp.Update() write-host -f Magenta $webApp.DaysToShowNewIndicator Remove the new icon: In this section, we will be seeing how to remove the new icon using object model and PowerShell. Using Object Model: SPWebApplication webApp = SPWebApplication.Lookup(new Uri("http://serverName:1111/")); Console.WriteLine(webApp.DaysToShowNewIndicator.ToString()); webApp.DaysToShowNewIndicator = 0; webApp.Update(); Console.WriteLine(webApp.DaysToShowNewIndicator.ToString()); Console.ReadLine(); Using PowerShell: $webApp=Get-SPWebApplication "http://serverName:1111/" write-host -f Magenta $webApp.DaysToShowNewIndicator $webApp.DaysToShowNewIndicator=0 $webApp.Update() write-host -f Magenta $webApp.DaysToShowNewIndicator
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: