Skip to content

Instantly share code, notes, and snippets.

Avatar

Joerg Hochwald jhochwald

View GitHub Profile
@jhochwald
jhochwald / Graylog.conf
Created Feb 23, 2021
NGINX reverse proxy config for Graylog
View Graylog.conf
location / {
# Only Allow the Cloudflare Servers to use this URL (Not Scope)
include /etc/nginx/snippets/enatec_CloudFlareAllowlist.conf;
# Set some Default for Reverse Proxies (Not Scope)
include /etc/nginx/snippets/enatec_proxydefaults.conf;
# This is not required
add_header Front-End-Https on;
add_header Cache-Control "public, must-revalidate";
@jhochwald
jhochwald / Setup-SecretManagement.ps1
Created Feb 20, 2021
Install or update the Microsoft SecretManagement Module toolchain
View Setup-SecretManagement.ps1
#Requires -RunAsAdministrator
<#
.SYNOPSIS
Install or update the Microsoft SecretManagement Module toolchain
.DESCRIPTION
Install or update the Microsoft SecretManagement Module toolchain
If the Modules are not installed, the script will try to install them for all (AllUsers scope).
If the modules are installed, the script will try to update them.
@jhochwald
jhochwald / DisableDotNetTelemetry.sh
Last active Jan 31, 2021
Disable the .NET Telemetry on a MacOS server or workstation (Works on Linux as well)
View DisableDotNetTelemetry.sh
# Put this to the users .bashrc and/or .profile
# OR
# Put it into /etc/bashrc (On linux it might be /etc/bash.bashrc) and/or /etc/profile
#
# On Linux you might want to create a seperate shell script an put this into /etc/profile.d/ <- It is recommended to do that!
which dotnet > /dev/null 2>&1
if [ $? == 0 ]; then
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export MLDOTNET_CLI_TELEMETRY_OPTOUT=1
@jhochwald
jhochwald / DisableDotNetTelemetry.ps1
Created Jan 31, 2021
Disable the .NET Telemetry on production servers and critical workstations
View DisableDotNetTelemetry.ps1
# Disable the .NET Telemetry on production servers and critical workstations
[Environment]::SetEnvironmentVariable('DOTNET_CLI_TELEMETRY_OPTOUT', '1', 'Machine')
[Environment]::SetEnvironmentVariable('MLDOTNET_CLI_TELEMETRY_OPTOUT', '1', 'Machine')
# Tweak the 1st run experience
[Environment]::SetEnvironmentVariable('DOTNET_SKIP_FIRST_TIME_EXPERIENCE', '1', 'Machine')
@jhochwald
jhochwald / Initialize-ProtectionAlertSet.ps1
Created Jan 18, 2021
Create good practice Ruleset of Office 365 Protection Alert's
View Initialize-ProtectionAlertSet.ps1
function Initialize-ProtectionAlertSet
{
<#
.SYNOPSIS
Create good practice Ruleset of Office 365 Protection Alert's
.DESCRIPTION
Create good practice Ruleset of Office 365 Protection Alert's
You need a PowerShell connection to the Security and Compliance Center
@jhochwald
jhochwald / Initialize-ActivityAlertSet.ps1
Created Jan 18, 2021
Create good practice Ruleset of Office 365 Activity Alert's
View Initialize-ActivityAlertSet.ps1
function Initialize-ActivityAlertSet
{
<#
.SYNOPSIS
Create good practice Ruleset of Office 365 Activity Alert's
.DESCRIPTION
Create good practice Ruleset of Office 365 Activity Alert's
You need a PowerShell connection to the Security and Compliance Center
@jhochwald
jhochwald / Get-IPv6InWindows.ps1
Last active Jan 6, 2021
Manage the windows Pv6 configuration the easy way
View Get-IPv6InWindows.ps1
function Get-IPv6InWindows
{
<#
.SYNOPSIS
Get the configured IPv6 value from the registry
.DESCRIPTION
Get the configured IPv6 value from the registry
Transforms the Registry value into human understandable values
@jhochwald
jhochwald / Get-AllCookiesFromWebRequestSession.ps1
Created Jan 5, 2021
Get all cookies stored in the WebRequestSession variable from any Invoke-RestMethod and/or Invoke-WebRequest request
View Get-AllCookiesFromWebRequestSession.ps1
function Get-AllCookiesFromWebRequestSession
{
<#
.SYNOPSIS
Get all cookies stored in the WebRequestSession variable from any Invoke-RestMethod and/or Invoke-WebRequest request
.DESCRIPTION
Get all cookies stored in the WebRequestSession variable from any Invoke-RestMethod and/or Invoke-WebRequest request
The WebRequestSession stores useful info and it has something that some my know as CookieJar or http.cookiejar.
@jhochwald
jhochwald / FixPersonalSPOSite.ps1
Last active Feb 4, 2021
Provision new Users personal SharePoint site
View FixPersonalSPOSite.ps1
#requires -Version 3.0 -Modules AzureAD, Microsoft.Online.SharePoint.PowerShell
<#
.SYNOPSIS
Provision new Users personal SharePoint site
.DESCRIPTION
Provision new Users personal SharePoint site, Will also trigger the OneDrive provisioning.
.PARAMETER TenantName
Microsoft 365 Tenant name (e.g. contoso for contoso.onmicrosoft.com)
@jhochwald
jhochwald / ConvertFrom-SafeLinksURL.ps1
Created Nov 10, 2020
Decode a Office 365 Advanced Threat Protection SafeLinks URL
View ConvertFrom-SafeLinksURL.ps1
function ConvertFrom-SafeLinksURL
{
<#
.SYNOPSIS
Decode a ATP SafeLinks URL
.DESCRIPTION
Decode a Office 365 Advanced Threat Protection SafeLinks URL
.PARAMETER SafeLinksURL