ecederstrand / exchangelib

Python client for Microsoft Exchange Web Services (EWS)
BSD 2-Clause "Simplified" License
1.18k stars 248 forks source link

Equivalent to SearchDirectory(MS EWS c# method) #724

Closed srinathgnath closed 4 years ago

srinathgnath commented 4 years ago

Hello,

Is there an equivalent method "SearchDirectory" in exchangelib? I want to filter out conference room using search.

C#: SearchDirectory("(&(objectClass=*)(msExchRecipientDisplayType=7))")

Thanks, Srinath

ecederstrand commented 4 years ago

Is the search string a QueryString? If so, QueryStrings are supported in exchangelib. See the README for more.

To locate the folder you want to do the search on, just list your entire folder structure with account.root.tree() and find your search folder location.

srinathgnath commented 4 years ago

Sorry for the confusion. Directory search was part of LDAP library(c#), not EWS.

I was having issue in fetching the list of conference rooms using get_roomlists() and get_rooms() methods, Later I came to know that those methods doesn't work as its not defined at exchange. So I did used DirectorySearcher (c#) to get the conference rooms, initially i thought this was part of EWS. But this run against the LDAP to fetch details.

Adding the reference link here, if anyone come across similar issue. https://docs.microsoft.com/en-us/dotnet/api/system.directoryservices.directorysearcher.findall?view=netframework-4.8