locked
ldapsearch + ldapdelete RRS feed

  • Question

  • User-1033764694 posted

    Hi everyone,

    I've been looking for a solution to one of my problems for quite some time now.
    I would like to delete all users in a LDAP except for a few chosen names. The command must be run in cmd.exe due some restrictions on the server.

    Does anyone have a clue on how to acomplish that ?
    I think i have figured out the right way of filtering: ( taken from the Softerra ldap client)

    Filter: (&(!(uid=user1))(!(uid=user2))(!(uid=user3))(!(uid=user4))(!(uid=user5)))

    Thanks in advance

    Daniel Olsson

    System administrator

    Tuesday, September 27, 2011 9:11 AM

Answers

  • User1560780540 posted

    Are you targetting Active Directory?

    If you have some LDAP browsing tool (for Active Directory, you have tool i.e. ADUC, ADSIEdit, LDP), you can select all the users, you want to delete, and delete them.

    Go through this link for Active Directory user deletion.

    http://technet.microsoft.com/en-us/library/cc779035(WS.10).aspx

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 27, 2011 11:59 AM