Ciro, we do not have the lastModifiedBy property for spfile. The workaround I can think of is to get the LastModifiedDate first with SPWeb.LastItemModifiedDate
. And use the date to set a time filter. Query all files in your site and find the file last modified.
Reference:http://www.sharepointdiary.com/2012/09/find-all-documents-created-modified-by-specific-users-datetime.html
I set the dateFilter to last one day. You can set it to be the time period right before the last item modified date.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
# Set the date Filter
$dateFilter = (Get-Date).AddDays(-1) #Past One Day
"File, Created Time, File Size" | out-file NewDocuments.csv
# Get all Webs
$webs = Get-SPWebApplication "http://sp19" | Get-SPSite -Limit All | Get-SPWeb -Limit All
#Iterate through webs
ForEach ($web in $webs)
{
#Iterate through All Lists
ForEach ($list in $web.Lists)
{
#Check for Document Libraries
If ($list.BaseType -eq "DocumentLibrary")
{
#Iterate through All documents
ForEach ($item in $list.Items)
{
If ($item.URL.StartsWith("_")) {Break} #Skip _catalogs, etc
If ($item.URL.EndsWith(".aspx")) {Break} #Skip Form pages
If ($item.File.TimeLastModified -ge $dateFilter)
{
$result = """$($web.URL)/$($item.URL)"", $($item.File.TimeCreated), $( [Math]::Round($item.File.Length/1024,2))"
$result
}
}
}
}
}
siteUrl/_api/web
on your browser and search forLastItemModifiedDate
property.