Let's log the error, as well as email the user in case of errors. To do that, copy the log and email steps from the section Notifying the user in case of insufficient data or add new ones as follows:
- We will add a new Email Send action. In the To address field, we add the EmailID variable, along with a Subject and Message body, as shown in the following screenshot. In the Send email as property, choose Outlook:
- Also, add a Log File action to the ExecutionLog.txt file path with the text $System:Machine$- Error- $errorMessage$. User Creation Failed, as shown in the following screenshot:
That completes the configuration for the automation. Let's now run it with a file trigger.