Fedora-28 box: Joined to ad using 'net ads join -U <>' # net ads testjoin Join is OK # samba-tool domain level show ERROR(ldb): uncaught exception - ldb_search: invalid basedn '(null)' File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py", line 176, in _run return self.run(*args, **kwargs) File "/usr/lib64/python2.7/site-packages/samba/netcmd/domain.py", line 1055, in run scope=ldb.SCOPE_BASE, attrs=["msDS-Behavior-Version"]) # samba-tool domain level raise --domain-level=2012_R2 --forest-level=2012_R2 ERROR(ldb): uncaught exception - ldb_search: invalid basedn '(null)' File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py", line 176, in _run return self.run(*args, **kwargs) File "/usr/lib64/python2.7/site-packages/samba/netcmd/domain.py", line 1055, in run scope=ldb.SCOPE_BASE, attrs=["msDS-Behavior-Version"]) On Window's 2008 AD: PS C:\Users\root.ATEST> $dse = ([ADSI] "LDAP://RootDSE") PS C:\Users\root.ATEST> PS C:\Users\root.ATEST> # Domain Controller Functional Level PS C:\Users\root.ATEST> $dse.domainControllerFunctionality 4 PS C:\Users\root.ATEST> PS C:\Users\root.ATEST> # Domain Functional Level PS C:\Users\root.ATEST> $dse.domainFunctionality 4 PS C:\Users\root.ATEST> PS C:\Users\root.ATEST> # Forest Functional Level PS C:\Users\root.ATEST> $dse.forestFunctionalit Even # man samba-tool does not guides how to use 'domain level show|raise' correctly. What are prerequisites of using it.
This isn't really a samba-tool problem, it is a samba-tool command misconfiguration, not helped by the fact that the samba-tool manpage doesn't mention '-H URL, --URL=URL'. The lack of the URL is why Amit's attempt to use 'samba-tool domain level show' failed. The fix would have been to run 'samba-tool domain level show --help' which would have shown (amongst others) this: -H URL, --URL=URL LDB URL for database or target server However, the samba-tool manpage does need fixing.