Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm populating machines into our Apple OpenDirectory (running on a 10.5 Server).

My script will output a file like this:

0x0A 0x5C 0x3A 0x2C dsRecTypeStandard:Computers 6 dsAttrTypeStandard:RecordName dsAttrTypeStandard:Comment dsAttrTypeStandard:ENetAddress dsAttrTypeStandard:GeneratedUID dsAttrTypeStandard:Keywords dsAttrTypeStandard:RealName 
XXX-1to1-47-Fai:Asset 01015:00\:19\:e3\:3c\:07\:28:1A964A90-ADB1-44D5-BA44-EE3B5C8255CA:1A964A90-ADB1-44D5-BA44-EE3B5C8255CA:XXX-1to1-47-Fai
XXX-1to1-20-Bre:Asset 01012:00\:19\:e3\:3e\:a1\:fb:D3083AFF-8B62-4D74-B483-68BF40F41069:D3083AFF-8B62-4D74-B483-68BF40F41069:XXX-1to1-20-Bre

and then import it, like this:

dsimport -g machines.txt "/LDAPv3/" "O" -u diradmin -p diradmin_password -y remote_host -yrnm diradmin -yrpwd diradmin_password

For reasons that I do not understand, it fails to import the GeneratedUID field that I set. Instead, it creates one itself.

When I look at the results like this

dscl -u diradmin -p remote_host -readall /LDAPv3/

I get

dsAttrTypeNative:apple-generateduid: 3247AAC8-CB4C-47B0-A97C-167722480C0E
dsAttrTypeNative:apple-keyword: D3083AFF-8B62-4D74-B483-68BF40F41069
dsAttrTypeNative:apple-ownerguid: 9DD42971-FD0D-4232-931C-FB42507B3185
dsAttrTypeNative:apple-realname: XXX-1to1-20-Bre
dsAttrTypeNative:cn: XXX-1to1-20-Bre
 Asset 01012
dsAttrTypeNative:gidNumber: 157380
dsAttrTypeNative:macAddress: 00:19:e3:3e:a1:fb
dsAttrTypeNative:objectClass: apple-computer top
AppleMetaNodeLocation: /LDAPv3/
 Asset 01012
ENetAddress: 00:19:e3:3e:a1:fb
GeneratedUID: 3247AAC8-CB4C-47B0-A97C-167722480C0E
Keywords: D3083AFF-8B62-4D74-B483-68BF40F41069
PasswordPlus: ********
PrimaryGroupID: 157380
RealName: XXX-1to1-20-Bre
RecordName: XXX-1to1-20-Bre
RecordType: dsRecTypeStandard:Computers

for the first record, and, the relevant part of the second record is, noting that I made it export the UUID I generated for both the GeneratedUID field and the Keywords field:

GeneratedUID: 13C81E32-F4C6-433F-AB62-54A801E25180
Keywords: 1A964A90-ADB1-44D5-BA44-EE3B5C8255CA

I can manually change the setting using dscl, but, any other time I've set the GeneratedUID (such as for Users and Groups), I have not had a problem. Any idea why this might be?

[Yes, I know you normally don't care about what the GeneratedUID is. Knowing it makes it easier for my script to create groups.]

share|improve this question
up vote 1 down vote accepted

I found that if I imported it as specified above, in overwrite mode:

dsimport -g machines.txt "/LDAPv3/" "O" -u diradmin -p diradmin_password -y remote_host -yrnm diradmin -yrpwd diradmin_password

and then followed that by importing the same file in merge mode:

dsimport -g machines.txt "/LDAPv3/" "M" -u diradmin -p diradmin_password -y remote_host -yrnm diradmin -yrpwd diradmin_password

that I get the desired results. It makes me think there is a bug in dsimport.

share|improve this answer
Nice work! – Chealion Sep 3 '09 at 4:49
It is nice to hear that; thank you. – Clinton Blackmore Sep 5 '09 at 22:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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