Target: Copy logs to troubleshoot OS-Deployments and Software-Deployments via “run a Script” in ConfigMgr 1706
With the release of ConfigMgr 1706 the feature to run Powershell Scripts was released. Sometimes it can be helpful to copy some logs to troubleshoot the OS-Deployment process or a Software-Deployment process. I created a small script which copys the smsts.log and some of the for me intressing Software-Deployment logs.
First step: create a network share and give everyone full-access.
Afterwards you can go in ConfigMgr to the Scripts section and create your script:
Script-Content:
pushd \\server\smstslogs$
new-item $env:computername -ItemType directory -Force
cd $env:COMPUTERNAME
Copy-Item $env:windir\CCM\Logs\smsts* -Force
Copy-Item $env:windir\CCM\Logs\app* -Force
Copy-Item $env:windir\ccmsetup\Logs\ccmsetup* -Force
Copy-Item $env:windir\Logs\Software\* -Force
Save the script – and approve it afterwards:
Then you can run the script against any collection you need / select the collection and select “Run Script”
Select your script and run it against your collection:
The result will look the following / on your network share you will find for each device which is online a new folder and the logs included:
Done!