17.5. Example Modification Statements を使用した LDIF ファイルの作成

dsctl ldifgen mod-load コマンドを使用して、更新操作が含まれる LDIF ファイルを作成します。

手順

  1. たとえば、/tmp/modifications.ldif という名前の LDIF ファイルを作成するには:

    # dsctl instance_name ldifgen mod-load --num-users 1000 --create-users --parent="ou=People,dc=example,dc=com" --mod-attrs="sn" --add-users 10 --modrdn-users 100 --del-users 100 --delete-users --ldif-file=/tmp/modifications.ldif

    このコマンドは、以下を実行するステートメントを 含む/tmp/modifications.ldif ファイルという名前のファイルを作成します。

    • 1000 の ADD 操作を含む LDIF ファイルを作成して、ou=People,dc=example,dc=com にユーザーエントリーを作成します。
    • sn 属性を変更して、すべてのエントリーを変更します。
    • 10 ユーザーエントリーを追加します。
    • 100 個の MODRDN 操作を実行します。
    • 100 エントリーの削除
    • 末尾の残りのエントリーをすべて削除します。

      詳細と、LDIF ファイルの作成に使用できるその他のオプションについては、以下を入力します。

      # dsctl instance_name ldifgen mod-load --help
  2. オプション: テスト項目をディレクトリーに追加します。

    # ldapadd -D "cn=Directory Manager" -W -H ldap://server.example.com -x -c -f /tmp/modifications.ldif