I need you help Im using the next script: How to get all groups within all webs in SharePoint 2010 using Powershell
The script perfectly, but some user can not be found, so I'm trying to control the errors and send them to a file, I try:
catch [System.Exception]{
"ERROR: " + $($_.Exception.Message)| out-file $logfile -append
}
But this does not work, the catch never write the file as if it never entered in the catch, but in screen I see the errors