sb-ldif — batch ldif files processing utility.

      Active Directory provides a batch operation tool, called LDIFDE. LDIFDE allow to create, modify and delete the existing objects and extend an Active Directory schema.

      Ldif-file example:

dn: CN=mark, OU=Users, DC=contoso, DC=com 
changetype: add 
cn: mark
objectClass: user 
samAccountName: mark
      But, if instead of «dn: CN=mark, OU=Users, DC=contoso, DC=com», you write, say, in Russian «dn: CN=Сергей, OU=Users, DC=contoso, DC=com», then there is a surprise for you. The user will be added to the Active Directory, but instead of «Сергей», you will see the unreadable text. Eventually, the string contains the chars, other than those in the latin alphabet, must be at first encoded in UTF-8, then be encoded by base64 algorithm and afterwards after the parameter name in ldif file it is necessary to put the colon twice. Finally, it looks like this: «dn:: Q0490KHQtdGA0LPQtdC5LCBPVT1Vc2VycywgREM9Y29udG9zbywgREM9Y29t».

      Example of the ldif file (mark replaced by russian name — Сергей):

dn:: Q0490KHQtdGA0LPQtdC5LCBPVT1Vc2VycywgREM9Y29udG9zbywgREM9Y29t
changetype: add 
cn:: 0KHQtdGA0LPQtdC5
objectClass: user 
samAccountName:: 0KHQtdGA0LPQtdC5
      sb-ldif serves to encode/decode ldif-files, that contains the chars, other than those in the latin alphabet.

      Command line:

java -jar sb-ldif.jar -s <source dir or file> -d <dest dir or file> -m <mode: encode (default) | decode> -p <plain codepage> -e <encoded codepage> [-x <file ext (Default: ldif)>]

      Example:

java -jar .\lib\sb-ldif.jar -s d:\t1\sergey.ldif -d d:\t1\sergey1.ldif -p windows-1251 -e utf-8

      Download: sb-ldif-1.0.0.zip   

Common rules working with programs