SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

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

Is there a quick powershell script to delete items from a list where created date is less than some date? Also, would the deleted items be in the recycle bin (in the event business team wants to restore some items).

share|improve this question
Nice job finding the solution! Can you post it as an answer now? – Kit Menke Jul 29 '11 at 20:37

On behalf of author, the answer was found here:


$site = new-object Microsoft.SharePoint.SPSite("http://sitecollectionURL") 
$web = $site.rootweb 
$list = $web.Lists["Name of the List"]

            <FieldRef Name="Created" />
            <Value IncludeTimeValue="TRUE" Type="DateTime">2011-12-31T02:32:20Z</Value>

$query=new-object Microsoft.SharePoint.SPQuery 
$query.Query=$caml | Write-Output

$listItemsTotal = $items.Count;

for($x=$listItemsTotal-1;$x -ge 0; $x--)

share|improve this answer

Your Answer


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.