Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Change user password on server

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,39327
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Change user password on server
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Change user password on server - 11/1/2006 2:17:35 AM   
  174soft

 

Posts: 4
Score: 0
Joined: 11/1/2006
Status: offline
Original message moved by ebgreen
Reason : Moved to appropriate forum
How can i change users password from my computer. My Domain is wk12.com. Username wkadmin and have administrator rights.
Can anyone help me with this problem. Thank you
 
 
Post #: 1
 
 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

(in reply to 174soft)
 
 
Post #: 2
 
 RE: Change user password on server - 11/1/2006 5:21:56 PM   
  174soft

 

Posts: 4
Score: 0
Joined: 11/1/2006
Status: offline
Thank you for your help, I will check it tomorrow and let you know if everything is ok.
One question more. In your script i don't need to enter the domain name.

(in reply to SAPIENScripter)
 
 
Post #: 3
 
 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

(in reply to 174soft)
 
 
Post #: 4
 
 RE: Change user password on server - 11/2/2006 11:45:39 AM   
  174soft

 

Posts: 4
Score: 0
Joined: 11/1/2006
Status: offline
Thank you, it works fine. Thank you for your help.

(in reply to SAPIENScripter)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Change user password on server Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts