Bagikan melalui


Audit user access

 

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

Microsoft Dynamics 365 (online & on-premises) support the ability to audit user access. The information that is recorded includes when the user started accessing Microsoft Dynamics 365 and if access originated from the Microsoft Dynamics 365 web application, Dynamics 365 for Outlook, or SDK calls to the web services.

Enable user access auditing

Auditing of user access is enabled at the organization level. To enable or disable user access auditing, you must retrieve the target organization’s record, and update the Organization.IsUserAccessAuditEnabled attribute value for the organization. Global auditing on the organization must also be enabled by setting the Organization.IsAuditEnabled attribute to true in the organization record. To audit the origin of user access, for example: web application, Dynamics 365 for Outlook or SDK, you must enable auditing on the entities being accessed.

The frequency of auditing user access can be read or set using the Organization.UserAccessAuditingInterval attribute. The default attribute value of 4 indicates user access is audited once every 4 hours.

For more information about enabling auditing for an organization and entity, see Configure entities and attributes for auditing.

Filter on user access events

To search for audit records that are related to user access, your code should retrieve Audit records of an organization and filter on the value in Audit.Action. An enumeration named AuditAction is provided to identify supported audit actions. The actions related to user access are shown in the following list.

  • AuditAction.UserAccessviaWeb

  • AuditAction.UserAccessviaWebServices

  • AuditAction.UserAccessAuditStarted

  • AuditAction.UserAccessAuditStopped

UserAccessviaWeb indicates access from the Microsoft Dynamics 365 web application or Microsoft Outlook. UserAccessviaWebServices indicates a web service request from the SDK. The AuditAction enumeration is available to your code when you include SampleCode\CS\HelperCode\OptionSets.cs or SampleCode\VB\HelperCode\OptionSets.vb in your application’s project.

See Also

Audit entity data changes
Configure entities and attributes for auditing
Audit entity messages and methods
Sample: Audit entity data changes
Sample: Audit user access

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright