Skip to content

Instantly share code, notes, and snippets.

@clutch70
clutch70 / Fix-AzureUserSync.ps1
Last active January 12, 2023 20:46
Sets the required params for AD to Azure user sync
#EXAMPLE
#.\Fix-AzureUserSync.ps1 -azSam azureUsername -adSam adUsername -emailDomain test.com
param (
[Parameter(Mandatory=$false)][string]$azSam,
[Parameter(Mandatory=$false)][string]$adSam,
[Parameter(Mandatory=$false)][string]$emailDomain,
[Parameter(Mandatory=$false)][switch]$help
)
@clutch70
clutch70 / ldap-auth.py
Created October 4, 2022 22:27 — forked from rechner/ldap-auth.py
LDAP Auth script for HomeAssistant
import os
from ldap3 import Server, Connection, ALL, core
# XXX: Update these with settings apropriate to your environment:
# (I use FreeIPA and an homeassistant group assignment)
SERVER = "ipa.example.com"
USERDN = "uid={},cn=users,cn=accounts,dc=example,dc=com"
TIMEOUT = 3
BASEDN = USERDN
SCOPE = "base"