I want to retrieve all the Workflow History lists from my site collection and break its role inheritance and apply Contribute permissions for a particular custom group and 2 individual users.
I know how to get the normal list using powershell, but the WFHistoy is hidden, i am stuck at accessing through PowerShell.
Add-PSSnapin Microsoft.SharePoint.PowerShell
$SiteURL = "http://srvr001:28516"
$site = Get-SPSite $SiteURL
#$groups = $site.RootWeb.sitegroups $COUNGRP= $groups.COUNT
$w = Get-SPWeb $SiteURL
$mdate= get-date -f yyyy_MM_dd_HHmm
$w = Get-SPWeb $SiteURL
$list = $w.Lists[$ListName]
$ct = @()
foreach($singlelist in $w.Lists)
{
if($singlelist.BaseTemplate -ne "DocumentLibrary" -and
$singlelist.Title -contains "History")
{
$ctObject = New-Object -TypeName PSObject
$ctObject | Add-Member -Name 'ListTitle' -MemberType
Noteproperty -Value $list.Title
$ct += $ctObject
Write-Host $singlelist.Title + " is the name of the History"
#" list in qa "
} } }
$w.dispose()
the above code didnt work for me! :-(