0 votes

I'm trying to setup a quick automations to drop a notification into a Micrsoft Teams feed using their Webhook integration. I've managed to make Webhooks work before using Pushcut for iOS but this one doesn't work.

This script runs 'Succsessfully' and simply copying this script into PS and runnning it works fine, posting the message to the Micrsoft Teams chat, am I missing something to make this work via Adaxes?

$uri = "https://outlook.office.com/webhook/%%%%%%%"


$body = ConvertTo-Json -Depth 4 @{
    title = '%param-notificationtype%: %fullname%'
    text = "Adaxes has completed %param-notificationtype% actions"
    sections = @(
        @{
            activityTitle = '%fullname%'
            activitySubtitle = '%department%'
            activityText = '%company%'
            activityImage = '%thumbnailPhoto%'
        },
        @{
            title = 'Details'
            facts = @(
                @{
                name = 'Email'
                value = '[%mail%](mailto:%mail%)'
                },
                @{
                name = 'Incident Number'
                value = '[%adm-CustomAttributeText18%](#URL)'
                }
            )
        }
    )
    potentialAction = @(@{
            '@context' = 'http://schema.org'
            '@type' = 'ViewAction'
            name = 'Click here to complete %param-notificationtype%'
            target = @('#URL')
        })
}


Invoke-RestMethod -uri $uri -Method Post -body $body -ContentType 'application/json'

Any assistance with this would be gratefully received

by (260 points)
+1

Hello Richard,

For troubleshooting purposes, could you, please, clarify what control (e.g. checkbox) is used to specify the param-notificationtype parameter value and what values can be specified there? If it is a drop-down, post here or send us (support[at]softerra.com) a screenshot of the parameter configuration. We need something like the following: image.png

Also, please, confirm that you check the notification in the same channel that is specified for the $uri variable.

0

The script now works for some reason.

The param-notificationtype is a dropdown list with a few text options

0

Hello Richard,

Thank you for the confirmation, it is much appreciated! Should the issue reoccur, provide us with all the possible details. Screenshots would be much appreciated.

Please log in or register to answer this question.

Related questions

0 votes
1 answer

The script create two reports of inactive workstation operating systems. The report is too detailed to run from one of the adaxes reports. Basically how can I set the script up to ... sure How I did this but I can't find it now (probably something simple).

asked Nov 30, 2022 by mightycabal (1.0k points)
0 votes
1 answer

Is there a way for Adaxes to use a user's Microsoft 365 profile pictures instead of having to select a file on a per user basis?

asked Feb 1 by keneth.figueroa (20 points)
0 votes
1 answer

Receive "Index operation failed; the array index evaluated to null. Stack trace: at <ScriptBlock>, <No file>: line 104>" and "Index operation failed; the ... $GroupName, $GroupDN." } } #foreach write-output "" Write-Output "" Stop-Transcript

asked Apr 14, 2022 by jbahou (20 points)
0 votes
0 answers

Good Afternoon, I'm looking for some clarification on what security settings I would need to apply to the Self-Service Users to allow them to update both their own ... accounts they have full access to. Please let me know if this requires more clarification.

asked Jul 22, 2021 by jtop (700 points)
0 votes
1 answer

Hello, we want to setup a scheduled report with all our teams (security groups) and their respective team-leader (specified in "managedBy" of security group). I get the name of ... the team-leader. And this is my problem... Can you help me with this problem?

asked Oct 9, 2020 by lohnag (160 points)
3,588 questions
3,277 answers
8,303 comments
548,080 users