How to get audit log settings in SharePoint 2013/Office 365 using CSOM?

Hello SharePointers,

Below are the code in CSOM to get the audit log settings in Office 365.Audit is the property to look out for.

string siteUrl = “”;
var Pwd = new SecureString();
foreach (char c in “TenantAdminPwd”.ToCharArray()) Pwd.AppendChar(c);var siteCtx = new ClientContext(siteUrl);
siteCtx.Credentials = new SharePointOnlineCredentials(“”, Pwd);
Site site = siteCtx.Site;siteCtx.Load(site.Audit);


Happy Sharepointing folks 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *