Any way to change password of user through SOAP API without old password info
Any way to change password of user through SOAP API without old password info
Hi all,
I would like to learn are there any ways to change user passwords through SOAP API without old password information as existing ChangeAccount request demands. Because of I use admin credentials, I think I should be able to complete this operation without old password information.
Your helps will be appreciated a lot.
Thanks in advance.
From API Reference:
ChangePasswordRequest
<ChangePasswordRequest> ## ChangePasswordRequest
<account by="{acct-selector-by} (adminName|appAdminName|id|foreignPrincipal|name|krb5Principal)">{key}</account> ## AccountSelector
<oldPassword>{oldPassword} (String)</oldPassword>
<password>{password} (String)</password>
<virtualHost>{virtualHost} (String)</virtualHost>
</ChangePasswordRequest>
I would like to learn are there any ways to change user passwords through SOAP API without old password information as existing ChangeAccount request demands. Because of I use admin credentials, I think I should be able to complete this operation without old password information.
Your helps will be appreciated a lot.
Thanks in advance.
From API Reference:
ChangePasswordRequest
<ChangePasswordRequest> ## ChangePasswordRequest
<account by="{acct-selector-by} (adminName|appAdminName|id|foreignPrincipal|name|krb5Principal)">{key}</account> ## AccountSelector
<oldPassword>{oldPassword} (String)</oldPassword>
<password>{password} (String)</password>
<virtualHost>{virtualHost} (String)</virtualHost>
</ChangePasswordRequest>
- Gren Elliot
- Advanced member
- Posts: 183
- Joined: Tue Jun 10, 2014 4:45 am
Any way to change password of user through SOAP API without old password info
You can use the ZimbraAdmin SetPasswordRequest SOAP API. See http://wiki.zimbra.com/wiki/SOAP_API_Re ... th_ZCS_8.0 which leads to https://files.zimbra.com/docs/soap_api/ ... index.html if your version is 8.5.0.
Any way to change password of user through SOAP API without old password info
Hi @Gren,
I have already looked over the API reference but could not find a service addresses my problem.
I'll be glad if you can tell me the name of service I can use for.
Thanks in advance.
-Talha
I have already looked over the API reference but could not find a service addresses my problem.
I'll be glad if you can tell me the name of service I can use for.
Thanks in advance.
-Talha
- Gren Elliot
- Advanced member
- Posts: 183
- Joined: Tue Jun 10, 2014 4:45 am
Any way to change password of user through SOAP API without old password info
SetPasswordRequest is the API request that allows an Admin to change a user's password without knowing the original. That is documented at the URLs in my previous reply. Do a search in the bottom left frame of the API reference for "SetPassword"
Any way to change password of user through SOAP API without old password info
thanks a lot Gren for your care. This is what I am looking for except I do not have ZimbraID information - I need to change user's password through his/her email username. Is this possible too?
Any way to change password of user through SOAP API without old password info
Any other ideas will be appreciated a lot! Thanks in advance.
- Gren Elliot
- Advanced member
- Posts: 183
- Joined: Tue Jun 10, 2014 4:45 am
Any way to change password of user through SOAP API without old password info
You can use GetAccountRequest e.g.:
<GetAccountRequest attrs="zimbraId" xmlns="urn:zimbraAdmin">
<account by="name">for@pan.local</account>
</GetAccountRequest>
<GetAccountResponse xmlns="urn:zimbraAdmin">
<account name="for@pan.local" id="101a7428-0409-4adc-acb0-ac84eafe89f8">
<a n="zimbraId">101a7428-0409-4adc-acb0-ac84eafe89f8</a>
</account>
</GetAccountResponse>
<GetAccountRequest attrs="zimbraId" xmlns="urn:zimbraAdmin">
<account by="name">for@pan.local</account>
</GetAccountRequest>
<GetAccountResponse xmlns="urn:zimbraAdmin">
<account name="for@pan.local" id="101a7428-0409-4adc-acb0-ac84eafe89f8">
<a n="zimbraId">101a7428-0409-4adc-acb0-ac84eafe89f8</a>
</account>
</GetAccountResponse>
Any way to change password of user through SOAP API without old password info
thank you so much [mention:f2a614af661743dba278e99988cfb764:e9ed411860ed4f2ba0265705b8793d05] for your help; really appreciated a lot!
All the best.
All the best.
- Gren Elliot
- Advanced member
- Posts: 183
- Joined: Tue Jun 10, 2014 4:45 am
Any way to change password of user through SOAP API without old password info
Thanks for the recognition
-
- Advanced member
- Posts: 52
- Joined: Sat Sep 13, 2014 1:36 am
Re: Any way to change password of user through SOAP API without old password info
I am knew in this world of the SOAP and XML world, i look and look but no so much functional examples could be found there for many task with this api.
So reading the fork i used the api found in this link https://github.com/zimbra-api/zimbra-api/ and I could make it work for resetting the password of the user as follow:
If any is looking a functional example, i leave it here.
So reading the fork i used the api found in this link https://github.com/zimbra-api/zimbra-api/ and I could make it work for resetting the password of the user as follow:
Code: Select all
<?php
// This file is generated by Composer
require_once 'vendor/autoload.php';
$api = \Zimbra\Admin\AdminFactory::instance('https://10.0.10.40:7071/service/admin/soap');
$api->auth('admin', admin.zimbra.password');
$account = new \Zimbra\Struct\AccountSelector(\Zimbra\Enum\AccountBy::NAME(), 'mailbox@example.com');
$id = ((array)$api->getAccountInfo($account)->a[0])["_"];
echo $id."\n";
$passwordInfo = $api->setPassword($id,"MyNewPassword.2341");