Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search object by attribute with less or greater than #82

Open
schneidr opened this issue Jul 24, 2024 · 0 comments
Open

Search object by attribute with less or greater than #82

schneidr opened this issue Jul 24, 2024 · 0 comments

Comments

@schneidr
Copy link

Is there any way to search for objects by attributes and using <= or >= as search operators?

For example, I want to search for all user accounts that have been created within the last seven days. With a regular LDAP query I can do this:

    start_time = datetime.today()  - timedelta(days = 7)
    result = self.search(
        "(&(objectClass=user)(whenCreated>={}))".format(start_time.strftime("%Y%m%d%H%M%S.0Z")),
        ["cn", "displayName", "mail", "o", "whenCreated"]
    )

With this library I only see the option to search with the = operator. Is there any way to to this with ms_active_directory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant