Steps to reproduce
This issue is copied from MicrosoftDocs/PowerShell-Docs#3555
Be aware if the computer is member of a domain and you try to add a local user with same name as a member of the domain it adds the domain member.
$Password = ConvertTo-SecureString -String "Testing@19" -AsPlainText -Force
New-LocalUser -Name "User" -Description "Local bruger" -Password $Password -FullName "NewLocalUserWithTheSameNameAsOneInTheDomain"
Add-LocalGroupMember -Group "TheLocalGroup" -Member "User"
Steps to reproduce
This issue is copied from MicrosoftDocs/PowerShell-Docs#3555
Be aware if the computer is member of a domain and you try to add a local user with same name as a member of the domain it adds the domain member.