Help me with scripts
Help me with scripts
Hi,
I would like to export all users with two columns fields: "mail" and "zimbraAuthLdapExternalDn" so executed command:
zmprov -l gaa -v domain.com | grep -e zimbraAuthLdapExternalDn -e mail
but it list everything with "mail" word. Could you help me?
I would like to export all users with two columns fields: "mail" and "zimbraAuthLdapExternalDn" so executed command:
zmprov -l gaa -v domain.com | grep -e zimbraAuthLdapExternalDn -e mail
but it list everything with "mail" word. Could you help me?
- DualBoot
- Elite member
- Posts: 1326
- Joined: Mon Apr 18, 2016 8:18 pm
- Location: France - Earth
- ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
- Contact:
Re: Help me with scripts
Hello,
you should work with ldapsearch command which is more appropriate.
Regards
you should work with ldapsearch command which is more appropriate.
Regards
Re: Help me with scripts
Maybe my script is wrong or e-mail attribute?
- DualBoot
- Elite member
- Posts: 1326
- Joined: Mon Apr 18, 2016 8:18 pm
- Location: France - Earth
- ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
- Contact:
Re: Help me with scripts
the real attribute which match the main address is zimbraMailDeliveryAddress
For information using ldapsearch is more efficient because it does not use Java.
For information using ldapsearch is more efficient because it does not use Java.
- ccelis5215
- Outstanding Member
- Posts: 632
- Joined: Sat Sep 13, 2014 2:04 am
- Location: Caracas - Venezuela
- ZCS/ZD Version: 8.8.15.GA.3869.UBUNTU18.64 P12
Re: Help me with scripts
Hi, fully agree with DualBoot, ldapsearch is way efficient.tutek wrote:Hi,
I would like to export all users with two columns fields: "mail" and "zimbraAuthLdapExternalDn" so executed command:
zmprov -l gaa -v domain.com | grep -e zimbraAuthLdapExternalDn -e mail
but it list everything with "mail" word. Could you help me?
Try
Code: Select all
zmprov -l gaa -v domain.com | grep -e "zimbraAuthLdapExternalDn" -e "^mail: "
Re: Help me with scripts
it works, but create zimbraAuthLdapExternalDn on new line, below e-mail
is any way to have e-mail and zimbraAuthLdapExternalDn side by side?
thanks
is any way to have e-mail and zimbraAuthLdapExternalDn side by side?
thanks
- DualBoot
- Elite member
- Posts: 1326
- Joined: Mon Apr 18, 2016 8:18 pm
- Location: France - Earth
- ZCS/ZD Version: ZCS FLOSS - 8.8.15 Mutli servers
- Contact:
Re: Help me with scripts
use sed before the second returning attribute.
Re: Help me with scripts
Code: Select all
zmprov -l gaa -v domain.com | grep -e "zimbraAuthLdapExternalDn" sed -e "^mail: " > file.csv
grep: sed: No such file or directory
- ccelis5215
- Outstanding Member
- Posts: 632
- Joined: Sat Sep 13, 2014 2:04 am
- Location: Caracas - Venezuela
- ZCS/ZD Version: 8.8.15.GA.3869.UBUNTU18.64 P12
Re: Help me with scripts
Trytutek wrote:Code: Select all
zmprov -l gaa -v domain.com | grep -e "zimbraAuthLdapExternalDn" sed -e "^mail: " > file.csv grep: sed: No such file or directory
Code: Select all
zmprov -l gaa -v domain.com | grep -e "zimbraAuthLdapExternalDn" -e "^mail: " | awk '{ ORS = (NR%2 ? FS : RS) } 1'
Re: Help me with scripts
no,
now output looks like mail zimbraAuthLdapExternalDn
but in next new line if mail do not have corresponding zimbraAuthLdapExternalDn, then in paste next mail to this line, so it looks mail mail
and because of that next lines have wrong order and wrong corresponding zimbraAuthLdapExternalDn attributes.
now output looks like mail zimbraAuthLdapExternalDn
but in next new line if mail do not have corresponding zimbraAuthLdapExternalDn, then in paste next mail to this line, so it looks mail mail
and because of that next lines have wrong order and wrong corresponding zimbraAuthLdapExternalDn attributes.