Check an account

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
Post Reply
kalop
Posts: 2
Joined: Wed Jan 23, 2019 4:40 pm

Check an account

Post by kalop »

I'm trying to get the status from an accont: zimbraAccountStatus but I don't know how to do it with soap.

I'm able to change the value with "ModifyAccountRequest" and set it to active, maintenance, closed or locked. However, I don't know how to check it.

Any help is welcome!
kalop
Posts: 2
Joined: Wed Jan 23, 2019 4:40 pm

Re: Check an account

Post by kalop »

I've found the solution:
You have to do a GetAccountRequest with attrs="zimbraAccountStatus" like this:

Code: Select all

<?xml version="1.0" ?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header><context xmlns="urn:zimbra"><format type="xml"/><authToken>%s</authToken>
</context></soap:Header><soap:Body>
<GetAccountRequest applyCos="1" attrs="zimbraAccountStatus" xmlns="urn:zimbraAdmin">
<account by="name">%s</account>
</GetAccountRequest>
</soap:Body></soap:Envelope>' % (self.TOKEN, account)
Post Reply