Skip to content

Instantly share code, notes, and snippets.

@M507
Created November 4, 2020 21:00
Show Gist options
  • Save M507/2cfd42a3448568fe479006158f4b2443 to your computer and use it in GitHub Desktop.
Save M507/2cfd42a3448568fe479006158f4b2443 to your computer and use it in GitHub Desktop.
Windows auth notifier - Slack
$out = 'Info: '+ (whoami) + ' logged into ' + (hostname)
$body = @(
@{
text = $out
}
)
$JSON = $body | ConvertTo-Json
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-RestMethod -Uri "[Webhook URL]" -Method Post -Body $JSON -ContentType "application/json"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment