Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set PasswordNeverExpires flag for Local User Group through Powershell

I need to be able to change the PasswordNeverExpires option in the Local User Group properties area.

User Properties Example

I already know that I will have to use a flag in order to perform this action as stated in the article:

How to use the UserAccountControl flags to manipulate user account properties

How would I be able to target the user in question through a Powershell script?

Thanks

like image 294
User 5842 Avatar asked Oct 21 '25 14:10

User 5842


1 Answers

This will also work.

Set-LocalUser -Name "Administrator" -PasswordNeverExpires:$true

See: https://technet.microsoft.com/en-us/library/mt651674.aspx?f=255&MSPPError=-2147217396

like image 165
PacketMagic Avatar answered Oct 23 '25 03:10

PacketMagic