im new to samba but I figured it all out and when I run your script I get some errors like this one
http://prntscr.com/4qk8u9

please help