Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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
    }
}
share|improve this answer
    
It works perfect. Thank you very much. –  suren Aug 30 '13 at 11:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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