Set password to never expire from CSV

Welcome Forums General PowerShell Q&A Set password to never expire from CSV

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 7 years, 2 months ago.

  • Author
  • #6181

    Points: 0
    Rank: Member

    by stu_mchugh at 2012-09-20 04:17:09

    I'm trying to workout (and failing) how to set the "Password Never Expire" check box for a list of users in a CSV. I have tried with the follow code but don't know to set the flag

    $import=import-csv -Path "C:\stu\scripts\test.csv"
    foreach($dataRecord in $import)

    $user=get-QADUser -identity $sAMAccountName

    set-QADUser -identity $sAMAccountName
    write-Output $user.DN


    After the "Set-QADUser" and indentifty the user I don't know how to set the password flag????
    Any Ideas!?

    by poshoholic at 2012-09-20 04:44:21

    You need to use the -PasswordNeverExpires parameter, like this:
    Set-QADUser -Identity $sAMAccountName -PasswordNeverExpires $true

    by stu_mchugh at 2012-09-20 06:05:56

    Nice one! thanks!

    by RichardSiddaway at 2012-09-20 11:09:10

    If you can't use the quest cmdlets the other ways of doing it are given in this post ... xpire.aspx

The topic ‘Set password to never expire from CSV’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort