SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 2 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

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.