Modified from the stackoverflow answer you've provided:
secedit /export /cfg c:\secpol.cfg
(gc C:\secpol.cfg).replace("DontDisplayLastUserName=4,0", "DontDisplayLastUserName=4,1") | Out-File C:\secpol.cfg
secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY
rm -force c:\secpol.cfg -confirm:$false
1. Export the system security configuration to C:\secpol.cfg
2. Get the content of this file and make string replacement to enable your desired policy
3. Update the local security policy with the updated configuration
4. Delete the exported config file
While this approach will work as is, you may want to consider Conrad's comment. If you're going to be doing anything more with security policy, you might want to consider this answer, or finding something similar (perhaps PolicyFileEditor?).