您可以使用 DSCC 執行此作業。如需相關資訊,請參閱目錄服務控制中心介面與 DSCC 線上說明。
根據 RFC 4517 中所指定的語法,備妥您的屬性類型定義。
使用 ldapmodify(1) 指令,增加您的屬性類型定義。
請注意,目錄伺服器會將 X-ORIGIN 'user defined' 增加到您所提供的定義中。
下列範例使用 ldapmodify 指令,增加使用「目錄字串」語法的新屬性類型。
$ cat blogURL.ldif dn: cn=schema changetype: modify add: attributeTypes attributeTypes: ( 1.2.3.4.5.6.7 NAME ( 'blog' 'blogURL' ) DESC 'URL to a personal weblog' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE ) $ ldapmodify -D cn=admin,cn=Administrators,cn=config -w - -f blogURL.ldif Enter bind password: modifying entry cn=schema $ |
在生產環境中,您必須提供有效且唯一的 OID,而非 1.2.3.4.5.6.7。