Skip to content

Using PnPonline to audit a site for file changes and ownership #443

Answered by veronicageek
SacJones asked this question in Q&A
Discussion options

You must be logged in to vote

The following is working for me:

$allFiles = Get-PnPListItem -List "Documents" 
$results = @()

foreach($file in $allFiles){
    $results += [pscustomobject]@{
        fileName = $file["FileLeafRef"]
        CreatedBy = $file.FieldValues.Author.LookupValue
        ModifiedBy = $file.FieldValues.Editor.LookupValue
    }
}
$results

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@SacJones
Comment options

@SacJones
Comment options

Comment options

You must be logged in to vote
2 replies
@SacJones
Comment options

@SacJones
Comment options

Answer selected by veronicageek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants