We've recently been trying to get users to update passwords more regularly and with that of course, is keychain issues. I was trying to create a script to remove local wifi connections and server connections so when they accessed them, they could just recreate it by typing in their password. I've been struggling with this for a couple of days and had success locally, but not when deployed, and now I've broken it completely again.
#!/bin/bash
security delete-internet-password -l "cwinprint" ~/Library/Keychains/login.keychain
security delete-internet-password -l "pwinfile" ~/Library/Keychains/login.keychain
security delete-internet-password -l "cwinfile" ~/Library/Keychains/login.keychain
security delete-internet-password -l "fwinfile" ~/Library/Keychains/login.keychain
security delete-generic-password -l "IS-EMP" -s com.apple.network.eap.user.item.wlan.ssid.IS-EMP
security delete-generic-password -l "CO-EMP" -s com.apple.network.eap.user.item.wlan.ssid.CO-EMP
Looking to use this as a script to use in jamf remote or a policy I can create to add machines to if the users are known to be hard to get a hold of. Any assistance would be appreciated