SharePoint Dragons

Nikander & Margriet on SharePoint

Auditing in SharePoint Foundation?

Yes, you can, though it’s not supported via the GUI, see http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/53e79142-88c9-48f1-b5a5-a6259c9f6f97 for details:

. 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

The GUI also doesn’t offer the option to show the audit logs, so you need to do that like so:

$site.Audit.GetEntries()

Or check out the audit log enabler at http://auditlogsp.codeplex.com/ which apparently needs to be enhanced, like so (because it by default shows the results to all site members):

<CustomAction
Id=”ItemAuditing.ECBItemMenu”
RegistrationType=”ContentType”
RegistrationId=”0x01″
ImageUrl=”/_layouts/images/GORTL.GIF”
Location=”EditControlBlock”
Sequence=”300″
Title=”View Audit History”
Rights=”AddListItems”>
<UrlAction Url=”~site/_layouts/AuditingLog/ItemAudit.aspx?ItemId={ItemId}&amp;ListId={ListId}”/>
</CustomAction>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: