I ran into a language issue the other day when writing a PowerShell script that uses net localgroup and thought it could be useful to others:

Depending on the language your Windows device is set to, the local Administrators group will be different, so the typical net localgroup administrators domain\user /add command will fail.

Implementing the following will grab the actual name of the group by it's SID first, then use that result.
Note that this is written to work in PowerShell, not CMD.exe.

# Gets the name of the local Administrators group in appropriate language $localAdminGroupName = (Get-WmiObject win32_group -filter "LocalAccount = $TRUE And SID = 'S-1-5-32-544'" | Select-Object -Expand name) Write-Output "Local Administrators group detected as: [$localAdminGroupName]" # Sets the users as a local admin using appropriate local Administrators group name net localgroup $localAdminGroupName domain\user /add # Gets local Administrators group members net localgroup $localAdminGroupName