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

WRITEID

CS:GO

This command saves the list of user IDs that have been banned to banned_user.cfg, so that the bans apply even after the server restarts.

Syntax
writeid

Description

This command saves the list of user IDs that have been banned to banned_user.cfg, so that the bans apply even after the server restarts.

How To Use writeid

  1. Enable the developer console in Counter-Strike settings.
  2. Open the console with the tilde key (~).
  3. Enter writeid, 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

writeid