Skip to content

Add-LocalGroupMember prefer to add domain account over local #12289

@sdwheeler

Description

@sdwheeler

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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Questionideally support can be provided via other mechanisms, but sometimes folks do open an issue to get aResolution-No ActivityIssue has had no activity for 6 months or moreWG-Cmdletsgeneral cmdlet issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions