Skip to content

Instantly share code, notes, and snippets.

@jhochwald
Created June 2, 2024 14:19
Show Gist options
  • Save jhochwald/916412b0b11a3b761fffd0e77f5cd0d6 to your computer and use it in GitHub Desktop.
Save jhochwald/916412b0b11a3b761fffd0e77f5cd0d6 to your computer and use it in GitHub Desktop.
Block the Quick Assist Binary
# Intune Detection
if (!(Get-DnsClientNrptRule -ErrorAction SilentlyContinue | Where-Object -FilterScript {
($_.Namespace -eq 'remotehelp.microsoft.com')
}))
{
Write-Host -Object 'Namespace entry was not found'
exit 1
}
else
{
Write-Host -Object 'Namespace entry was found'
exit 0
}
# Intune Remediation
if (!(Get-DnsClientNrptRule -ErrorAction SilentlyContinue | Where-Object -FilterScript {
($_.Namespace -eq 'remotehelp.microsoft.com')
}))
{
Add-DnsClientNrptRule -Namespace 'remotehelp.microsoft.com' -NameServers '0.0.0.0' -Verbose -ErrorAction Stop -Confirm:$false
}
# Create the blocking policy
New-DenyWDACConfig -InstalledAppXPackages -PackageName 'MicrosoftCorporationII.QuickAssist' -PolicyName 'Quick Assist Block'
# Install the required module
Install-Module -Name WDACConfig
(Get-DnsClientNrptRule -ErrorAction SilentlyContinue | Where-Object -FilterScript {
($_.Namespace -eq 'remoteassistance.support.services.microsoft.com')
}) | Remove-DnsClientNrptRule -Force -Confirm:$false
# Break the domain name
if (!(Get-DnsClientNrptRule -ErrorAction SilentlyContinue | Where-Object -FilterScript {
($_.Namespace -eq 'remotehelp.microsoft.com')
}))
{
Add-DnsClientNrptRule -Namespace 'remotehelp.microsoft.com' -NameServers '0.0.0.0' -Verbose -ErrorAction Continue -Confirm:$false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment