I am trying to read an XML file with user information and based on that information I want to add users to Active Directory groups. I have been looking up the error messages
This do what you need:
$Connection = "LDAP://Server/CN=MyGoup,OU=MyOU,DC=MY,DC=CORP" $Group = [adsi] $Connection $User = "LDAP://Server/CN=MyUser,OU=MyOU,DC=MY,DC=CORP" $Group.Add($User)
You have to check the contents of $CurUser AND $User variables.