Answered Active directory lock C#

  • Friday, April 27, 2012 2:12 PM
     
     
    0

    Hi

    We are generating the Random temprary Password and sending the  password in the mail to the user .The account should be locked unless the user changes the password by using the temp password .Once the password is changed,user account should be unlocked

    Thanks


    Girish

All Replies

  • Friday, April 27, 2012 2:16 PM
     
     
    This cannot be done.  You cannot define what password is acceptable when the user changes password, except by enforcing complexity rules, etc.

    Grant Ward, a.k.a. Bigteddy

    What's new in Powershell 3.0 (Technet Wiki)

  • Friday, April 27, 2012 3:53 PM
     
     

    Also, if the account is locked, how can you expect the user to retreive the email?

    Karl


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer



    My Blog: http://unlockpowershell.wordpress.com
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})

  • Friday, April 27, 2012 4:05 PM
     
     Answered

    While I'm at it, you are not asking anything about scripting as far as I can tell?

    Even the title is C# :)


    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer



    My Blog: http://unlockpowershell.wordpress.com
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ("6B61726C6D69747363686B65406D742E6E6574"-split"(?<=\G.{2})",19|%{[char][int]"0x$_"})

  • Friday, April 27, 2012 5:05 PM
    Moderator
     
     

    Hi Girishgouda,

    Your question doesn't make sense.  I think you should describe the goal, not the steps. Also, as Karl pointed out, why ask a C# question in a scripting forum?

    Bill

  • Sunday, April 29, 2012 2:41 AM
    Moderator
     
     

    The account cannot be locked, or the user will be unable to logon with the password you communicate to them.

    When you assign the new random password, you can expire the password so it must be reset at first logon. If the password is reasonably complex and random, only the person with the correct password will be able to logon with it.


    Richard Mueller - MVP Directory Services