Add-LocalGroupMember does not work properly

Welcome Forums General PowerShell Q&A Add-LocalGroupMember does not work properly

This topic contains 1 reply, has 1 voice, and was last updated by

1 year, 4 months ago.

  • Author
  • #81065

    Points: 0
    Rank: Member


    I reduced the code sniplet I am reffering to to some lines:

    $UserName         = "A6-R306TN97"
    $UserPassword     = "depp"
    $UserPasswordEnc  = $UserPassword | ConvertTo-SecureString -AsPlainText -Force
    New-LocalUser -Name $UserName -Password $UserPasswordEnc
    Add-LocalGroupMember -Member $UserName -Group Benutzer

    We are having about 450 PCs for students and since a long time, the computername is the same as the local username.

    When I add a user to the machine with the script above, the user is added, but it is not visible in the user Access control.
    We found out (via computermanagement -> compmgmt.msc), that the user is not Show als a member of the Group "Users".

    Although: When I do retype the Add-LocalGroupMember line it says, that it is already there.
    Adding Users with the same username as the machine Name in the UAC works fine.

    Any idea?

  • #81083

    Points: 0
    Rank: Member

    Forgot to mention: OS is Win 7 64bit.

The topic ‘Add-LocalGroupMember does not work properly’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort