I am trying to exclude documents that are in a preservation hold library from Search Results. At the moment my users are seeing duplicated documents that are in their original place and the PHL. From my research this is by design, but it is very unfriendly for the standard user who is seeing documents with ID's appended and repeated.
Although I see this question was asked 9 months ago, I'll answer in case someone is interested in doing this for a single SharePoint library. I'm looking for a script that will loop through ALL sites and set this setting for all sites in my tenant.
In the Advanced Settings for the Preservation Hold Library you set the Allow items from this document library to appear in search results? to No