Skip to content

Instantly share code, notes, and snippets.

View jhochwald's full-sized avatar
🤙

Joerg Hochwald jhochwald

🤙
View GitHub Profile
@jhochwald
jhochwald / Windows Defender Exclusions VS 2022.ps1
Last active November 21, 2022 13:20 — forked from Braytiner/Windows Defender Exclusions VS 2022.ps1
Adds Windows Defender exclusions for Visual Studio 2022
$pathExclusions = (New-Object -TypeName System.Collections.ArrayList)
$processExclusions = (New-Object -TypeName System.Collections.ArrayList)
$null = $pathExclusions.Add($env:windir + '\Microsoft.NET')
$null = $pathExclusions.Add($env:windir + '\assembly')
#$null = $pathExclusions.Add($env:USERPROFILE + '\Downloads\HeidiSQL_11.3_64_Portable')
$null = $pathExclusions.Add($env:USERPROFILE + '\.dotnet')
$null = $pathExclusions.Add($env:USERPROFILE + '\.nuget')
@jhochwald
jhochwald / ModuleFast.ps1
Last active November 10, 2022 19:43 — forked from JustinGrote/ModuleFast.ps1
A high performance Powershell Gallery Module Installer
#requires -version 4.0
<#
.SYNOPSIS
High Performance Powershell Module Installation
.DESCRIPTION
This is a proof of concept for using the Powershell Gallery OData API and HTTPClient to parallel install packages
It is also a demonstration of using async tasks in powershell appropriately. Who says powershell can't be fast?
This drastically reduces the bandwidth/load against Powershell Gallery by only requesting the required data
<#
.SYNOPSIS
Scan for CVE-2022-3602 vulnerable versions of OpenSSL
.DESCRIPTION
Scan for CVE-2022-3602 vulnerable versions of OpenSSL
.PARAMETER All
Scan for all versions or just for vulnerable versions of OpenSSL
@jhochwald
jhochwald / PowerShell_PSTypeNames_and_custom_FormatData.ps1
Created December 29, 2021 17:02
Set the Default Property Display in PowerShell on Custom Objects - Sample code for a blog post
<#
.SYNOPSIS
Set the Default Property Display in PowerShell on Custom Objects
.DESCRIPTION
Set the Default Property Display in PowerShell on Custom Objects
Sample code for a blog post
.EXAMPLE
PS C:\> .\PowerShell_PSTypeNames_and_custom_FormatData.ps1
@jhochwald
jhochwald / Invoke-MitigatePrinterHell.ps1
Created July 2, 2021 00:27
Mitigate CVE-2021-1675 related issues By disabling the printer spooler on all servers in a AD Domain
<#
.SYNOPSIS
Mitigate CVE-2021-1675 related issues
.DESCRIPTION
Disable the printer spool on all servers within a Domain.
You need admin permission and PowerShell needs to be configured and
enabled for the user that executes the script.
.EXAMPLE
@jhochwald
jhochwald / Invoke-EnableLoggingToFindPrinterHell.ps1
Created July 2, 2021 00:25
Configure the logging to find CVE-2021-1675 related incidents
<#
.SYNOPSIS
Configure the logging to find CVE-2021-1675 related incidents
.DESCRIPTION
Configure the logging to find CVE-2021-1675 related incidents
.EXAMPLE
PS C:\> .\Invoke-EnableLoggingToFindPrinterHell
@jhochwald
jhochwald / Get-MobileDeviceReporting.ps1
Created April 7, 2021 20:57
Get a basic report of Mobile Devices connected to the Microsoft 365 Tenant
#requires -Version 3.0 -Modules ExchangeOnlineManagement
<#
.SYNOPSIS
Get a basic report of Mobile Devices
.DESCRIPTION
Get a basic report of Mobile Devices connected to the Microsoft 365 Tenant
.EXAMPLE
PS C:\> .\Get-MobileDeviceReporting.ps1
@jhochwald
jhochwald / Get-OneDriveUsageReport.ps1
Created April 7, 2021 19:13
Generates a basic usage report for OneDrive for Business sites
#requires -Version 3.0 -Modules Microsoft.Online.SharePoint.PowerShell
<#
.SYNOPSIS
Generates a basic usage report for OneDrive for Business sites
.DESCRIPTION
Generates a basic usage report for OneDrive for Business sites
The report will contain the following information:
- Owner (UPN)
@jhochwald
jhochwald / ADMX–OneDrive.admx-KFM.json
Last active April 6, 2021 00:31
Import an Enpoing Manager (Intune) Device configuration from an existing JSON File
{
"@odata.type": "#microsoft.graph.windows10CustomConfiguration",
"id": "f2d6ce45-3bc7-4584-b391-120aa53eabea",
"lastModifiedDateTime": "2018-09-09T13:47:31.4040135Z",
"createdDateTime": "2018-07-07T14:21:22.3292533Z",
"description": "",
"displayName": "ADMX - OneDrive - KFM.admx",
"version": 7,
"omaSettings": [
{
@jhochwald
jhochwald / invoke-ExchangeSafetyRules.ps1
Created April 5, 2021 19:49
Deploying Exchange Online security and spoofing warnings rules
#requires -Version 3.0 -Modules ExchangeOnlineManagement, MSOnline
<#
.SYNOPSIS
Deploying Exchange Online security and spoofing warnings rules
.DESCRIPTION
Deploying Exchange Online security and spoofing warnings rules
.EXAMPLE