question

faye avatar image
0 Votes"
faye asked ElsieLu-MSFT commented

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

office-sharepoint-server-administration
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

How are things going? Is there any update?

0 Votes 0 ·
trevorseward avatar image
0 Votes"
trevorseward answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

ElsieLu-MSFT avatar image
0 Votes"
ElsieLu-MSFT answered

Hi @faye ,

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:
80532-4.jpg

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.


4.jpg (29.5 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.