Ok, so I have been going at this forever now and I am finding no answers to this that actually work. So, I am trying to create a Script which will make a local user change their password when they next logon. I have looked and looked and looked, but nothing helps. Though I feel like I’m close but missing something. Now I will say I am very, very new to scripting in general so sorry if I seem dumb, but I’d love the help. Also, I am using Windows 10 (not sure if that will make a difference). I am also creating this for a school assignment and I did ask my teacher for a hand, but it’s been a week sense I have heard anything. Thank you!
Now here is what I have:
strComputer = "LAPTOP-56BDJGPQ"
Set usr = GetObject("WinNT://LAPTOP-56BDJGPQ/Guest,user")
usr.Put "PasswordExpired", 1
usr.SetInfo
Now, I know that maybe where it says /Guest,user might be incorrect but I have also tried using my account which is the admin, even that seem to do nothing.
Here is what happens when I run it (now, I do run everything through command prompt)
c:\Comp230>cscript USER_Logon_reset.vbs
Microsoft (R) Windows Script Host Version 5.812
Copyright (C) Microsoft Corporation. All rights reserved.
c:\Comp230>
Now this to me shows it ran, but when I go to test to see if it worked well nothing happens.
I will say I have tried other ways of scripting this part like replacing usr.Put to objUser.Put, etc. I would love any input I could get because this is frustrating.