Change Password of a local windows user

前端 未结 2 1408
太阳男子
太阳男子 2021-01-14 02:39

Usually it is possible to change it´s own password in Windows, without having admin-rights.

I\'m writing a tool to manage users and Groups on severa

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-14 03:02

    You could theoretically use a workaround by using the WinNT provider to instantiate the DirectoryEntry object, enabling the user to change passwords without supplying domain admin rights. You might also consider the code posted here, using an encrypted database to store admin credentials.

    This is a risky move, perhaps, depending on the nature of your storage (you could use a hash of the MAC address of the machine as a password maybe?), but I'm not sure there is another method of doing this. As far as I'm aware, the answer supplied by eMi wouldn't work without an authenticated instance of DirectoryEntry, although I could be wrong.

提交回复
热议问题