Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

VBS Password Change help

$
0
0

I'm trying to change domain users passwords with VBS script. I got it to work with passwords, but now I need it to prompt them to change it when they first log on. I'm not sure what I'm missing.

strUser = InputBox ("Enter User Name")

On Error Resume Next

Set objUser = GetObject("WinNT://domain/" & strUser &", User")

objUser.SetPassword ("Password")

objUser.Put "pwdLastSet", 0

objUser.SetInfo

If Err.Number <> 0 Then

MsgBox "Error..."

Err.Clear

Else

MsgBox "The password has been changed for " & strUser &"

End If


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>