I have recently implemented audit for SharePoint 2010 Foundation using PowerShell.
There was a couple of discussions where some people said it's impossible to enable audit in SharePoint 2010 Foundation:
http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/53e79142-88c9-48f1-b5a5-a6259c9f6f97
http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/ec1e2e7e-2fcf-4d16-8c25-a44198b651d9
Solution:
There was a couple of discussions where some people said it's impossible to enable audit in SharePoint 2010 Foundation:
http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/53e79142-88c9-48f1-b5a5-a6259c9f6f97
http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/ec1e2e7e-2fcf-4d16-8c25-a44198b651d9
Solution:
1. Go to Start -> All Programs -> Microsoft SharePoint 2010 Products -> SharePoint 2010 Management Shell
2. When it is loaded you then run the following command to get your site collection object:
$site = Get-SPSite http://site_URL
3. If you don't get errors then execute the following commands one by one to set audit options and update it:
$site.Audit.AuditFlags = [Microsoft.SharePoint.SPAuditMaskType]::Update
$site.Audit.Update()
4. [Microsoft.SharePoint.SPAuditMaskType]::Update is a enum value of type SPAuditMaskType. You can have a look here for all possible values: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spauditmasktype.aspx
If you want to combine them then use -bxor in your script. Example for Delete and Update:
[Microsoft.SharePoint.SPAuditMaskType]::Update -bxor [Microsoft.SharePoint.SPAuditMaskType]::Delete
Enjoy. :)
That's exactly what I was looking for. Thanks.
ReplyDeleteThough I did not have any errors with the commands mentioned above, I am not sure how to use those. How does those commands enable auditing? Where do I find auditing enabled once I have run those commands?
ReplyDeleteHi
ReplyDeleteI'm using Sharepoint Foundation 2010
I followed your instructions, I didn't had any errors, but still I can't see the Audit Settings.
I'm the administrator. Also I tried the following command in my server :
STSADM.EXE -o activatefeature -name Reporting -url http://sitecollectionurl -force
who throws me the error: "Failed to find the XML file at location '14\Template\Features\Reporting\feature.xml"
Also I looked at Site collection administration section -> click on Site Collection Features -> Search for the Reporting feature, but the option: Reporting feature is not present.
Any ideas?