Configure Windows Automatic password change and automatic logon

Source: Internet
Author: User

Daily operation of the Victor server, quarterly to modify the password, very troublesome, now do a VBS script, the first day of the quarter run regularly, you can solve the problem, the implementation of the script as follows:
Autochg_pwd.vbs

Ystr=year (now)
Mstr=month (now)
If Len (MSTR) <2 then mstr= "0" &mstr
Dstr=day (now)
If mstr= "mstr=" then "!"
If mstr= "mstr=" then "!"
If mstr= "mstr=" then "!"
If mstr= "then mstr=" @ "
If mstr= "then mstr=" @ "
If mstr= "then mstr=" @ "
If mstr= "" Then mstr= "#"
If mstr= "then mstr=" # "
If mstr= "mstr=" then "#"
If mstr= "then mstr=" $ "
If mstr= "one" then mstr= "$"
If mstr= "then mstr=" $ "
Pwdstr= "Testpwd" &ystr&mstr

Strcomputer= "."

Set objuser=getobject ("winnt://" & StrComputer & "/administrator")

Objuser.setpassword Pwdstr

Objuser.setinfo

Dim Operationregistry
Set operationregistry=wscript.createobject ("Wscript.Shell")
Default=operationregistry.regread ("hklm\")
Operationregistry.regwrite "HKLM\Software\Microsoft\Windows Nt\currentversion\winlogon\defaultpassword", Pwdstr

Specific parts of the script needs to be modified according to the actual situation, the above is tested on the windows2012 (2012 Change password does not affect the scheduled task), the actual windows2003 should be noted, because the automatic password change will cause the scheduled task exception, not necessarily applicable.

Configure Windows Automatic password change and automatic logon

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.