It’s Cybersecurity Awareness Month! Join our interactive training session, or learn about security and AI from 1Password experts.
Forum Discussion
khaosspawn
5 years agoDedicated Contributor
Mass Update Logins/Passwords
Hi There - I have the use case were I have multiple demo/sample accounts to log into a system. eg. dave, vicki, john - and all these accounts have the same password which is changed every few days.
...
khaosspawn
5 years agoDedicated Contributor
I had an attempt to write up a script to update a bunch of items. Happy to get any feedback for automating grabbing all the user names from a vault (I'd just hard coded them for now).
#!/bin/zsh
#
# Update the demo passwords in 1password.
#
# Define our variables
new_password="THIS IS THE NEW PASSWORD"
user_names=(
"aa"
"bb"
"cc"
"dd"
)
vault="Vault A"
# Sign in
# In case the details aren't stored use the command below to initialize it
# op signin abc.1password.com abc@def
eval $(op signin abc)
# Let's update all the users
for user_name in "${user_names[@]}"; do
echo "Updating: $user_name"
op edit item "$user_name" --vault "${vault}" password=$new_password
echo "Update complete"
done
op signout