Tool
If using Russian (CP1251):
......if using English:
"Koltogyan Sergey Rubenovich";"1300"
"Putin Vladimir Vladimirovich";"0001"
.....
If you prepare this file in CP1251 - all will work without any changes, if prepared in English, you need correct string 95:
Line 95 was:from_to($lnameutf,"cp1251","utf-8");Line 95 change to:
# from_to($lnameutf,"cp1251","utf-8");
This Steps for use scripts:
- Copy ct.pl to the sys:\perl\scripts\ct.pl
- Create folder: sys:\results\chngtlph
- Create empty file: sys:\results\chngtlh\chngtlh.log
- Modify script for Your Environment:
LINE 33:
$ADMIN = "cn=admin,o=org";
Insert user name. Under this user script will be login to the LDAP(edir) and will search users and put telephone number from the sys:\a.csv
This user must have rights for this.
A simple way - use admin account
LINE 31:
$PASSWD = 'password';
password user admin.org
LINE 32:
$BASEDN ="o=org";
From this container and below script will be searched.
- 5. prepare and copy file a.csv to the sys:a.csv
How to run script:
From the server console run this string:perl sys:\perl\scripts\ct.pl
What does it does:
- Open for read file sys:\a.csv
- Reads this file string by string
- For every string, search:
example, for string:
"Putin Vladimir Vladimirovich";"0001"
search in the edir from the o=org user object which has in the field "Full Name": "Putin Vladimir"
If found - write new telephone number: 0001
If not found -
+write info about this error in to the log-file:
sys:\results\chngtlph\chngtlph.log
and
+read other string
You can easily change the script as needed.
Do not forget LINE 95.
edir stores information in the UTF-8.
For records in Russian (prepared in Windows) it is important
***************************************************** * Thanks, Iain McLaren, for example use of PERL-script: * http://forge.novell.com/modules/xfmod/project/?cpr-backup *****************************************************
P.S.: I know of JRB-utilities.
It is a variant free-of-charge and it is more convenient for me that I can work directly on the console of a server, without a workstation.
| Attachment | サイズ |
|---|---|
| ct.zip | 2.36 KB |
Related Articles
User Comments
- Be the first to comment! To leave a comment you need to Login or Register
- 3142 reads



0