NetUserChangePassword() 可以设置管理员密码吗?

NetUserChangePassword() can set a password to Administrator?

当您启用管理员用户登录时,密码默认为空。至少在Windows 10,如果你想用管理员用户登录远程计算机(通过RDP),必须先设置密码。

NetUserChangePassword()会成功吗?考虑到通常远程计算机只有 2 个用户(已经包括管理员),那么我的应用程序在第二个用户上执行 >>

是的,您可以使用NetUserSetInfo在本地设置管理员密码。

Members of the Administrators local group can set any modifiable user account elements. All users can set the usri2_country_code member of the USER_INFO_2 structure (and the usri1024_country_code member of the USER_INFO_1024 structure) for their own accounts.