If you missed the pre-registration for NetApp MS Azure AD B2C, the new login prompt will offer the option to register. Please note that access to your NetApp data may take up to 1 hour.
To learn more, read the FAQ and watch the video.
Need assistance? Complete this form and select “Registration Issue” as the Feedback Category.

Active IQ Unified Manager Discussions

Slack Integration from WFA


Hi, I am looking at sending notifications from WFA into slack channels. So rather than using the current mail code I'll be looking at trying to write something to hit a slack channel. 


I'm wondering before I begin if anyone has something written already? I have an easy enough powershell script which does that but I'm learning how to invoke these in WFA atm. 





Hi Frazer,


It's possible in PowerShell (like this example) so it should be possible in WFA.

I would "guess" it's something like this (though I've not tested it):


   [Parameter(Mandatory=$True, HelpMessage="The slack URI")] 
   [Parameter(Mandatory=$True, HelpMessage="The slack hostname, FQDN or IP address for authentication")] 
   [Parameter(Mandatory=$True, HelpMessage="The slack channel name")] 
   [Parameter(Mandatory=$True, HelpMessage="The slack channel message")] 
   [Parameter(Mandatory=$True, HelpMessage="The slack channel icon")] 
#'Enumerate the slack credentials from the WFA credential cache.
$Credentials = Get-WFACredentials $HostName
[String]$userName = $Credentials.GetNetworkCredential().Username
$BodyTemplate = @"
      "channel": "$ChannelName",
      "username": "$userName",
      "text": "$Message. \nTime: DATETIME.",
#'Send the message to the slack channel.
   Invoke-RestMethod -uri $Uri -Method Post -body $body -ContentType "application/json" -Credential $Credentials -ErrorAction Stop
   Get-WFALogger -Info -Message "Sent message ""$Message"" to slack channel ""$ChannelName"" using URI ""$Uri"""
   Get-WFALogger -Error -Message $("Failed invoking URI ""$Uri"". Error " + $_.Exception.Message)
   Throw "Failed sending message ""$Message"" to slack channel ""$ChannelName"" using URI ""$Uri"""

In addition to the PowerShell code link, I would assume the REST POST method would require authentication hence i added the $HostName parameter which is used to retrieve a WFA credential object for invoking the REST API.

EG add a WFA credential using 'hooks.slack.com' and the username (EG #wfaslackbot)


Hope that helps



If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.