After migration from SharePoint 2007 to 2010 the list feature to receive emails is not working on migrated sites. The functionality is enabled in the UI and when I´m checking $list.CanReceiveEmail with Powershell.
When I´m disabling and enabling the functionality it´s fixed for the list. Now my plan is to write a Powershell script to disable and enable the the receive email setting.
How can I disable and enable the feature with PowerShell? CanReceiveEmail is a ReadOnly property...
$list.CanReceiveEmail = $false "CanReceiveEmail" is a ReadOnly property.
$WA = Get-SPWebApplication https://sharepoint
$Sites = $WA.Sites
foreach($Site in $Sites)
{
foreach($web in $site.AllWebs){
$lists = $web.lists
foreach($list in $lists){
if (($list.CanReceiveEmail -eq $true) -AND ($list.EmailAlias -ne $Null)){
Write-Host($list.Title +" ; "+$list.EmailAlias +" ; "+ $list.ParentWeb.Url)
#$list.CanReceiveEmail = $false
#Error
#$list.Update()
#$list.CanReceiveEmail = $true
#$list.Update()
}
}
}
}
