SPAudit.WriteAuditEvent method (String, String, Int32, String)

Writes the audit entry with customized user ID.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public bool WriteAuditEvent(
	string eventName,
	string eventSource,
	int userId,
	string xmlData
)

Parameters

eventName
Type: System.String

The event name.

eventSource
Type: System.String

The name of the calling application.

userId
Type: System.Int32

The customized user ID.

xmlData
Type: System.String

The information about the event.

Return value

Type: System.Boolean
true if the event was recorded successfully; otherwise, false.

Only the System Account will be able to specify the user ID. All other users trying to specify different IDs from their own will be regarded as spoofing and be terminated.

Show: