How to modify a user association in Slurm?
I found another way using multiple accounts and setting the default one to the last one added:
sacctmgr add user example account=groupb
sacctmgr modify user where user=example set defaultaccount=groupb
I came over this answer and want to share my insight here: In Slurm everything is centered around associations. Zhens answer is absolutely right. Just add an new association for that user and delete the old one. Or even leave the old association so the User might decide under which account to run a job (see -U option of srun)
sacctmgr remove user where user=example and account=oldgroup
sacctmgr add user name=example defaultaccount=newgroup ...