Saturday, January 26, 2008

How can I change my user-account password from a Command Prompt?

Article by: Sambhu Pradhan(Analyser)
You can change a Windows User Account password that is on any Windows computer from any other Windows computer regardless of whether the User Account is on a workstation, a stand-alone server, or a Windows domain controller. Additionally, it makes no difference whether the password being changed from a workstation, a stand-alone server, or a Windows domain controller. This is true for any NT 4.0, W2K, XP Pro and Windows Server 2003 computer.
To change a user's password at the command prompt, log on as an administrator and type:
net user sambhu * /domain
(This is only an example, use your own username)
When you are prompted to type a password for the user, type the new password, not the existing password. After you type the new password, the system prompts you to retype the password to confirm. The password is now changed.
Alternatively, you can type the following command:
net user sambhu 123456 /domain
When you do so, the password changes without prompting you again. This command also enables you to change passwords in a batch file.
Note: If you type these commands on a member server or workstation and you don't add the /domain switch, the command will be performed on the local SAM and NOT on the DC SAM.
For example, to change the administrator's password type:
net user administrator 123456
Note: Non-administrators receive a "System error 5 has occurred. Access is denied" error message when they attempt to change the password.
HOWTO: Change your XP password via the command line[I tested myself and it Works ]
I submitted this quick tip to Lifehacker in the past. If you feel the need to change your Windows password, you don’t need to go through any Control Panel menus and whatnot. You can change any user’s password via the command line, as long as you have administrative access. A good example of when to use this tip would be after a fresh install of XP. One of the first things you should do is lo into the default Administrator account and set a password. That requires booting into Safe Mode as Administrator, setting a password, then booting back into Normal mode as your own user. Instead,
go to Start > Run > “cmd” [Enter], then enter:
net user

c:\Documents and settings\sambhu>net user sambhu password
The command completed successfully.
This will set the password you supplied as the password for the user you entered. You can also do:
net user *
c:\Documents and settings\sambhu>net user sambhu password*
Type a password for the user:
Retype the password to confirm:
The command completed successfully.

This will prompt you for a password, then have you confirm it.NOTE: you need administrator access to change the password via this command. However, if you are an administrator, you can change the password for any account on the machine. As you can see, this is a very powerful command, but it can also pose as a security threat.

No comments: