What version of SharePoint Server? This functionality was removed as of SharePoint Server 2019.
Sharepoint Native audit

Hi, I need some help to list all site with audit option "Opening or downloading documents, viewing items in lists, or viewing item properties" enabled. Can anyone help me? Thanks Regards Faye
2 answers
Sort by: Most helpful
-
-
Elsie Lu_MSFT 9,796 Reputation points
2021-03-23T06:58:47.087+00:00 Hi anonymous user ,
Could you please add more detailed information about your needs or issues? Is the requirement to view the audit data or list all sites?
Per my understanding, if you want to see the audit data, you need to wait for your timer job to run after completing the settings, and your report will be automatically generated to the library you specify.
================================
Or if it is to list all sites and subsites, you could try the following script:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null $siteUrl = Read-Host "Enter Site URL" $rootSite = New-Object Microsoft.SharePoint.SPSite($siteUrl) $spWebApp = $rootSite.WebApplication $count = 0 write-host "Site Collections" write-host "" foreach ($site in $spWebApp.Sites) { $count++ write-host "Site Collections URL --> -->" $site.URL write-host "" write-host "SubSites" write-host "" foreach ($web in $site.AllWebs) { $count++ write-host "SubSite URL --> --> -->" $web.URL write-host "" } } write-host "Total Count :" $count
Result:
Reference:
List of Sites and Subsites
If the 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.