nayel
asked on
VBscript Trim function does not work fine
i have VBScript code taking mail attribute from our active directory , i used Trim function to remove spaces from email value, but it not work allways i got some emails with its spaces.
here is lines from the script
here is lines from the script
objCommand.CommandText = "SELECT company,department,mail,userPrincipalName,Name,ADsPath,displayName,userCategory ,distinguishedName,sAMAccountName FROM 'LDAP://DC=aa,DC=uaeu,DC=ac,DC=ae' WHERE objectCategory='User' AND sAMAccountName='" & LDAPUserID & "'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
UserEmail=LCase(objRecordSet.Fields("mail").Value)
UserEmail=Trim(UserEmail)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.