How can I disable password expiration for all local users without WMIC?

0
6
Asked By CuriousCoder42 On

Hey everyone! With WMIC being phased out, I'm looking for a way to disable password expiration for all local accounts on my computer. I was previously using the command "wmic UserAccount set PasswordExpires=False" through CMD to do this remotely. Does anyone know an alternative command I can use in PowerShell to achieve the same result?

2 Answers

Answered By TechGuru88 On

You can use PowerShell to handle this by utilizing the `Get-LocalUser` cmdlet and piping it to `Set-LocalUser`. This way, you can disable password expiration for all local users efficiently.

Answered By HelpfulHarry99 On

Have you considered using the command `Set-LocalUser -Name "username" -PasswordNeverExpires $true`? Just keep in mind that this one is specific to a certain username. If you're looking for a way that applies to all accounts at once, you might want to tweak it a bit.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.