etautil in command prompt with local non-US characters.
search cancel

etautil in command prompt with local non-US characters.

book

Article ID: 8255

calendar_today

Updated On:

Products

CA Identity Manager CA Identity Governance CA Identity Portal CA Identity Suite

Issue/Introduction

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.

It has been observed whenever a reference to account/role is made where local characters are involved, the characters are loaded incorrectly which causes the script to fail.

We have tried to run such entries directly typing on command prompt, even then it does not work.

Here is a sample:

eTADSAccountName=<name>

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

Cause

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.

Resolution

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 CHCP.com
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=<user> eTTitle=<name>
 
 
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.