0

There is a way, in SharePoint Online, to Change "Display Format" to Standard from "Friendly" in the "Modified" column name?

I would like do this for all sites in the tenant and for all data fields and the last but not least, for all future teams, sites and so on

Thank you enter image description here

1 Answer 1

0

You could disable "Friendly" format in all date columns by PowerShell.

    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
     
    #Config Parameters
    $AdminSiteURL="https://tenant-admin.sharepoint.com"
    
    #Get Credentials to connect to SharePoint Admin Center
    $Cred = Get-Credential
    
    #Connect to SharePoint Online Admin Center
    Connect-SPOService -Url $AdminSiteURL –Credential $Cred
    
    #Get All site collections
    $SiteCollections = Get-SPOSite -Limit All
    
    #Get All Webs of the Site Collection
    $WebColl = Get-SPOSite $SiteURL | Get-SPOWeb -Limit All
      
    Foreach ($Site in $SiteCollections)
    {
     Foreach($Web in $WebColl)
     {            
        #Get All Lists of the web
        $ListColl = $Web.Lists
     
        #Loop through each list 
        Foreach($List in @($ListColl))
        {             
            $ListFields = $List.Fields
            #Loop through each field
            ForEach($Field in @($ListFields))
            {
                #Get the Field to suppress "Collection was modified" Error
                $Column = $List.Fields.GetFieldByInternalName($Field.InternalName)
     
                #Pick Date Columns
                If($Column.Type -eq "DateTime")
                {     
                    #Disable Friendly Display format
                    $Column.FriendlyDisplayFormat="Disabled" #Relative
                    $Column.update()               
                }
            }
         }
      }
    }
1
  • Hello, this script seems to works only with SP On-prem. Get-SPSite is only available in SharePoint Server 2010, SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019
    – NCG7771
    Commented Jul 27, 2021 at 13:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.