none
How to find user by login? RRS feed

  • Question

  • I'm writing a telegrambot for changing user's password in local network. So, i ask user for login and I need to ensure that acccount exists and then reset password by "dsmod user ..." command.

    I've tried to use "dsquery user -samid "login" but it doesn't work, its just resend command without any message.

    I thought that the problem in login. So i've tried to get user list in known group.

    AD have this structure

    """

    my.domain

    |ПКО //cyrrilic

    --|162

    ----|Вася Пупкин //samid ПупкинВ (cyrrilic)

    --|171

    |МА

    --|153

    --|162

    """

    i've asked all groups in ad

    >dsquery ou DC=my,DC=domain

    "OU=ПКО,DC=my,DC=domain"

    "OU=162,OU=ПКО,DC=my,DC=domain"

    "OU=171,OU=ПКО,DC=my,DC=domain"

    "OU=МА,DC=my,DC=domain"

    "OU=153,OU=МА,DC=my,DC=domain"

    "OU=162,OU=МА,DC=my,DC=domain"

    >dsquery user "OU=162,OU=ПКО,DC=my,DC=domain"

    dsquery ou OU = 162, OU =?
    dsquery Failed: The main directory service link is not configured. Therefore, the directory service will not be able to provide references to objects outside this forest.
    type dsquery /? for help. (translated from russian)

    Soo, i need help with

    1.how to ensure that account with some login exists

    2.how to get dn from 1. and reset password

    Thanks

    p.s. sorry my english

    • Edited by ZarinRaim Wednesday, October 4, 2017 9:45 AM
    • Moved by Bill_Stewart Tuesday, November 7, 2017 10:50 PM Unanswerable drive-by question
    Wednesday, October 4, 2017 9:44 AM

All replies