We can use following pnp powershell to disable the FieldFriendlyFormatType of Modified field in all sites/subsites, after that, Standard format will be used.
(Note, if you have no permission for site, you will get access denied error when set the field property)
--------------------------------------------Update version----------------------------------------------------------
#Set Variables
$SiteURL = "https://tenant.sharepoint.com/"
#Get Credentials to connect
$Cred = Get-Credential
#Connect to PNP Online
Connect-PnPOnline -Url $SiteURL -Credentials $Cred
#Get All Site collections
$SitesCollection = Get-PnPTenantSite
#Loop through each site collection
ForEach($Site in $SitesCollection)
{
#Write-host -F Green $Site.Url
#Connect to site collection
Connect-PnPOnline -Url $Site.Url -Credentials $Cred
#Get Site Collection administrators of the site
$SubSites = Get-PnPSubWeb -Recurse
ForEach ($web in $SubSites)
{
#Write-host `t $Web.URL
#Connect to web
Connect-PnPOnline -Url $web.URL -Credentials $Cred
$Lists = Get-PnPList | Where {$_.Hidden -eq $false -and $_.Title -ne 'Style Library'}
ForEach($list in $Lists){
#Write-host -F White $list.Title
#Disable the modified column friendlyformat
Set-PnPField -List $list -Identity "Modified" -Values @{FriendlyDisplayFormat=1}
}
}
}
More information for your reference:
https://learn.microsoft.com/en-us/powershell/module/sharepoint-pnp/set-pnpfield?view=sharepoint-ps
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.