Getting exchange password from keychain
security find-generic-password -ga &lt;account&gt;


You can find the account by opening Keychain Access, opening the application password (titled Exchange) and looking at the Account field. It should be in the form emailaddress@server e.g. ‘username@example.com@mail.example.com’.

Upon running this command, you will be prompted to allow access to the item in your Keychain, upon which you can Allow or Always Allow.

The password is printed in the last line of the output:

…
password: "abc123"