- 论坛徽章:
- 0
|
如下的信息是我从ldap服务器中export出来的ldif文件其中两条记录:
- # entry-id: 5080
- dn: uid=youny,ou=people,o=abc.com.cn,o=isp
- modifyTimestamp: 20081217125108Z
- modifiersName: cn=puser,ou=dsame users,o=isp
- mailDeliveryOption: mailbox
- userPassword: {SSHA}BYHBNfanq4LiQ4EkE7yflve9yXwFfKcStCp1Jg==
- mailQuota: 20M
- nswmExtendedUserPrefs: meDraftFolder=Drafts
- nswmExtendedUserPrefs: meSentFolder=Sent
- nswmExtendedUserPrefs: meTrashFolder=Trash
- nswmExtendedUserPrefs: meInitialized=true
- nswmExtendedUserPrefs:: dkNhcmQ9YmVnaW5cM2F2Y2FyZCRuXDNh6LSi5Yqh6YOo57uP55CG5
- Y2e5L2z5bOwO+S4iua1t+enkeaKgOe9kee7nOmAmuiur+aciemZkOWFrOWPuCRmblwzYeS4iua1t
- +enkeaKgOe9kee7nOmAmuiur+aciemZkOWFrOWPuCDotKLliqHpg6jnu4/nkIbljZ7kvbPls7Akd
- GVsO2NlbGxcM2ExMzcwMTc0MDk0NyR0ZWw7d29ya1wzYTY0NjQwMzU2JGFkclwzYTs75LiK5rW35
- biC5Lit5bGx6KW/6LevMTUyNeWPtzbmpbw75LiK5rW3OzsyMDAyMzU75Lit5Zu9JHZlcnNpb25cM
- 2EyLjEkZW1haWw7aW50ZXJuZXRcM2FqZmJpYW5Ac3RuYy5jb20uY24kZW5kXDNhdmNhcmQk
- nswmExtendedUserPrefs: meViewSize=100
- nswmExtendedUserPrefs: meDateFormat=0/
- preferredLanguage: zh_CN
- mailForwardingAddress: [email]bianjf@abc.com.cn[/email]
- cn:: U1ROQyDljZ7kvbPls7A=
- sn:: 5Y2e5L2z5bOw
- givenName: STNC
- preferredLocale: zh_CN
- psIncludeInGAB: false
- mailMsgQuota: 500
- nsUniqueId: 4eb89778-510411db-8003aacb-ecbda64c
- mailHost: dse.abc.com.cn
- mailUserStatus: active
- nsdaCapability: mailListCreate
- mail: [email]youny@abc.com.cn[/email]
- objectClass: top
- objectClass: person
- objectClass: organizationalPerson
- objectClass: inetOrgPerson
- objectClass: inetUser
- objectClass: ipUser
- objectClass: nsManagedPerson
- objectClass: userPresenceProfile
- objectClass: inetMailUser
- objectClass: inetLocalMailRecipient
- objectClass: inetAdmin
- objectClass: iplanet-am-user-service
- objectClass: iplanet-am-managed-person
- objectClass: iPlanetPreferences
- objectClass: inetsubscriber
- inetUserStatus: active
- uid: youny
- dataSource: NDA 4.5 Delegated Administrator
- pabURI: ldap://dse.abc.com.cn:389/ou=youny,ou=people,o=abc.com.cn,o=isp,o=pab
- creatorsName: cn=directory manager
- createTimestamp: 20071001042201Z
- iplanet-am-modifiable-by: cn=Top-level Admin Role,o=isp
- # entry-id: 5081
- dn: uid=jiangy,ou=people,o=kiiy.cn,o=isp
- modifyTimestamp: 20081217125108Z
- modifiersName: cn=puser,ou=dsame users,o=isp
- mailDeliveryOption: mailbox
- userPassword: {SSHA}BYHBNfanq4LiQ4EkE7yflve9yXwFfKcStCp1Jg==
- mailQuota: 50M
- nswmExtendedUserPrefs: meDraftFolder=Drafts
- nswmExtendedUserPrefs: meSentFolder=Sent
- nswmExtendedUserPrefs: meTrashFolder=Trash
- nswmExtendedUserPrefs: meInitialized=true
- nswmExtendedUserPrefs:: dkNhcmQ9YmVnaW5cM2F2Y2FyZCRuXDNh6LSi5Yqh6YOo57uP55CG5
- Y2e5L2z5bOwO+S4iua1t+enkeaKgOe9kee7nOmAmuiur+aciemZkOWFrOWPuCRmblwzYeS4iua1t
- +enkeaKgOe9kee7nOmAmuiur+aciemZkOWFrOWPuCDotKLliqHpg6jnu4/nkIbljZ7kvbPls7Akd
- GVsO2NlbGxcM2ExMzcwMTc0MDk0NyR0ZWw7d29ya1wzYTY0NjQwMzU2JGFkclwzYTs75LiK5rW35
- biC5Lit5bGx6KW/6LevMTUyNeWPtzbmpbw75LiK5rW3OzsyMDAyMzU75Lit5Zu9JHZlcnNpb25cM
- 2EyLjEkZW1haWw7aW50ZXJuZXRcM2FqZmJpYW5Ac3RuYy5jb20uY24kZW5kXDNhdmNhcmQk
- nswmExtendedUserPrefs: meViewSize=100
- nswmExtendedUserPrefs: meDateFormat=0/
- preferredLanguage: zh_CN
- mailForwardingAddress: [email]jiangy@kiiy.cn[/email]
- cn:: U1ROQyDljZ7kvbPls7A=
- sn:: 5Y2e5L2z5bOw
- givenName: STNC
- preferredLocale: zh_CN
- psIncludeInGAB: false
- mailMsgQuota: 500
- nsUniqueId: 4eb89778-510411db-8003aacb-ecbda64c
- mailHost: dse.abc.com.cn
- mailUserStatus: active
- nsdaCapability: mailListCreate
- mail: [email]jiangy@kiiy.cn[/email]
- objectClass: top
- objectClass: person
- objectClass: organizationalPerson
- objectClass: inetOrgPerson
- objectClass: inetUser
- objectClass: ipUser
- objectClass: nsManagedPerson
- objectClass: userPresenceProfile
- objectClass: inetMailUser
- objectClass: inetLocalMailRecipient
- objectClass: inetAdmin
- objectClass: iplanet-am-user-service
- objectClass: iplanet-am-managed-person
- objectClass: iPlanetPreferences
- objectClass: inetsubscriber
- inetUserStatus: active
- uid: jiangy
- dataSource: NDA 4.5 Delegated Administrator
- pabURI: ldap://dse.abc.com.cn:389/ou=jiangy,ou=people,o=kiiy.cn,o=isp,o=pab
- creatorsName: cn=directory manager
- createTimestamp: 20071001042201Z
- iplanet-am-modifiable-by: cn=Top-level Admin Role,o=isp
复制代码
从上面的信息中,我知道如果当记录中以dn:开头并含有o=abc.com.cn,o=isp字符的,是属于abc.com.cn的域帐号LDAP记录.
从# entry-id: 5080可以看出,我export出来的ldif文件中有5000多条这样的记录,现在我想筛选出每条记录的部分字段,例如,
当记录中以dn:开头并含有o=abc.com.cn,o=isp字符的,打印以如下字符开头的字段:
- # entry-id:
- dn:
- mailDeliveryOption:
- mailQuota:
- mailUserStatus:
- mail:
- mailAlternateAddress:
- uid:
- userPassword:
- givenName:
- mailForwardingAddress:
- sn:
- cn:
- mailMsgQuota:
复制代码
谢谢.
[ 本帖最后由 netocool 于 2009-8-28 10:04 编辑 ] |
|