troubleshooting Question

use webdav to search exchange contacts by email address

Avatar of bendruitt
bendruitt asked on
ExchangeC#File Sharing Software
5 Comments1 Solution1057 ViewsLast Modified:
I am trying to search exchange contacts by 'email1' field. In my c# code the following works:

            string strQuery = "<?xml version=\"1.0\"?><D:searchrequest xmlns:D = \"DAV:\" ><D:sql>"
           + "SELECT " +
            "\"DAV:href\", " +
            "\"urn:schemas:contacts:cn\"," +
            "\"urn:schemas:contacts:email1\"," +
            "\"urn:schemas:contacts:street\"," +
            "\"urn:schemas:contacts:l\"," +            
            "\"urn:schemas:contacts:mobile\"," +
            "\"urn:schemas:contacts:telephoneNumber\"," +
            "\"AVRemind\"," +
            "\"AVExpiry\"," +
            "\"AVReminderSent\"" +
            " FROM \"" + strRootURI + "\"" +
            " WHERE \"DAV:ishidden\" = false AND \"DAV:isfolder\" = false AND" +
            "\"urn:schemas:contacts:email1\" like 'beachespf.com.au%' " +  
            "</D:sql></D:searchrequest>";

If I change the second last line to include the full email address (with the @ symbol) I get no results in my XML response:

<?xml version="1.0"?><a:multistatus xmlns:b="urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" xmlns:c="xml:" xmlns:d="urn:schemas:contacts:" xmlns:a="DAV:" />

It seems like the '@' symbol is breaking my query string. How do I correctly search for contacts by 'email1' field including their full email address?
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros