Andrey Cherepanov
2022-Aug-02 07:54 UTC
[Samba] Detect for OS version of Active Directory domain controller before join
I try to detect Windows 2003 as domain controller before join to it. Is there any way to do it? -- Andrey Cherepanov cas at altlinux.org
David Mulder
2022-Aug-02 14:11 UTC
[Samba] Detect for OS version of Active Directory domain controller before join
On 8/2/22 1:54 AM, Andrey Cherepanov via samba wrote:> I try to detect Windows 2003 as domain controller before join to it. Is > there any way to do it? >You can do a cldap ping and check the nt version. Simplest way might be to use the samba python code: from samba.net import Net from samba.dcerpc import nbt from samba.credentials import Credentials creds = Credentials() # Properly initialize your creds here address = '10.0.1.1' # Initialize your server address cldap_ret = net.finddc(address=address, flags=nbt.NBT_SERVER_LDAP | nbt.NBT_SERVER_DS) cldap_ret.nt_version # Here is the NT Version I think a Windows 2003 server will report NT Version 5.2. -- *David Mulder* Labs Software Engineer, Samba SUSE 1221 Valley Grove Way Pleasant Grove, UT 84062 dmulder at suse.com http://www.suse.com