Glenn, I'm getting an error code of '0' zero which means its not working. I should be getting an error of '1' correct? Check the code below and see if there is an error here:

 Code:
$userinfo = 'testuser'
 $aAttributes = "adspath" ; "Name", "AdsPath", "member"
 $sADsPath = "LDAP://"+GetObject("LDAP://RootDSE").Get("defaultNamingContext")
 $strFilter = "(&(objectClass=user)(cn=*$userinfo*))"
 $aResults = fnLDAPQuery($aAttributes,$sADsPath,$strFilter)

 For $c = 0 to Ubound($aResults) 
		$x = TRIM(SUBSTR($aResults[$c,$r], 8, 20000))
	$GroupDN = 'CN=SecurityGroup,OU=Admins,DC=test,DC=com'
	 AdGroupMember('ADD', $GroupDN, $x)
 Next