locked
Set Audit Log Trimming using CSOM RRS feed

  • Question

  • Hi All,

    I am facing issue when I am trying to set the location for audit log trimming using below code:


                    var allProperties = context.Web.AllProperties;   
                    allProperties["_auditlogreportstoragelocation"] = newLib.RootFolder.ServerRelativeUrl;
                    context.Web.Update();
                    context.ExecuteQuery();

    Strange this is when I  try to add value to propertybag "_auditlogreportstoragelocation" using designer, its reflecting under Site Action > Site Settings > Site Collection Audit Setting. help on this issue is highly appreciated. 

    Thanks

    Ankit

    Tuesday, May 10, 2016 12:44 PM

Answers

  • Hi Ankit,

    Per my test, if we enable Audit Log Trimming for the site collection in the root site collection settings, then it will add the property “_ auditlogreportstoragelocation” to the property bag of the root site, and subsite will not have this property.

    Actually, this setting is for the whole site collection even though the property is added to the root site. So when we update the property of the root site, it is also updating the audit settings for the whole site collection. That is why you can view the same result updated in Site collection audit settings.

    Best Regards,

    Victoria

    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, May 11, 2016 9:56 AM

All replies

  • Hi Ankit,

    Per my test, if we enable Audit Log Trimming for the site collection in the root site collection settings, then it will add the property “_ auditlogreportstoragelocation” to the property bag of the root site, and subsite will not have this property.

    Actually, this setting is for the whole site collection even though the property is added to the root site. So when we update the property of the root site, it is also updating the audit settings for the whole site collection. That is why you can view the same result updated in Site collection audit settings.

    Best Regards,

    Victoria

    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Wednesday, May 11, 2016 9:56 AM
  • Hi Ankit,

    How is everything going?

    Is there any update about this issue?

    If you have any questions, please feel free to let me know.

    Best Regards,

    Victoria


    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    Thursday, May 19, 2016 2:39 AM
  • Hi Victoria,

    I am trying to set the value for site collection only. The issue which I am facing is, when I try to set value for "_auditlogreportstoragelocation" using a webjob, it sets value for some time and then it goes away. I know its strange but this is the issue which I am facing. 


    Regards,

    Ankit

    Monday, May 30, 2016 6:31 AM