sccm/sql query

Vijayaguru M 41 Reputation points


Can anyone help me with SCCM/SQL query based on error code found in Policyagent.log eg. 0x87d00231 (-2016411087). I need to find the machines which have that above error code and we need to reinstall sccm client only those machines.

I can find the query based on Update compliance error codes but not with policyagent.


Microsoft Configuration Manager
0 comments No comments
{count} votes

Accepted answer
  1. Youssef Saad 3,401 Reputation points

    Hi @Vijayaguru M ,

    You can try using the following CMPivot query:

    CcmLog('PolicyAgent') | where (LogText like '%0x87d00231%') | distinct Device


    Once you have the list of devices, you can create a collection from the CMPivot also then follow your troubleshoot.


    Youssef Saad | Blog:
    Please remember to ** “Accept answer” ** or upvote for useful answers, thank you!

2 additional answers

Sort by: Most helpful
  1. Jason Sandys 31,186 Reputation points Microsoft Employee

    You're not going to find this as it's nothing that is collected centrally although you may be able to use CMPivot or a PowerShell script deployed using a baseline. However, the error code literally means "Transient error" which is indicative of an issue with the client system having problems communicating with the site and is also often at the network layer so even if this information was collected, the client wouldn't be able to send it to the site anyway or download policies for a baseline so you're still stuck. Reinstalling the client agent is almost certainly not going to resolve this issue here as the issue is a communication issue between the client the MP. You need to troubleshoot the root cause here of the transient issue here.

  2. AllenLiu-MSFT 42,746 Reputation points Microsoft Vendor

    Hi, @Vijayaguru M
    Thank you for posting in Microsoft Q&A forum.
    0x87d00231 is a fairly generic error message that pretty much just means "something went wrong".
    When you find this error on clients, you may check CcmMessaging.log on those clients for more details.
    And since the error code is not a final results, it will not be recorded in SCCM database like update compliance error, so no sql query can do this.

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.