I am partially not even sure how to Google this question because whatever I type never seems to bring back any relevant search results.
I currently have a working script that is set to go through and change the auditing settings for each site collection. I am trying to find a way to EXCLUDE one site collection specifically.
Here is my code:
$spSites = Get-SpSite -Limit All
oreach ($spSite in $SpSites) {
write-host $spsite
$spsite.TrimAuditLog = $true
#write-host $spsite.AuditLogTrimmingRetention
$spsite.AuditLogTrimmingRetention = 90
$SpSite.Audit.AuditFlags = [Microsoft.SharePoint.SPAuditMaskType]::Delete -bxor [Microsoft.SharePoint.SPAuditMaskType]::update -bxor [Microsoft.SharePoint.SPAuditMaskType]::SecurityChange
$SpSite.Audit.Update()
}
We have a 1 site collection set up for MySites. I would like to exclude this site collection but am not sure how to go about doing so. Any help would be greatly appreciated! And as always, thank you in advance! You guys have been insanely helpful on my sharepoint journey!