查询Dynamics 365的Audit History

        static void Main(string[] args)
        {
            CrmServiceClient service = new CrmServiceClient("xxx");
            CrmServiceClient.MaxConnectionTimeout = new TimeSpan(0, 10, 0);

            EntityReference entityReference = new EntityReference("xxxx", new Guid("xxx"));
            ShowAttributeChangeHistory(service, entityReference, "xxx");
        }

        static void ShowAttributeChangeHistory(IOrganizationService svc,
            EntityReference target,
            string columnLogicalName)
        {
            RetrieveAttributeChangeHistoryRequest req =
                new RetrieveAttributeChangeHistoryRequest
                {
                    Target = target,
                    AttributeLogicalName = columnLogicalName,
                    PagingInfo = new PagingInfo
                    {
                        PageNumber = 1,
                        Count = 1,
                        ReturnTotalRecordCount = true
                    }
                };

            RetrieveAttributeChangeHistoryResponse resp =
                (RetrieveAttributeChangeHistoryResponse)svc.Execute(req);
            var auditDetailCollection = resp.AuditDetailCollection.AuditDetails.ToList();
            if (auditDetailCollection.Count > 0)
            {
                AttributeAuditDetail auditRecord = (AttributeAuditDetail)auditDetailCollection[0];
                Entity oldRecord = auditRecord.OldValue;
                Entity newRecord = auditRecord.NewValue;

                Console.WriteLine(newRecord.Contains("xxxx") ? newRecord["xxxxn"].ToString() : "");
                Console.WriteLine(oldRecord.Contains("xxxx") ? oldRecord["xxxx"].ToString() : "");
            }
  
        }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MySQL审计是一种记录和监控MySQL数据库操作的方法。可以通过配置MySQL审计插件来启用审计功能。可用的审计插件系统变量可以在mysql-audit的配置文档中找到。MySQL审计插件基于MySQL Server审计插件接口,并可记录每个用户在每个时刻的操作。虽然MySQL 5.7提供了安全审计插件,但缺点是日志信息较大,对性能有一定影响。如果你对MySQL审计有更高效的方法,可以与heng wang开发者分享意见。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [mysql审计配置 mysql-audit Configuration](https://blog.csdn.net/qq_32583639/article/details/117951762)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [mysql-audit:mysql-audit 是 MySQL Server 的一个插件。-开源](https://download.csdn.net/download/weixin_42164534/19896450)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [audit-plugin-mysql-5.7-1.1.7 for Linux](https://download.csdn.net/download/snjvery/85620346)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值