einast / PS_M365_scripts

Public repository of scripts
8 stars 10 forks source link

Not sending anything to the webhook. #6

Closed monoael closed 2 years ago

monoael commented 2 years ago

First of all thank you for creating this as it is very helpful for our environment.

While we updated the script to work with graph and creating new api permissions it does not send anything to the teams channel even though there is no error.

einast commented 2 years ago

Hi, and thanks, good to hear that the script is useful.

Regarding no errors and no output, have you tried to adjust the time variable to a longer interval? If there are no new events within the defined time variable, the script will just exit with no error code. When I test, I normally adjust to a longer interval (for example to a few hours) to catch something that will be sent to a Teams channel.

monoael commented 2 years ago

Hi again.

Tried adjusting the time variable as well and dry running it and I am not getting any notifications, but we do also have duplicate notifications via email and that's where I see that for some reason something is not working.

Sending test messages to the webhook works as well.

einast commented 2 years ago

Ok, I need to look more into this, as soon as I am able to set aside some time.

Just to be sure, which of the scripts is causing the issue?

monoael commented 2 years ago

Thank you for your reply, this is the script "M365HealthStatus.ps1".

einast commented 2 years ago

I did some tests. It appears that there has been little issues from the Microsoft end (at least in my tenant, one entry from March 1st, then nothing since February 25th). Also make sure to include both incidents and advisories:

$Incident = 'yes' $Advisory = 'yes'

I increased the time window, and received the incidents and advisories.

monoael commented 2 years ago

Apologies for the late reply, but unfortunately I still cannot get it to work. As this works from your side I suspect it has something to do with the setup or something is messed up from Microsoft's part. I will re-create the solution from the beginning and see what happens. Thank you.