1

I am creating a system to collect all events for all site collections for reporting later. I notice that none of the events that are returned from SPSite.Audit.GetEntries() method, say anything about adding an item to a list (discussion board in my case) I only see 'update' once with item type Document and once List.

Is there a way to identify the creation of the items in the audit?

1

It's normal behavior, The SharePoint Audit Setting doesn't have Item / Document Creation Event

The events that audited for documents and items within site collection includes the following:

  • Opening or downloading documents, viewing items in lists or viewing item properties
  • Editing items
  • Checking out or checking in items
  • Moving or copying items to another location in the site
  • Deleting or restoring items

Unfortunately, the Item Created event is not listed in the SharePoint audit events! so you will not find any item creation entries returned by SPSite.Audit.GetEntries()


To Check Site collection audit settings, Go to

  • Site Settings > Site Collection Administration > Site collection audit settings.
  • There is no any event for Item created!

enter image description here

0

I would suggest to use the SPWeb.GetChanges method which gives the complete changes (add/edit/delete) done on the site or a particular list.

For a code snippet please check - https://msdn.microsoft.com/en-us/library/ms461643.aspx

  • Cool! did not know it existed. I only want changes to list items but can't find examples to SPChangeItem . Do you know of one? – Ofer Gal Nov 3 '17 at 13:10
  • Nice But how do I get the User ID of the user who made the change? SPChangeItem does not have a User property and the Token has numbers may be one of the is the user – Ofer Gal Nov 3 '17 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.