Scroll Top
Evotec Services sp. z o.o., ul. Drozdów 6, Mikołów, 43-190, Poland

PSBlackListChecker – Added Discord support

PSBlackListChecker Discord

It's been less than 24 hours since I've released PSBlackListChecker with support, among other improvements, for Microsoft Teams and Slack and I'm now adding Discord to the mix. Discord was a popular request (well not really, just one person asked, but let's pretend everyone loves PSBlackListChecker so much that they are too shy to ask for feature requests!).

PSBlackListChecker Information
Please notice this article contains parts of information (still useful) and may not reflect all functionalities of this module. For download, source code and so on you should refer to the dedicated PSBlackListChecker module page. After reading this one of course! It contains useful informationexamples, and know-how. Without it, you may not know all the features.
How to use PSBlackListChecker with Discord

There is merely a new section that shows up in the config file, and you will also have to do one little step of installing a module from PowerShellGallery.

#using module PSDsHook
Import-Module PSBlackListChecker

$EmailParameters = @{
    EmailFrom            = "[email protected]"
    EmailTo              = "[email protected]" #
    EmailCC              = ""
    EmailBCC             = ""
    EmailServer          = ""
    EmailServerPassword  = ""
    EmailServerPort      = "587"
    EmailServerLogin     = ""
    EmailServerEnableSSL = 1
    EmailEncoding        = "Unicode"
    EmailSubject         = "[Reporting] Blacklist monitoring"
    EmailPriority        = "Low" # Normal, High
}
$FormattingParameters = @{
    CompanyBranding   = @{
        Logo   = "https://evotec.xyz/wp-content/uploads/2015/05/Logo-evotec-012.png"
        Width  = "200"
        Height = ""
        Link   = "https://evotec.xyz"
        Inline = $false
    }
    FontFamily        = "Calibri Light"
    FontSize          = "9pt"
    FontHeadingFamily = "Calibri Light"
    FontHeadingSize   = "12pt"
}
$ReportOptions = @{
    MonitoredIps         = @{
        Ip1 = '89.25.253.1'
        Ip2 = '188.117.129.1'
        # you can add as many Ip's as you want / IP1,2,3,4,5 etc
    }
    NotificationsEmail   = @{
        Use                          = $false
        EmailPriorityWhenBlacklisted = 'High'
        EmailPriorityStandard        = 'Low'
        EmailAllResults              = $false
        EmailAlways                  = $true
        SortBy                       = 'IsListed' # Options: 'IP', 'BlackList', 'IsListed', 'Answer', 'FQDN
        SortDescending               = $true
    }
    # Module uses PSTeams - it comes embedded with PSTeams
    NotificationsTeams   = @{
        Use              = $false
        TeamsID          = ''
        MessageTitle     = 'IP Blacklisted'
        MessageText      = 'Everybody panic!'
        MessageImageLink = 'https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png'
        MessageButtons   = $true
    }
    # Module uses PSSlack - it comes embedded with PSBlackListChecker
    NotificationsSlack   = @{
        Use            = $false
        Channel        = '#general'
        Uri            = ""
        MessageTitle   = 'IP Blacklisted'
        MessageText    = 'Everybody panic!'
        MessageButtons = $true
        MessageEmoji   = ':hankey:'  # Emoji List https://www.webpagefx.com/tools/emoji-cheat-sheet/
        MessageAsUser  = 'PSBlackListChecker'
    }
    # Discord requires using module PSDsHook at the top
    # It also requires Install-Module PSDsHook
    NotificationsDiscord = @{
        Use              = $false
        Uri              = 'https://discordapp.com/api/webhooks/...'
        MessageImageLink = 'https://raw.githubusercontent.com/EvotecIT/PSTeams/master/Links/Asset%20130.png'
        MessageColor     = 'blue'
        MessageText      = 'Everybody panic!'
    }
}

Start-ReportBlackLists -EmailParameters $EmailParameters -FormattingParameters $FormattingParameters -ReportOptions $ReportOptions

If you're interested in Microsoft Teams or Slack, please visit PSBlackListChecker – Notifications to Microsoft Teams, Slack 0f Blacklisted IPs for more information.

Installing module from PowerShellGallery

To be able to use Discord with PSBlackListChecker you need to install an additional module from PowerShellGallery.

Install-Module -Name "PSDsHook" 

This module is open source (sources available on GitHub) and released by Mike Roberts. He was also so kind to add support for PowerShell 5.1 so we can enjoy this great module.

Posty powiązane