Example KB Article: Difference between revisions
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
__FORCETOC__ | __FORCETOC__ | ||
<div class="col-md-12 ibox-content"> | <div class="col-md-12 ibox-content"> | ||
= | =Zmsoap - Create contact and contact group through CLI= | ||
<hr> | <hr> | ||
{{KB|{{ | {{KB|{{WIP}}|{{ZCS 8.8}}||||}} | ||
====Problem==== | ====Problem==== | ||
Create contact and contact group through CLI. Add local contact and GAL contact in contact group: | |||
====Solution==== | ====Solution==== | ||
1) Create a local contact through the Zmsoap command. | |||
Create the SOAP XML as per Zimbra SOAP API /tmp/createcontact.xml and add the following line into this file and save. | |||
===== | <CreateContactRequest xmlns="urn:zimbraMail"> | ||
<cn l="7"> | |||
<a n="firstName">Test</a> | |||
<a n="lastName">Test</a> | |||
<a n="homeStreet">Test street</a> | |||
<a n="mobilePhone">8000062359</a> | |||
<a n="fullName">Test, Test</a> | |||
<a n="email">test@gmail.com</a> | |||
</cn> | |||
</CreateContactRequest> | |||
: | And use the below command to create local contact: | ||
$zmsoap -v -z -m user@domain.com -f /tmp/createcontact.xml and add the following line into this file and save. | |||
2) Create a contact group through Zmsoap. | |||
Create the SOAP XML as per Zimbra SOAP API /tmp/createcontact_group.xml | |||
{{Article Footer|ZCS 8.8|2020- | <CreateContactRequest xmlns="urn:zimbraMail"> | ||
<cn l="7"> | |||
<a n="fileAs">8:testgroup</a> | |||
<a n="nickname">testgroup</a> | |||
<a n="type">group</a> | |||
<a n="fullName">testgroup</a> | |||
</cn> | |||
</CreateContactRequest> | |||
And use the below command to create a contact group: | |||
$zmsoap -v -z -m user@domain.com -f /tmp/createcontact.xml | |||
3) Add the local contact in contact group. | |||
$zmsoap -v -z -m user@domain.com ModifyContactRequest/cn @id=group_id m/@op="+" @type="C" @value="contact_id" | |||
Here "group_id" is contact group ID and "contact_id" is the local contact ID. | |||
4) Add the GAL contact in contact group. | |||
$zmsoap -v -z -m test2@domain.com ModifyContactRequest/cn @id=group_id m/@op="+" @type="G" @value="uid=Gopal,ou=people,dc=domain,dc=com" | |||
Here "group_id" is a contact group ID and "uid=Gopal,ou=people,dc=domain,dc=com" GAL contact we want to add in the contact group. | |||
{{SubmittedBy|Gopal Singh Bhandari}} | |||
{{Article Footer|ZCS 8.8|2020-07-10}} |
Revision as of 06:54, 10 July 2020
Zmsoap - Create contact and contact group through CLI
Problem
Create contact and contact group through CLI. Add local contact and GAL contact in contact group:
Solution
1) Create a local contact through the Zmsoap command.
Create the SOAP XML as per Zimbra SOAP API /tmp/createcontact.xml and add the following line into this file and save.
<CreateContactRequest xmlns="urn:zimbraMail"> <cn l="7"> <a n="firstName">Test</a> <a n="lastName">Test</a> <a n="homeStreet">Test street</a> <a n="mobilePhone">8000062359</a> <a n="fullName">Test, Test</a> <a n="email">test@gmail.com</a> </cn> </CreateContactRequest>
And use the below command to create local contact:
$zmsoap -v -z -m user@domain.com -f /tmp/createcontact.xml and add the following line into this file and save.
2) Create a contact group through Zmsoap.
Create the SOAP XML as per Zimbra SOAP API /tmp/createcontact_group.xml
<CreateContactRequest xmlns="urn:zimbraMail"> <cn l="7"> <a n="fileAs">8:testgroup</a> <a n="nickname">testgroup</a> <a n="type">group</a> <a n="fullName">testgroup</a> </cn> </CreateContactRequest>
And use the below command to create a contact group:
$zmsoap -v -z -m user@domain.com -f /tmp/createcontact.xml
3) Add the local contact in contact group.
$zmsoap -v -z -m user@domain.com ModifyContactRequest/cn @id=group_id m/@op="+" @type="C" @value="contact_id"
Here "group_id" is contact group ID and "contact_id" is the local contact ID.
4) Add the GAL contact in contact group.
$zmsoap -v -z -m test2@domain.com ModifyContactRequest/cn @id=group_id m/@op="+" @type="G" @value="uid=Gopal,ou=people,dc=domain,dc=com"
Here "group_id" is a contact group ID and "uid=Gopal,ou=people,dc=domain,dc=com" GAL contact we want to add in the contact group.
Submitted by: Gopal Singh Bhandari |