Created
December 11, 2013 16:32
-
-
Save janikvonrotz/7913696 to your computer and use it in GitHub Desktop.
PowerShell: Change Active Directory User Password Expiration
#PowerShell
#ActiveDirectory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Import-Module ActiveDirectory | |
Get-ADGroupMember "F_Mitarbeiter ohne Arbeitsplatz" -Recursive | | |
Get-ADUser -Properties PasswordNeverExpires | | |
where {$_.enabled -eq $true -and $_.PasswordNeverExpires -eq $false} | | |
select -First 50 | %{ | |
Write-Host $_.UserPrincipalName | |
Set-ADUser $_ -PasswordNeverExpires $true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment