Add-PSSnapin "Microsoft.SharePoint.PowerShell" $webUrl = "http://acme.com/web/" $listtName = "Documents" $w = get-spweb $webUrl $l = $w.Lists.TryGetList($listtName) $spQuery = New-Object Microsoft.SharePoint.SPQuery $spQuery.ViewAttributes = "Scope='Recursive'"; $spQuery.RowLimit = 2000 $caml = "0" $spQuery.Query = $caml $ii = $l.GetItems($spQuery) $ii|%{$_.File.Approve('Automatically Approved')}