I can't speak to how to code .NET but I can speak in more general terms how to submit a request to the Zimbra SOAP interface. You should be able to take these guidelines and implement the .NET tech-specific calls (i.e. calling a web service, submitting XML to that service, etc, etc).
Note: A list of the SOAP request commands are found in ZimbraServer/docs/soap.txt and admin commands (like SetPasswordRequest) in soap-admin.txt
At a high-level, to use the Zimbra SOAP interface, you will POST a SOAP request to the Zimbra server SOAP interface. For example, for admin SOAP requests, submit the SOAP request to the admin SOAP interface at:
https://localhost:7071/service/admin/soap
A SOAP request format takes the XML form of:
Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
...auth info goes here...
</soap:Header>
<soap:Body>
.... your request goes here...
</soap:Body>
</soap:Envelope>
Let's walk thru the sequence of SOAP requests you will make in order to set a new password on an account:
1) Authenticate as an admin. There's an "AuthRequest" command for that. Here's what the full SOAP request would look like that you would submit to the SOAP interface:
Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<nosession/>
</context>
</soap:Header>
<soap:Body>
<AuthRequest xmlns="urn:zimbraAdmin">
<name>myadminname</name>
<password>myadminpassword</password>
</AuthRequest>
</soap:Body>
</soap:Envelope> 2) The "AuthResponse" (from the above command) will include an auth token. You'll use that token for the subsequent SOAP requests so read the response and hold onto that token.
3) Now, the set password SOAP command requires you specify the account id. You can get this by making a "GetAccountInfoRequest" and grabbing the "zimbraId" from the response. A "GetAccountInfoRequest" for an account name "user1" looks like:
Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<authToken>X_XXXXXXXXXXXX_XXXXXXXXXXX</authToken>
<nosession/>
</context>
</soap:Header>
<soap:Body>
<GetAccountInfoRequest xmlns="urn:zimbraAdmin">
<account by="name">user1</account>
</GetAccountInfoRequest>
</soap:Body>
</soap:Envelope> Note: be sure to put the token from the auth into this request.
4) The response from this command has account info, including a "zimbraId". This is the account id. Read the response, hold onto that value...you'll need it next...
5) Now submit the "SetPasswordRequest" command:
Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<context xmlns="urn:zimbra">
<authToken>X_XXXXXXXXXXXX_XXXXXXXXXXX</authToken>
<nosession/>
</context>
</soap:Header>
<soap:Body>
<SetPasswordRequest xmlns="urn:zimbraAdmin">
<id>XXX_XXXX_XXX_THE_ZIMBRA_ID_XXXXX</id>
<newPassword>thenewpassword</newPassword>
</SetPasswordRequest>
</soap:Body>
</soap:Envelope> Note: be sure to put the token from the auth command and the zimbraId from the previous command into this request.
6) And that's it. You've set the password for an account.