Skip to content

Instantly share code, notes, and snippets.

@blizzz
Created February 18, 2021 18:01
Show Gist options
  • Save blizzz/6633bf60bf1e526f32a9a264af20d37b to your computer and use it in GitHub Desktop.
Save blizzz/6633bf60bf1e526f32a9a264af20d37b to your computer and use it in GitHub Desktop.
randomly assign users to groups in samba4
#!/bin/bash
for i in {1..3200}
do
R_UID="Joker ${i}"
MEMBERSHIPS="$((($RANDOM % 10) + 10))"
for j in {1..${MEMBERSHIPS}}; do
R_GROUP="Osmium $((($RANDOM % 200) + 1))"
samba-tool group addmembers "${R_GROUP}" "${R_UID}" || true
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment