How do I query the security attributes for an AD object ...

Richard Sharpe realrichardsharpe at
Fri Apr 15 23:10:27 UTC 2016

On Fri, Apr 15, 2016 at 1:40 PM, Richard Sharpe
<realrichardsharpe at> wrote:
> Hi folks,
> How can I query the security attributes associated with an account in
> LDAP ... permissions etc?

To respond to my own query:

import ldap
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, 0)
ldap_connection.simple_bind_s("somedom\\administrator", "somepassword")
res = ldap_connection.search_s("CN=Computers,DC=somedom1,DC=somedom2,DC=dom1,DC=dom2,DC=com",
ldap.SCOPE_SUBTREE, "(cn=some-name)",['nTSecurityDescriptor'])

Richard Sharpe

More information about the samba-technical mailing list