New DirectoryEntry("LDAP://" & ldapServerName & "/dc=anydomain, dc=com", "username, "password", AuthenticationTypes.None)
Looks like basic to me; are you using VB.Net or perl?
That is VB.Net. A better place for future .NET/LDAP questions is: http://tech.groups.yahoo.com/group/ADSIANDDirectoryServices/