1

I have a SharePoint application with many users. Is it possible to get list of all attachments in a list item with user name and date time when the attachment was added using PowerShell commands?

5

Yes, here is the PowerShell Code:

$web = Get-SPWeb -Identity http://sp2010:90
$list = $web.Lists["Resources"]
foreach ($item in $list.Items)
{
    $attachmentCollection = $item.Attachments
    $folder = $web.GetFolder($attachmentCollection.UrlPrefix);
    foreach ($file in $folder.Files)
    {
        Write-Host $item.Title
        Write-Host $file.Name
        Write-Host $file.Author
        Write-Host $file.TimeCreated
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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