[Samba] machine accounts

Rowland Penny rowlandpenny at googlemail.com
Thu Dec 4 10:50:50 MST 2014


On 04/12/14 17:30, jacek burghardt wrote:
> I am looking a way to pre create machine account on samba domain. Let 
> say workstation name is mediapc2 and I want it pre added to my samba 
> so user can auto join domain like it is posible on windows server side.
> I have openchange and sogo working just fine except for annoying an 
> error occurred when caching value for key

OK, to precreate a computer in samba4 AD, create an ldif:

dn: CN=<uppercase_computername>,CN=Computers,DC=example,DC=com
changetype: add
objectClass: computer
cn: <uppercase_computername>
distinguishedName: 
CN=<uppercase_computername>,CN=Computers,DC=example,DC=com
objectCategory: CN=Computer,CN=Schema,CN=Configuration,DC=example,DC=com
instanceType: 4
displayName: <uppercase_computername>$
name: <uppercase_computername>
userAccountControl: 4096
codePage: 0
countryCode: 0
accountExpires: 0
sAMAccountName: <uppercase_computername>$
dNSHostName: <computername>.example.com
servicePrincipalName: HOST/<uppercase_computername>
servicePrincipalName: HOST/<computername>.example.com

Where your domain is 'example.com'

replace <computername> with the short hostname of the computer you want 
to create.
replace <uppercase_computername> with short hostname in UPPERCASE.

Now add it to AD with ldbadd:

ldbadd --url=/var/lib/samba/private/sam.ldb /path/to/your/ldif


Rowland





More information about the samba mailing list