To add our new User to our Group, the add() method is used as shown below.
PS > $Connection = "LDAP://Server1/CN=NewGroup,OU=NewOU,DC=APA,DC=CORP" PS > $Group = [adsi] $Connection PS > $User = "LDAP://Server1/CN=jeapic,OU=NewOU,DC=APA,DC=CORP" PS > $Group.Add($User)If we look at the memebers of the group, our user will be added.
PS > $Group.member CN=jeapic,OU=NewOU,DC=APA,DC=CORPIn the AD MMC Snapin, we can view the changes that we made.
And if we want to remove a user from a Group we can use the Delete() method.
PS > $Group.Remove($User)Below is the code used in this post
$Connection = "LDAP://Server1/CN=NewGroup,OU=NewOU,DC=APA,DC=CORP" $Group = [adsi] $Connection $User = "LDAP://Server1/CN=jeapic,OU=NewOU,DC=APA,DC=CORP" $Group.Add($User)
[?]