Skip to content

Instantly share code, notes, and snippets.

View joshwright10's full-sized avatar

Josh Wright joshwright10

View GitHub Profile
[string]$MailServerName = "smtp.server01.org.com"
[string]$FromAddress = "Reports@example.com"
[string]$HTML = "Test Message"
[string]$MessageSubject = "Test Email"
[string[]]$ToAddress = "User1@example.com", "User2@example.com", "User3@example.com"
# Prepare email and attach file.
$FullEmail = @{
To = @($ToAddress)
Body = "$HTML"
@joshwright10
joshwright10 / Get-PerUserFirewallRulesBlueJeans.ps1
Created January 31, 2019 13:51
Windows Firewall Per User Rules (BlueJeans)
# Description: Checks that Windows Firewall rules exist for all users that currently have active sessions.
#
$ProgramPath = "appdata\local\bluejeans\current\bluejeans.exe"
Write-Verbose -Message "Getting all firewall rules that have exceptions for: $($ProgramPath)"
$CurrentRules = Get-NetFirewallApplicationFilter -Program "*$ProgramPath" -PolicyStore PersistentStore -ErrorAction Ignore | Get-NetFirewallRule -ErrorAction Ignore
Write-Verbose -Message "Getting all logged on users"
$LoggedOnUsers = @()