A New Template for Joomla!


Set Password Never Expires using PowerShell

Today I wanted to set the "Password Never Expires" setting but didn't have access to a GUI. I was using Hyper-V Server, ie Server Core. I could have used the admin tools from a Windows 7 computer, but in this case I was logging in remotely and didn't want to set up a VPN. So I found the following PowerShell commands to do the trick.

Run PowerShell as Administrator and type in the following commands, replacing "username" for your, um, username.

$user = [adsi]"WinNT://./username"
$user.UserFlags.value = $user.UserFlags.value -bor 0x10000