Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 = "<Where><Neq><FieldRef Name='_ModerationStatus'/><Value Type='ModStat'>0</Value></Neq></Where>"
- $spQuery.Query = $caml
- $ii = $l.GetItems($spQuery)
- $ii|%{$_.File.Approve('Automatically Approved')}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement