I\'m using caml query to select all documents which were modified or added by user. Query runs recursively on all subsites of specified site collection.
Now problem is I
According to the output from CAML Designer (created by Karine Bosch and Andy Van Steenbergen and distributed by the Belux Information Worker User Group) the correct CAML syntax is:
0
I tested this in PowerShell and got the expected result:
$qry = new-object Microsoft.SharePoint.SPQuery
$qry.Query = "0 "
$items = $lib.GetItems($qry)
$items.Count
You can replace the
tag in the CAML with the SPQuery object property ViewAttributes if you prefer, ie $qry.ViewAttributes = “Scope=’RecursiveAll’"
.
When testing this be sure to re-instantiate the SPQuery object each time as you cannot simple reassign the Query property. Once the query has been executed, any new value assigned to the Query property is ignored. So execute the entire PowerShell fragment.