To create a gMSA using the New-ADServiceAccount cmdlet.
Step 1: On the Windows Server 2012 domain controller (here SRV1), run Windows PowerShell from the Taskbar.
Step 2: At the command prompt for the Windows PowerShell, type the following commands, and then press ENTER. (The Active Directory module will load automatically.) New-ADServiceAccount gMSA1 Enter the command on a single line.
Step 3: Install the gMSA on the host
The Install-ADServiceAccount cmdlet installs an existing gMSA on the server on which the cmdlet is run. Use the cmdlet with the following syntax:
Install-ADServiceAccount `
-Identity <ADServiceAccount>
Run the following PowerShell commands as administrator.
Install-ADServiceAccount gMSA1
Note: Managed Service Accounts container
To work effectively, gMSAs must be in the Managed Service Accounts container.

Reference:
https://learn.microsoft.com/en-us/windows-server/security/group-managed-service- accounts/getting-started-with-group-managed-service-accounts
https://learn.microsoft.com/en-us/entra/architecture/service-accounts-group-managed