This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |