Skip to content

Instantly share code, notes, and snippets.

View Apoc70's full-sized avatar

Thomas Stensitzki Apoc70

View GitHub Profile
@Apoc70
Apoc70 / Clear-ADCDisabledMail.ps1
Last active October 25, 2021 12:56
This scripts clears the attribute legacyExchangeDN if set to ADCDisabledMail
# This script clears the legacyExchangeDN attribute of AD objects if the attribute is set to ADCDisabledMail
# Active Directory search base, adjust as needed for your AD
$SearchBase = 'DC=VARUNAGROUP,DC=DE'
# Our search filter
$Filter = 'legacyExchangeDN -eq "ADCDisabledMail"'
$csvFilename = 'ADCDisabledMail-Users.csv'
# Search for user objects matching the filter in the defined search base
@Apoc70
Apoc70 / Set-TLS12.ps1
Last active May 17, 2024 16:15
PowerShell script to enable TLS 1.2 in preparation for Entra ID Connect, and to disable legacy TLS for Exchange Server 2019.
param (
[switch]$DisableLegacyTls
)
# Last updated: 2024-02-21
if($DisableLegacyTls) {
# Disable TLS 1.0 and 1.1
# Following https://learn.microsoft.com/exchange/plan-and-deploy/post-installation-tasks/security-best-practices/exchange-tls-configuration?view=exchserver-2019&WT.mc_id=M365-MVP-5003086
# Disable TLS 1.0
@Apoc70
Apoc70 / Update-UPN.ps1
Last active October 25, 2021 07:00
Update UPN suffix for all users in preparation Azure AD Connect
# Update the User Principal Name for all User Objects
$CustomDomain = "mcsmemail.de"
# Add custom domain as suffix first
Get-ADForest | Set-ADForest -UPNSuffixes @{add=$CustomDomain}
# Update all user objects
Get-ADUser -Filter * -Properties SamAccountName | ForEach-Object { Set-ADUser $_ -UserPrincipalName ($_.SamAccountName + "@$($CustomDomain)" )}
@Apoc70
Apoc70 / SAN-Certificate-Request.inf
Created June 16, 2018 17:39
Beispiel einer .inf-Datei für die Erstellung eines SAN-Zertifikates
[Version]
Signature="$Windows NT$"
[NewRequest]
Subject = "CN=mail.varunagroup.de,OU=IT,O=Varunagroup AG,L=Berlin,S=BE,C=DE" ; Remove to use an empty Subject name.
Exportable = TRUE ; TRUE = Private key is exportable
KeyLength = 2048 ; Valid key sizes: 1024, 2048, 4096, 8192, 16384
KeySpec = 1 ; Key Exchange – Required for encryption
KeyUsage = 0xA0 ; Digital Signature, Key Encipherment
@Apoc70
Apoc70 / Single-Name-Certificate-Request.inf
Last active September 13, 2023 13:13
Beispiel einer .inf-Datei für die Erstellung eines Einzelnamen-Zertifikates
[Version]
Signature="$Windows NT$"
[NewRequest]
Subject = "CN=mail.varunagroup.de,OU=IT,O=Varunagroup AG,L=Berlin,S=BE,C=DE" ; Remove to use an empty Subject name.
Exportable = TRUE ; TRUE = Private key is exportable
KeyLength = 2048 ; Valid key sizes: 1024, 2048, 4096, 8192, 16384
KeySpec = 1 ; Key Exchange – Required for encryption
KeyUsage = 0xA0 ; Digital Signature, Key Encipherment