Login | |
|
 |
RE: Change user password on server - 11/1/2006 7:30:16 AM
|
|
 |
|
| |
SAPIENScripter
Posts: 270
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
|
As long as you have domain admin rights, you could use a script like this: dim objNetwork set objNetwork=CreateObject("Wscript.Network") strUser=InputBox("Enter the username:","Change Password","jdoe") If strUser="" Then WScript.Quit Set oUser = GetObject("WinNT://" & objNetwork.UserDomain & "/" & strUser & ",User") oUser.SetPassword(strUser) 'uncomment next line if you want user to be forced to change password 'oUser.Put "PasswordExpired",1 oUser.SetInfo
_____________________________
Jeffery Hicks Windows PowerShell MVP SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com Follow Me: http://www.twitter.com/JeffHicks
|
|
| |
|
|
|
 |
RE: Change user password on server - 11/2/2006 2:15:06 AM
|
|
 |
|
| |
SAPIENScripter
Posts: 270
Score: 2
Joined: 11/1/2006
From: SAPIEN Technologies
Status: offline
|
No. As long as you are running the script on a computer that is in the same domain, the script gets the domain name from the Wscript.network object. This works even if you have Active Directory.
_____________________________
Jeffery Hicks Windows PowerShell MVP SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com Follow Me: http://www.twitter.com/JeffHicks
|
|
| |
|
|
|
|
|