Monday, September 22, 2008

Programatically enabling / disabling Auditing

Enabling:

SPSite siteCollection = this.Site;
siteCollection.Audit.AuditFlags = SPAuditMaskType.All;
siteCollection.Audit.Update();
Disabling:
SPSite siteCollection = this.Site;
siteCollection.Audit.AuditFlags = SPAuditMaskType.None;
siteCollection.Audit.Update();

0 comments: