Layer 7 Identity Management

Expand all | Collapse all

Handle local characters in etautil

Jump to Best Answer
  • 1.  Handle local characters in etautil

    Posted 09-15-2017 09:42 AM

    Hello,

     

    We have a batch file which contains etautil scripts to do certain activities like explore account/sync users/assign role etc. We execute this batch file and etautil commands are loaded in command prompts.

     

    Iit has been observed whenever a reference to account/role is made where local characters are involved, the characters are loaded incorrectly which causes script to fail. We have tried to run such entries directly typing on command prompt, even then it does not work.

     

    Can anyone assist us here ?

     

    Here is sample:-

     

    eTADSAccountName=Søren Wittchen Holm

     

    This is not recognized when running the same in command prompt.

     

    Thanks,
    Shashank



  • 2.  Re: Handle local characters in etautil

     
    Posted 09-16-2017 01:12 AM

    Have you tried putting the value in double quotes? eTADSAccountName="Søren Wittchen Holm"



  • 3.  Re: Handle local characters in etautil

    Posted 09-16-2017 01:15 PM

    Hello,

     

    Yes we had tried this , but this also did not work for us.

     

    Thanks,

    Shashank



  • 4.  Re: Handle local characters in etautil
    Best Answer

    Posted 09-17-2017 04:03 AM

    Hello Shashank,

     

    This issue is due to the default code page in use into your MS command shell.
    Type "mode con cp" or "chcp" from a dos prompt box; You will get the active CP.
    By instance 437 for the United States.
    Such a CP as 437 works fine with characters inside of the ASCII range of 0-127.
    It is problematic outside of this range.
    There are 2 solutions for this issue.
    Solution #1.
    Change the active console Code Page ahead in your script to deal with your local characters.
    See https://ss64.com/nt/chcp.html
    e.g. (with a french accented char):
    @ECHO off
    chcp 1252
    SET ETAHOME="C:\Program Files (x86)\CA\Identity Manager\Provisioning Server"
    %ETAHOME%\bin\etautil -u superadmin -p secret
    update 'eTGlobalUserContainerName=Global Users,eTNamespaceName=CommonObjects,dc=im'
    eTGlobalUser eTGlobalUserName=guiph01 eTTitle=Employé
    Solution #2.
    Use the -f etautil option to process the instructions from a file.
    If so the MS command shell does not translate any of those characters inside the file.
    The file is only processed by the etautil tool.
    e.g.:
    @ECHO off
    SET ETAHOME="C:\Program Files (x86)\CA\Identity Manager\Provisioning Server"
    %ETAHOME%\bin\etautil -u superadmin -p secret -f inputfile.txt
    and inputfile.txt contains the update statement.
    Regards,
    Philippe.


  • 5.  Re: Handle local characters in etautil

    Posted 01-23-2018 05:28 AM

    Hello Phillipe,

     

    As per your advice I tried with code page 865 (nordic) , I can see that when I put in the command to explore user it seems fine but when it is run , again the special character is removed.

     

    Here is my command as it looks in console:-

     

    ldapsearch.exe -LLL -h host -p 20389 -D "eTGlobalUserName=superuser,eTGlobalUserContainerName=Global Users,eTNamespaceName=CommonObjects,dc=im,dc=eta" -w secret-b "eTADSAccountName=Katharina Helena Hesbø Belbo,eTADSOrgUnitName=Users,eTADSOrgUnitName=Customers,eTADSOrgUnitName=SKALA,eTADSDirectoryName=AD,eTNamespaceName=ActiveDirectory,dc=im,dc=eta" -s base "(objectclass=*)" eTExploreUpdateEtrust

     

    Result is this :-

    Additional information: :ETA_S_0023<EAC>, Active Dir. Account 'Katharina Helena
    Hesb Belbo' exploration successful: (objects added: 0, deleted: 0, updated: 0, u
    nchanged: 0, failures: 0)

     

    Notice that "ø" is removed somehow while running the command or is it something else ?

     

    When tried with option 2 , it gave me an error ldapsearch.exe is invalid.

     

    Can you suggest anything else ?

     

    Thanks,

    Shashank