use alter user to lock all user accounts except scott How do I use alter user to lock all user accounts and password expire them while picking out select users to exclude from the command?
You can't lock out a login except by attempting logins with incorrect passwords enough times to cause it to be locked out.  The ALTER LOGIN documentation shows the UNLOCK option, but there is no LOCK option.

Additionally, you can't force a password to be expired because the expiration is defined by the domain or local system policy.  You would have to change the policy to a date that would force the desired logins to have expired passwords, but there's no way you could ensure that would apply to only certain logins (unless you disabled password expiration on the others).