CM 2010 Client Diagnostic - Log Collection not working

David Turner 96 Reputation points
2021-01-20T12:36:57.397+00:00

Hi folks,

I am trying to remotely collect client logs to investigate some current issues, but am unable to get the clients to send the logs.

Testing on a working client, I can see the log request arrive and the diagnostic.log but collection fails on the client updates as follows:

Collecting log files ...
PowerShell path: C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell.exe
GetAllCcmLogs: Non-zero exit code. 1.
GetAllCcmLogs: Failed. 0x80004005.

Checking the powershell log in the eventviewer shows the following for the powershell activity:

Error Message = Unexpected error occured while collecting diagnostic information.
Fully Qualified Error ID = Unexpected error occured while collecting diagnostic information.

Context:
Severity = Warning
Host Name = ConsoleHost
Host Version = 5.1.18362.1171
Host ID = f144278e-985e-401f-bfde-e8dede0cae7b
Host Application = C:\WINDOWS\system32\WindowsPowerShell\v1.0\PowerShell.exe -NonInteractive -NoProfile -ExecutionPolicy RemoteSigned -File C:\WINDOWS\CCM\datacollector.ps1
Engine Version = 5.1.18362.1171
Runspace ID = 4c7fdb73-4e9c-4d16-a21a-4c00409abbbd
Pipeline ID = 1
Command Name =
Command Type =
Script Name = C:\WINDOWS\CCM\datacollector.ps1
Command Path =
Sequence Number = 15
User = Domain\SYSTEM
Connected User =
Shell ID = Microsoft.PowerShell

User Data:

Any help or assistance appreciated.

Microsoft Configuration Manager
0 comments No comments
{count} votes

Accepted answer
  1. David Turner 96 Reputation points
    2021-03-29T09:58:41.583+00:00

    We have managed to resolve this issue, the \Windows\CCM\Logs folder was also hosting an additional subfolder for application installation logs ( \Windows\CCM\Logs\Folder which were created for fault finding), it is the presence of this additional folder and content that was causing the issue.

    Once this additional subfolder was removed this functionality worked correctly.


2 additional answers

Sort by: Most helpful
  1. Jason Sandys 31,161 Reputation points Microsoft Employee
    2021-01-20T17:18:09.517+00:00

    Exit code 1 with PowerShell can mean multiple things but is often because of the PowerShell execution policy. Thus, is there a domain-based execution policy set to All Signed applied to this system? IF so, then you need to add the certificate used to sign the script to Trusted Publishers. This is [briefly] called out at https://learn.microsoft.com/en-us/mem/configmgr/core/servers/manage/cmpivot#prerequisites.

    0 comments No comments

  2. David Turner 96 Reputation points
    2021-01-21T09:32:48.46+00:00

    Hi Jason,

    The current policy is not blocking the script from running and CMPivot is fully working, so this is not the current problem.