I'm looking at ways to clear out all the internet and application passwords from user keychains without actually blowing away the login keychain. We have user level certificates that have to be preserved.
Thus far I know how to find the logged in user, and I know how to generally find the keychains. However finding the saved passwords is proving to be a pain in the ass. Anyone out there doing anything along these lines?
Right now I'm using:
/bin/ls -la /dev/console | /usr/bin/cut -d " " -f 4 | tr 'A-Z' 'a-z' to find the user
- security and find-internet-password -a to try and find the passwords based on accounts determined above
Any ideas would be appreciated.