How do I reset all players spawn positions when joining?

I have just created a Minecraft server to play with friends, but I would like to make sure that every time a player joins the server they spawn directly at spawn, instead of the last position they were in. Is there any way that I can do this?


Set up a command block chain with the following command:

/spawnpoint @a x y z

X, Y, and Z being coordinates of the spawnpoint.

Edit:

/setworldspawn will also work