Send Mail if there is an error in Task-Sequence

Target: Send mail / smsts.log if there is an error in a task-sequence to support or helpdesk

In one of my previous post I discripted howto “Copy the smsts.log to a network share during a task-sequence if there is any error in the task-sequence” -> I modified the last step -> to send a mail directly to the helpdesk if there was an error in the task-sequence.

I wrote a small GUI that will be shown if there was an error in a task-sequence. The tool automatically pre-fills the subject with the computername / the mail to from the config file and the mail-body.

This is the view in the task-sequence once an error occurs:

1

2

And the result in the mailbox of the helpdesk / or in the ticket system:

3

Download the tool from the following link: click here

The download includes the .exe file and a config xml file:

4

You need to adapt the config.xml with your configuration details:

5

Enter your smtp server with the port. Enter the mail details from: to:

If you set active to “no” that would mean that your SMTP-Server accepts mails from anonymous. In that case you can skip the username and password in the Config.xml

Enter the logshare name -> the once that is configured in the “Connect to Network Folder” step in the task-sequence.

Afterwards place both files in a package and deploy it to the required distribution-points and add the following step in the task-sequence in the part “Log Capture”:

6

7

There is one prerequisite – you need to active Windows Powershell Support in your boot image configured in the task-sequence.

8

Advertisement

Copy troubleshooting logs via “run a Script” ConfigMgr 1706

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!