Skip to content

Instantly share code, notes, and snippets.

View jhochwald's full-sized avatar
🤙

Joerg Hochwald jhochwald

🤙
View GitHub Profile
@jhochwald
jhochwald / Set-MicrosoftNewWhiteboardOwner.ps1
Created March 14, 2021 12:31
Set the owner for a a given Microsoft Whiteboard
#requires -Version 3.0 -Modules AzureAD, WhiteboardAdmin
function Set-MicrosoftNewWhiteboardOwner
{
<#
.SYNOPSIS
Set the owner for a a given Microsoft Whiteboard
.DESCRIPTION
Set the owner for a a given Microsoft Whiteboard
@jhochwald
jhochwald / Search-MailboxItemDeletion.ps1
Last active April 29, 2022 15:06
Search for deletions in mailboxes, single or all
function Search-MailboxItemDeletion
{
<#
.SYNOPSIS
Search for deletions in mailboxes
.DESCRIPTION
Search for deletions in mailboxes, single or all
.PARAMETER Days
@jhochwald
jhochwald / Graylog.conf
Created February 23, 2021 16:37
NGINX reverse proxy config for Graylog
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 February 20, 2021 15:15
Install or update the Microsoft SecretManagement Module toolchain
#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 January 31, 2021 17:51
Disable the .NET Telemetry on a MacOS server or workstation (Works on Linux as well)
# 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 January 31, 2021 17:32
Disable the .NET Telemetry on production servers and critical workstations
# 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 January 18, 2021 18:00
Create good practice Ruleset of Office 365 Protection Alert's
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 January 18, 2021 17:59
Create good practice Ruleset of Office 365 Activity Alert's
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 January 6, 2021 14:47
Manage the windows Pv6 configuration the easy way
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 January 5, 2021 23:34
Get all cookies stored in the WebRequestSession variable from any Invoke-RestMethod and/or Invoke-WebRequest request
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.