Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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/127.0.0.1" "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/127.0.0.1/Computers

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
dsAttrTypeNative:description:
 Asset 01012
dsAttrTypeNative:gidNumber: 157380
dsAttrTypeNative:macAddress: 00:19:e3:3e:a1:fb
dsAttrTypeNative:objectClass: apple-computer top
AppleMetaNodeLocation: /LDAPv3/127.0.0.1
Comment:
 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

1 Answer 1

up vote 1 down vote accepted

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

dsimport -g machines.txt "/LDAPv3/127.0.0.1" "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/127.0.0.1" "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

 
discard

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.