Files
Intune/intune/Externally Sourced Remediations/ToastNotifications/Get-FirewallStatus/Remediate_FirewallStatus.ps1
2025-05-19 15:19:36 -04:00

16 lines
933 B
PowerShell

# Define the toast notification content
$Group = "Security Alerts"
$Title = "Firewall Disabled"
$Message = "Your firewall is currently disabled. Please enable it to protect your system from threats."
# Create the toast notification
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
$template = [Windows.UI.Notifications.ToastTemplateType]::ToastText02
$toastXml = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent($template)
$toastTextElements = $toastXml.GetElementsByTagName("text")
$toastTextElements.Item(0).AppendChild($toastXml.CreateTextNode($Title)) | Out-Null
$toastTextElements.Item(1).AppendChild($toastXml.CreateTextNode($Message)) | Out-Null
$toast = [Windows.UI.Notifications.ToastNotification]::new($toastXml)
$notifier = [Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($Group)
$notifier.Show($toast)