Samba 4 is a good bit of software. If only that last few tweaks could be done to finish it and the documentation off it would be great software. I have found lot of ways to set up Samba4 as a AD DC most of which fail to work only this one series of steps worked. Samba4 configuration is really really flaky! The official Samba documentation is getting better and beginning to cover some of the configuration pitfalls.
For this how to we are building on some of my other howtos.
In this part we will connect a Linux machine to the domain and then login with users configured with Active Directory. Therefore domain users will always have the same UID and GIDs regardless of the machine they log into.