Password sync to external Windows AD never carries AES keys (only NT hash) for SAMR/kpasswd changes — same limit in AD Connector itself?

Hi all,

I’m looking for confirmation / best practice from the community on a
limitation we’ve confirmed empirically and in source code, before we
decide how to handle it with our customer.

Setup

UCS domain (currently 4.4, evaluating 5) that synchronizes user
password changes out to a separate external Microsoft Active
Directory belonging to a partner organisation (a hospital, in our
case) — two genuinely distinct domains/realms, not a “merge”
scenario. The sync is custom (samba-tool user syncpasswords +
password hash gpg key ids GPG cleartext capture + our own script),
not the official AD Connector, built before that product existed in
our environment.

The partner’s vendor has flagged that users synced this way only get
RC4/NTLM Kerberos keys on the external AD side, never AES — relevant
given Microsoft’s upcoming RC4 deprecation.

What we found

  1. GPG cleartext capture (password hash gpg key ids +
    samba-tool user syncpasswords --decrypt-samba-gpg) only ever
    fires for password changes written directly via LDB (e.g.
    samba-tool user setpassword, or an LDAP client supplying a
    cleartext userPassword/unicodePwd). It never fires for SAMR
    (smbpasswd -r, and — more importantly — genuine interactive
    Windows password changes, Ctrl+Alt+Del) or for Kerberos kpasswd
    changes. Those only ever produce unicodePwd (NT hash), no
    Primary:SambaGPG buffer.

  2. To rule out a config/UCS issue, we built a clean UCS 5.2-7 lab VM
    (Samba 4.24.2) from scratch, configured the same way, and
    reproduced the identical behaviour. So this isn’t a packaging bug
    on our 4.4 install, and it isn’t fixed in current Samba.

  3. We also installed univention-ad-connector (16.7.4) on that same
    lab VM purely to read its source
    (univention/connector/ad/password.py) and understand its
    password-sync mechanism. Two things stood out:

    • It doesn’t use any Windows-side password filter/DLL anymore —
      there’s a comment referring to that as “old AD-Connector
      password service?”, implying it used to exist but isn’t what’s
      shipped now.
    • Its current mechanism pulls secrets via DRS replication
      (DsGetNCChanges with DRSUAPI_EXOP_REPL_SECRET, i.e. the
      same technique as DCSync) when reading FROM an AD, which can
      retrieve already-computed AES keys (since real Windows AD
      computes those locally at genuine password-change time and
      DRS-replicates the already-computed secret). But in the
      opposite direction — writing a UCS-originated password change
      INTO an AD — it uses SAMR SetUserInfo level 18, i.e. NT hash
      only, with an explicit comment in the code: “we need to allow
      arc4 kerberos keys when we set a password through UCS, since
      that is the only keytype we can set.” So the official product
      has the exact same limitation we hit with our own script, for
      the exact same reason: AES key derivation requires the
      cleartext password at the point the target domain sets it (it’s
      a salted KDF, not derivable from the NT hash), and UCS/Samba
      never has the cleartext for SAMR- or kpasswd-originated changes
      to begin with.

Questions for the community

  • Is this understood/documented anywhere as an explicit limitation
    of AD Connector’s password sync (UCS → external AD direction), or
    is it just something nobody’s written up?
  • Does the “old AD-Connector password service” mentioned in the code
    comment still exist / get shipped anywhere (even as a legacy/
    deprecated component), and if so, did it actually solve this by
    capturing cleartext on the Windows side via a filter DLL? If it’s
    gone, was it removed deliberately, and why?
  • Has anyone here actually bridged two genuinely separate UCS/AD
    realms (not a same-domain “merge/absorb AD” scenario) and gotten
    AES keys to propagate correctly in both directions? If so, how?
  • Is there a supported/recommended way to at least get UCS to
    capture the cleartext for password changes coming in via SAMR or
    kpasswd (not just LDB-direct writes), so our own script (or AD
    Connector) would have something usable to push onward?

We’ve also raised the Samba-side question on the samba@lists.samba.org
list (archive: https://lists.samba.org/archive/samba/2026-October/253052.html)
since this ultimately traces back to Samba’s own password_hash
module, but wanted the UCS/AD-Connector-specific angle here too,
since it affects how we advise our customer going forward.

Thanks,

bb.