This seems like a simple question, but I want to make sure I understand. I have a powershell script that I've written that will automatically sign in to AzureAD and run a command that disables a setting on any Office 365 mailbox that is found with the setting in question enabled. I would like to only get a notification email if the script fails for some reason and not every time it runs successfully.
I was thinking about the notification setting 'send only when results change'. In my head it seems like this would work as it will only run against one server and assuming it is successful each time it runs then it would only send the notification email when it runs and changes from success status to failed status. Is that accurate? Is there an easier way to do this?