PDA

Click to See Complete Forum and Search --> : can someone explain user accounts for me?


Daemoncraft
Sep 20th, 2006, 04:46 PM
I have been tryin to look for a long time now..I cant figure out how to code something that will do this:

List all the user accounts on the computer,
change passwords on the accounts

jmcilhinney
Sep 20th, 2006, 05:54 PM
You can list accounts using the Win32_UserAccount WMI class through the System.Management namespace. Gigemboy's signature has some useful WMI stuff. That class doesn't offer a property or method to set the password though. This isn't a big shock really. I'd not be surprised to learn that Windows doesn't offer a way to programmatically change user passwords. Letting any old application do that could be a bit dangerous.

Harsh Gupta
Sep 20th, 2006, 05:59 PM
Nope, MS do provide a NetUserChangePassword API (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netmgmt/netmgmt/netuserchangepassword.asp) to change password's of user accounts. ;)

mendhak
Sep 21st, 2006, 08:01 AM
I agree that it's dangerous and I've always wondered why it exists at all.