Take the community feedback survey now.
                AI OnAI Off
            
        Take the community feedback survey now.
 
                
public static string Execute()
{
      int num1 = 0;
      PageDataCollection collection1 = Global.EPDataFactory.GetChildren(Global.EPConfig.Wastebasket, AccessControlList.NoAccess);
      foreach (PageData data1 in ((IEnumerable) collection1))
      {
            if (data1.IsDeleted && (data1.Saved <= DateTime.Now.AddDays(-30)))
            {
                  try
                  {
                        Global.EPDataFactory.Delete(data1.PageLink, true, AccessControlList.NoAccess);
                        num1++;
                        continue;
                  }
                  catch (Exception exception1)
                  {
                        EmptyWastebasketJob.?.Error("17.3.1 Error when trying to delete page from recycle bin " + data1.PageLink.ToString(), exception1);
                        continue;
                  }
            }
      }
      return string.Format("{0} pages were deleted from recycle bin.", num1);
}
Regards.
/Øyvind (Bob ;D)
EPiServer Norway
                        