Modify Local User Account Flags with PowerShell

This script uses the PowerShell bitwise operators to add or remove user account control flags on local user accounts. It currently generates a list of all local users accounts, adds the “Password Never Expires” flag to the account named “Administrator” and removes the flag from all other accounts. The two functions and list of flags can be used to produce any needed combination.