NB! It seems this console command is not compatible with CS2.
Command Profile

DZ_JOINTEAM

CS:GO

This command can make you, or another player, join a specified Danger Zone team. See argument information for help.

Syntax
dz_jointeam [Team #] [User ID / Name]

Description

This command can make you, or another player, join a specified Danger Zone team. See argument information for help.

How To Use dz_jointeam

  1. Enable the developer console in Counter-Strike settings.
  2. Open the console with the tilde key (~).
  3. Enter dz_jointeam [Team #] [User ID / Name], replacing bracketed arguments with the value you want, then press Enter.

This legacy command is not currently listed as compatible with Counter-Strike 2.

Syntax And Arguments

dz_jointeam [Team #] [User ID / Name]
Team # The number of the team you wish to join. Specify 0 to leave your current team. If you are an admin of the server, you can make another player join this team by specifying their name or Steam ID after this number.
User ID / Name Optional, if you do not specify a user ID or name here, you will join the team with the specified ID. The Steam ID, or name, of the player you wish to make a member of the specified team.