how to get player name

i want to make the player summon a zombie which ill just do with at @a but i also want to put the zombie in a team with the player so it doesnt attack the player i thought about getting the player name and adding the nbt for the team i figured id use the player name so that i can make a seperate team for each player but i dont know how

Continue to help post