If you run Get-LocalGroupMember Users | fl * you can see all the properties that the cmdlet returns.
PS C:\WINDOWS\system32> Get-LocalGroupMember Users | fl *
Name : NT-AUTORITÄT\Authentifizierte Benutzer
SID : S-1-5-11
PrincipalSource : Unknown
ObjectClass : Gruppe
Name : NT-AUTORITÄT\INTERAKTIV
SID : S-1-5-4
PrincipalSource : Unknown
ObjectClass : Gruppe
Name : SimonS\abctest
SID : S-1-5-21-3159913292-2406416548-3156803696-1008
PrincipalSource : Local
ObjectClass : Benutzer
And if you run Get-Help Remove-LocalUser you can see in the syntax section, that there is one ParameterSet that accepts an SID, which fits our needs because we got that in our return.
PS C:\WINDOWS\system32> Get-Help Remove-LocalUser
SYNTAX
Remove-LocalUser [-InputObject] <LocalUser[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-LocalUser [-Name] <String[]> [-Confirm] [-WhatIf] [<CommonParameters>]
Remove-LocalUser [-SID] <SecurityIdentifier[]> [-Confirm] [-WhatIf] [<CommonParameters>]
What this means is that we can take the SID that Get-LocalGroupMember returns, and use it on Remove-LocalUser
So This should do the trick (run it in an elevated PowerShell):
Get-LocalGroupMember Users | Where { $_.PrincipalSource -eq 'Local' } | Foreach { Remove-LocalUser -SID $_.SID }
As you can see I have a Where-Object in the command above. This should make sure, that you only delete Local Users, so the NT-Authority ones should not be deleted. Anyhow I don't assume you could even delete them that easily.
As to Why it does not work with the Name Property: Get-LocalGroupMember seems to return the Name in this format Computer\UserName while Remove-LocalUser seems to only accept the format UserName