Sharepoint audit - Opening or downloading documents events

Faye Müller 96 Reputation points

Hi, I need some help to find, with powershell, all sites and sub-sites with native audit enable option "Opening or downloading documents, viewing items in lists, or viewing item properties" enabled. Thanks for help me Regards Faye

SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,891 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Echo Du_MSFT 17,141 Reputation points

    Hello anonymous user ,

    Enable all audit settings on all site collections using PowerShell.

    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue  
       $sites = Get-SPSite -Limit All  
       foreach($site in $sites)  
           $site.Audit.AuditFlags = $site.Audit.AuditFlags = [Microsoft.SharePoint.SPAuditMaskType]::CheckOut `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::CheckIn `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::View `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::Delete `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::Update `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::ProfileChange `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::ChildDelete `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::SchemaChange `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::SecurityChange `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::Undelete `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::Workflow `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::Copy `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::Move `  
    -bxor [Microsoft.SharePoint.SPAuditMaskType]::Search  


    Echo Du


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments