New Icon Indicator in SharePoint 2010


Introduction:
In SharePoint, when a new item is created in the list or library a new icon Untitled-1.gifwill 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.
  • Remove the new icon.

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