Hi,

This is a the code I'm trying to use:
Code:
$strUserName = "username"
$group = "groupname" ; The group you are trying to connect to
;
$ldapuser= "ou=xxx,ou=yyy,ou=hhhh,dc=dddd,dc=ff,dc=kkkk,dc=com"
$adsUser = GetObject("LDAP://cn="+$strUserName+","+$ldapuser,1)
;
$ldapgroup = "ou=xxx,ou=yyy,ou=hhhh,dc=dddd,dc=ff,dc=kkkk,dc=com"
$adsGroup = GetObject("LDAP://cn="+$group+","+$ldapgroup) ; Connects to the ldap path of the group
;
If @Error <> 0
$null = messagebox(@SError,@Error,0)
Else
$null=messagebox($adsGroup.name,"Success",0)
Endif

$adsGroup.add($adsUser.ADsPath)