I was able to run the on OMV 5.0.9-1 and connect to my 2012 server. There is a chicken and egg situation going on. When you save the smb extra settings you will get an error because it is not joined to the AD. Ignore it and run the script. Reboot and hit the apply button and it will work this time. Reboot again and the users should be there.
So the script works on OMV 3, 4 and 5. With windows server 2008, 2012 and 2016.