dsimport无法为计算机设置GeneratedUID

我正在将计算机填充到我们的Apple OpenDirectory(在10.5服务器上运行)。

我的脚本会输出这样的文件:

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 

然后导入它,如下所示:

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

由于我不明白的原因,它无法导入我设置的GeneratedUID字段。 相反,它自己创build一个。

当我看着这样的结果

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

我明白了

 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 

对于第一条logging,第二条logging的相关部分是,注意到我导出了为GeneratedUID字段和关键字字段生成的UUID I:

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

我可以手动更改设置使用dscl,但是,其他任何时候我已经设置了GeneratedUID(如用户和组),我没有问题。 任何想法,为什么这可能是?

[是的,我知道你通常不关心GeneratedUID是什么。 知道它使我的脚本更容易创build组。

我发现如果我按照上面指定的方式导入它,在覆盖模式下:

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

然后按照合并模式导入相同的文件:

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

我得到了预期的结果。 这让我觉得dsimport中有一个bug。