How to Set the Group of users Password never expire and password not reset via powershell

SN, Yatheesha (Cognizant) 21 Reputation points
2022-10-06T17:27:08.463+00:00

How to set Group of AD Users Password never expiry and not reset the password Via Powershell

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,446 questions
0 comments No comments
{count} votes

Accepted answer
  1. Lein Baart 241 Reputation points
    2022-10-07T12:00:04.18+00:00
    Get-ADGroupMember "group name" | Set-ADUser -PasswordNeverExpires $true -CannotChangePassword $true  
    

    The above code will get all users of a particular group, and set each user's password to never expire and prohibit them from changing the password

    0 comments No comments

0 additional answers

Sort by: Most helpful