エントリー
会社には、マネージャーの手によって記入された従業員の連絡先のファイルがあります。 MS Outlook、The Bat、Mozilla Thunderbirdなど、メールプログラムのアドレスと外観を使用して、同期されたアドレス帳を作成する必要があります。
フィルターなしで、Oulookの「リスト全体を表示」との互換性が本当に必要です。
タスクを4つの部分に分けます。
- OpenLDAPを構成する
- サーバーからXLSを取得する
- 消化可能な形式に変換して解析
- ブックから古い連絡先を削除し、そこにモジュールを配置します
Openldap
Microsoftによる標準の軽微な使用のため、アドレス帳にすべてのアドレスを表示することはできません。 山はモハメドに行かないため、OpenLDAPを少し開く必要があります。
Victor Sudakovはここでパッチを完全に理解しました。管理者に感謝します。
サーバー上のOSとして、たとえば8Gbディスクと64Mbのメモリで簡単に仮想化できるCSSとして、CSS-Calculate Linux Scratch(Gentoo、一言で言えば)があります。
パッチム
血まみれのパッチワークをしたくない人のための余談-私のテストカブを接続するだけです(更新するという事実ではありません):/etc/layman/layman.cfgにオーバーレイを追加します:
overlays : http://www.gentoo.org/proj/en/overlays/repositories.xml https://raw.github.com/arrrght/openldap-outlook/master/overlay.xml
アクティベートして同期します:
# layman -S # layman -a openldap-outlook
キーを/etc/portage/package.useに書き込みます。
net-nds/openldap experimental icu slp perl overlays ms-sssvlv
OpenLDAPをインストールする
emerge openldap
自分の手ですべてをするのが好きな人のために、パッチがあります( ここにあります ):
--- ./openldap-2.4.33/servers/slapd/schema_prep.c.orig 2012-12-07 09:54:56.000000000 +0700 +++ ./openldap-2.4.33/servers/slapd/schema_prep.c 2012-12-07 09:58:10.000000000 +0700 @@ -908,6 +908,7 @@ "DESC 'RFC4519: common supertype of name attributes' " "EQUALITY caseIgnoreMatch " "SUBSTR caseIgnoreSubstringsMatch " + "ORDERING caseIgnoreOrderingMatch " "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )", NULL, SLAP_AT_ABSTRACT, NULL, NULL,
カスタマイズ
設定はここに最も正確に記述されています -これは、LDAPに真剣に取り組むことを決定した人向けです。 私の場合、すべてがシンプルです-アドレス帳が必要です。 デフォルトでは、ほとんどすべてを/etc/openldap/slapd.confファイルに残しました。 ここでは、インデックスはまったくなく、一般的に多くの余分なものがあります。
include /etc/openldap/schema/core.schema include /etc/openldap/schema/cosine.schema include /etc/openldap/schema/inetorgperson.schema include /etc/openldap/schema/java.schema include /etc/openldap/schema/openldap.schema include /etc/openldap/schema/nis.schema include /etc/openldap/schema/corba.schema include /etc/openldap/schema/dyngroup.schema include /etc/openldap/schema/misc.schema include /etc/openldap/schema/pmi.schema pidfile /var/run/openldap/slapd.pid argsfile /var/run/openldap/slapd.args modulepath /usr/lib64/openldap/openldap moduleload back_passwd.so moduleload back_ldap.so moduleload sssvlv.so database hdb overlay sssvlv suffix "dc=org,dc=com" checkpoint 32 30 rootdn "cn=Manager,dc=org,dc=com" rootpw secret directory /var/lib/openldap-data index objectClass eq , , LDAP entry.ldif: dn: dc=org,dc=com objectClass: dcObject objectClass: organization o: org.com</code> ldif : <code>slapadd < entry.ldif</code> LdapAdmin ou=ab,dc=org,dc=com. , , . <h4>XLS</h4> smbget, samba, xls2csv. getfile.sh: <source lang="bash"> #!/bin/sh SMBGET=/usr/bin/smbget LDAPSEARCH=/usr/bin/ldapsearch LDAPDELETE=/usr/bin/ldapdelete rm "temp.xls" ${SMBGET} "smb://domain;user:password@192.168.1.1/Share/Telephones.xls" -o temp.xls xls2csv -c~ -b\' temp.xls > temp.csv # delete all from ou=ab,dc=org,dc=com ${LDAPSEARCH} -b "ou=ab,dc=org,dc=com" "(uid=*)" | grep dn: | awk '{print $2}' | ${LDAPDELETE} -Dcn=Manager,dc=org,dc=com -wsecret
次は、csvを目的のldifファイルに変換するパールスクリプトです。次のようなものです(速攻で記述されています)。
#!/usr/bin/perl use strict; use encoding 'utf8'; open my $fh, "<temp.csv" or die 'Can\'t open file'; open my $fout, ">temp.ldif" or die 'Can\'t write to file'; my $org = ''; my $orgNum = 0; my $div = ''; my $userNum = 1000; my $ouDcDc = 'ou=ab,dc=org,dc=com'; while (my $line = <$fh>) { my $isNowOrg = 0; my $email = ''; chomp $line; my @f = split /~/, $line; if (!$org || $f[0]=~/\'/){ $org = clean($f[0]); $org =~s/^(.+)\"(.+)\"$/$2/; $org = firstUp($org); $isNowOrg = 1; $orgNum++; } $email = clean($f[5]) if $f[5]=~/@/; $div = firstUp(clean($f[0])) unless $f[1] || $email; my $name = clean($f[1]); my $post = clean($f[0]); my $telNum = clean($f[4]); $telNum =clean($f[2]) if $orgNum==3; $telNum =~s/\D/ /g; $telNum =~s/^\D*//g; #print "#$telNum#\n"; #$telNum = ~s/\W//g; my %names = givenName($name); if ($name && $post && $names{'firstName'}){ ++$userNum; print $fout "dn: uid=user${userNum},${ouDcDc}\n"; print $fout "uid: user${userNum}\n"; print $fout "objectClass: posixAccount\nobjectClass: top\nobjectClass: inetOrgPerson\ngidNumber: 1000\n"; print $fout "uidNumber: ${userNum}\n"; print $fout "givenName: ", $names{'firstName'}, "\n"; print $fout "initials: ", $names{'middleName'}, "\n"; print $fout "sn: ", $names{'lastName'}, "\n"; #print $fout "username: user${userNum}\n"; print $fout "homeDirectory: home_dir\ngecos: gecos\nloginShell: log_shell\n"; print $fout "telephoneNumber: ${telNum}\n" if $telNum; print $fout "physicalDeliveryOfficeName: ${div}\n"; print $fout "ou: ${div}\n"; print $fout "o: $org\n"; #print $fout "organizationName: ACME\n"; print $fout "title: $post\n"; print $fout "mail: $email\n"; print $fout "cn: ", $names{'shortName'},"\n"; print $fout "\n"; # print "ORG: $org, DIV: $div, POST: $post, NAME: $name, EMAIL: $email\n"; } } close $fout; close $fh; sub givenName(){ my $name = shift; my @s=[]; my %names = {}; @s = split ' ', $name; $names{'firstName'} = $s[1]; $names{'lastName'} = $s[0]; $names{'middleName'} = $s[2]; $names{'shortName'} = $s[0] .' '. substr($s[1],0,1) .'.'. substr($s[2],0,1) .'.'; return %names; } sub clean(){ my $name = shift; $name =~s/^\'//; $name =~s/\"\"/\"/g; $name =~s/^\"//; $name =~s/\"$//; $name =~s/\ *$//g; $name =~s/\ +/\ /g; return $name; } sub firstUp(){ my $name = shift; $name = lc($name); return ucfirst($name); }
その後、出力はtemp.ldifファイルになります。このファイルは既にチームにフィードされています。
ldapadd -v -Dcn=Manager,dc=org,dc=com -wsecret < ./temp.ldif
サーバー側でそのような何か。 クライアントでは、Outlookで次のことを行います。
--> --> --> LDAP--> IP: IP --> --> : ou=ab,dc=org,dc=com : ( )
それだけです チェックし、クラウンに登録し、最適化します。
PS:Oulookアドレスリストに組織を表示するには、/ etc / openldap / schema / core.schemaファイルにパッチを適用する必要があります。「会社」を追加します-標準レコードo、行120に注意を払っていないことに感謝します
attributetype ( 2.5.4.10 NAME ( 'company' 'o' 'organizationName' ) DESC 'RFC2256: organization this object belongs to' SUP name )
**サイトa3r.me/posts/openldap-outlook.htmlからコピーペースト