Our Unix team often uses Samba to join machines to the domain. The command they have traditionally used is:

net join ADS -w [domain name] -U [username]

I am one of our AD admins and I am trying to find out how to get them to be able to join to a specific OU so we can have all of the Samba machines organized in AD. From all of my research, it seems that this should work:

net join ads "Servers/Samba" -w [domain] -U [username] 

This still allows the machine to join to the domain without issue but it keeps ending up in the 'computers' container and we receive no errors.

I have made sure on the AD side that the user they are using have join domain rights and create/delete computer objects on both the "servers" OU tree and the "computers" container.

What am I missing? I can't find much documentation on the Samba net commands without having access to a unix box with it. Also, I noticed in most examples people always had 'net ads join...' rather than 'net join ads...' - our Unix admin got errors when trying to use net ads join. I do not know why our syntax seems different then most examples I found but I wanted to point it out.

Here are some sites that support my research: https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/domain-member.html http://www.members.optushome.com.au/~wskwok/poptop_ads_howto_6a.htm


Had same issue with Latest version of Centos (7) and Active Directory 2012. When using 'net rpc join' the system always goes into the Domain Computers OU. samba-winbind is 4.1.1. didn't have samba installed bc shouldn't need it. didn't make a difference after installing it.

Got it to work by changing from net rpc join to net ads join net ads join -U <user> --server=<server> createcomputer=Servers

I get DNS errors but I'll work on those separately.


After going back and forth with our Unix guy I decided to set Samba up on a test box I had and eventually got it to work with the following command:

Net ads join -w [DOMAIN] -U [username] createcomputer="servers/samba"

I had to also configure some sections of /etc/samba/smb.conf - I am not sure which of them are required but they were:

Workgroup = CONTOSO

security = ads

realm = contoso.com

Password server = DC.contoso.com

Sever role = member server

*hint if it doesn't exist, create it under the global section of the file


The Unix guy tried my command and got "ADS support not compiled in". This is most likely because I am using Samba 4.1.6 and he is using 3.6 or 7 something.

At this point we either need to upgrade Samba or figure out how to compile Samba so that it supports ADS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.