More identity preferences woes

antoinekinch
New Contributor III

Does anyone know how to remove/delete an identity preference from the keychain by script?

We set security identity preferences by:

security set-identity-preference -s

Now how would you delete one? the man page for security only specifies:

set-identity preferences
get-identity preferences

Anything? Thanks in advance!

4 REPLIES 4

sgoetz
Contributor

Has anyone figured out how to delete identity preferences via terminal. I know how to do it through Keychain Access but need to do this on mass.

dbrodjieski
New Contributor III

I ran a quick test, and it looks like running

security set-identity-preference -n -s "name of service"

effectively removes the identity preference. The -n flag is to clear an existing setting.

sgoetz
Contributor

lmao thank you. I tried that and it didn't do anything to only realize I didn't put sudo in front so that it would effect the System.keychain :D.

sudo security = System.keychain
security = login.keychain for the user that ran the command

FutureFacinLuke
Contributor II

Hi,

This look like a command I need to run on a subset of older Macs because a new service is broken on Macs with an older ID Pref.

From the above if I run this as a command policy or a script from jamf will it run in the user or system context?