Is there a way using security find-internet-password
or something similar to get my exchange credentials on the command line? I'm trying to write a script to auto-login into an exchange server and I'm sure the data exists somewhere but just unsure how to grab it.
ms-office Security – How to Retrieve Exchange Password from Keychain
keychainms officepasswordSecurity
Related Question
- MacBook – How to use Keychain to Auto Login into Authenticated Websites
- Keychain Management – Command-Line Utility for macOS
- MacBook – way to force a password check on a Macbook using Touch ID
- MacOS – How to list all the passwords stored in Keychain Access
- ICloud – Is it possible to access and modify iCloud keychain from command line (or automation)
- Replace password prompt with Touch ID to read Keychain password
Best Answer
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: