Skip to content

Instantly share code, notes, and snippets.

Last active October 31, 2017 17:18
What would you like to do?
Unapprove previously approved forms which are now pending
$Web = Get-SPWeb ""
$List = $web.Lists.TryGetList("Forms")
$Items = $List.Items | Where-Object {$_.ModerationInformation.Status -eq "Pending" -and $(Test-HasPreviousPublished -Item $_)}
Function Test-HasPreviousPublished {
Foreach ($Version in $Item.Versions)
if ($Version.Level -eq "Published")
return $true
return $false
Foreach($Item in $Items)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment