Skip to content

Instantly share code, notes, and snippets.

View DamagedDingo's full-sized avatar

DamagedDingo

  • Sydney, Australia
View GitHub Profile
@DamagedDingo
DamagedDingo / Defender_Test_Case.zsh
Created December 13, 2023 05:09
MacOS Defender Test Cases.
#!/bin/zsh
#https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/mac-install-manually?view=o365-worldwide
clear
# Check if real-time protection is enabled
if mdatp health --field real_time_protection_enabled > /dev/null; then
echo "Real-time protection is Enabled"
printf "Press Enter to continue..."
read -r
@DamagedDingo
DamagedDingo / detection.ps1
Created December 15, 2023 02:49
Intune Remediation Sample
if ( $(Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Policies\Google\Chrome\" -Name "BrowserSignin") -ne 2) ) {
# Not found, exit with 1 to trigger remidiation.
exit 1
}
else {
# Value found, exit 0
Write-Output "Some Output Must Be Written to STDOUT"
exit 0
}
@DamagedDingo
DamagedDingo / configuration.nix
Created January 10, 2024 11:17
Dell XPS 15 9550 - Not currently working
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
function Get-MsalTokenByCertificate {
[CmdletBinding()]
param(
[Parameter(Mandatory = $false)]
[switch]$ForceRefresh,
[Parameter(Mandatory = $false)]
[string]$tenantId,
[Parameter(Mandatory = $false)]
[string]$clientId,
[Parameter(Mandatory = $false)]
@DamagedDingo
DamagedDingo / Get-WindowsUpdateSettings.ps1
Last active September 22, 2024 11:20
Collect Windows Update Settings from a Client Device
<#
.SYNOPSIS
Retrieves Windows Update settings from the "current" and "default" registry paths for device update policies.
.DESCRIPTION
This function compares current Windows Update settings (from the current device registry path) with their default values (from the default device registry path). It displays the differences and optionally filters only configured settings in the policy. Empty or blank default values are replaced with a hyphen ("-") for better visibility. The settings are sorted alphabetically.
.PARAMETER IncludeProviderKeys
Includes keys with "_ProviderSet" and "_WinningProvider" suffixes in the output. These keys are usually omitted unless this parameter is provided.