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.]