Common mistakes with Samba-AD, tips and tricks

Error when provisioning

ERROR(<class 'samba.provision.ProvisioningError'>): Provision failed - ProvisioningError: guess_names: 'server role=auto' in /etc/samba/smb.conf must match chosen server role 'active directory domain controller'!  Please remove the smb.conf file and let provision generate it
File "/usr/lib64/python2.7/site-packages/samba/netcmd/domain.py", line 474, in run
   nosync=ldap_backend_nosync, ldap_dryrun_mode=ldap_dryrun_mode)
File "/usr/lib64/python2.7/site-packages/samba/provision/__init__.py", line 2046, in provision
   sitename=sitename, rootdn=rootdn, domain_names_forced=(samdb_fill == FILL_DRS))
File "/usr/lib64/python2.7/site-packages/samba/provision/__init__.py", line 619, in guess_names
   raise ProvisioningError("guess_names: 'server role=%s' in %s must match chosen server role '%s'!  Please remove the smb.conf file and let provision generate it" % (lp.get("server role"), lp.configfile, serverrole))

The /etc/samba/smb.conf file created by the installation of the distribution package has not been removed as described in the documentation.

wbinfo -c
net ads join -U administrator
net ads testjoin
wbinfo -t

Installing a schema extension in Samba-AD

ldbmodify -H /var/lib/samba/private/sam.ldb /root/schema.ldif --option="dsdb:schema update allowed"=true