SCCM Run Script – Gather SCCM Log files for PowerShell v4 and earlier

I previously wrote a short post and did a demonstration video of the Run Scripts feature in Microsoft System Center Configuration Manager -

In that demo I used an example script created by Jörgen Nilsson which ran on the client, zipped up the SCCM log files folder and copied to back to a central file share. After some further testing with a slightly amended version of this I found that it was applicable only for machines running with PowerShell version 5 and newer as it uses the “Compress-Archive” cmdlet which is not available in older versions. This amended script uses a different method which is both forwards and backwards compatible so can be used with Windows 10 as well as your older systems.


I have uploaded the script to the Microsoft TechNet Gallery where you can download and test. Please do test this in your own environment before running it on any production systems, the risk is yours.

Guidance on how to use the run scripts feature can be found in my previous post as mentioned above. Let me know how you get on.