Ads 468x60px

Friday, 30 January 2015

Set bulk user account to password never expiry option



Friends, couple of days ago I'd a task to set bulk user account attribute to Password never expiry option.

If the account list consist more then 50+ users records then it is pretty difficult to set the option manually.

Microsoft has provided powershell command line utility which comes into picture and makes your task very easy in no time.

Here is the command to set the attribute to Password never expiry,

Before you run the command, you need to understand it well and check the dependency things related to this commands

Get-content c:\user.txt | set-aduser -passwordneverexpiry $true
or

get-content “c:\users.txt” | Set-QADUser -ObjectAttributes @{useraccountcontrol=65536}

The above command will extract the provided logon names from the text format and command Set-QADUser command will not run unless you have Quest Powershell Management Pack installed and imported into powershell.

Here is the link to download the Quest powershell Management pack:

Note;- Always run Powershell with Administrator Privileges.






0 comments:

Post a Comment