Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

DirectorySearcher.FindOne throws exception when search string is not formatted properly. #10059

Copy link
Copy link
Open
@deepakbansal-nith

Description

@deepakbansal-nith
Issue body actions

I specified Searcher.Filter = ((objectClass=user)(SAMAccountName=09433923)).
I forgot to add an & before objectClass Filter.
I kept getting "The directory service is unavailable" exception when Searcher.FindOne() method was called.
As soon as I added the & and set the searcher to Search.Filter = (&(objectClass=user)(SAMAccountName=09433923)) , it worked.
I did not expect an exception to happen if the search string was invalid.
I was expecting a null result potentially.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pri3Indicates issues/PRs that are low priorityIndicates issues/PRs that are low priorityarea-System.DirectoryServicesuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.