How do I create a script to flag accounts to require passwords and force expirations?

Posted on 2009-04-18
Last Modified: 2012-05-06
I need to make a script for default domain policy to force all local accounts within all domain PC's to have the passwordreq flag as well as remove the "password never expires" flag.

I have been searching the interwebs with no luck.

Note that I am, at best, a novice in this area.  Any help is appreciated!
Question by:whitman911
    LVL 76

    Accepted Solution

    I think this is possible with vbscript to connect through the AD and adjust the settings as you mentioned.  I think there was an EE article that discussed this.
    Here are different scripting examples that you could use to build the script to do the tasks you want:

    In your case, you do not need to expire passwords since you suggest that you had the never-expire options set.

    Note, you should do a group of users at a time rather than forcing all to change their password at once.  Also note to make sure not to expire service accounts.
    LVL 65

    Assisted Solution

    This may help too:
    How Can I Configure an Active Directory Account So the Password Never Expires?



    Featured Post

    Superior storage. Superior surveillance.

    WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

    Join & Write a Comment

    Users of Windows 10 Professional can disable automatic reboots using the policy editor. This tool is not included in the Windows home edition. But don't worry! Follow the instructions below to install (a Win7) policy editor on your Windows 10 Home e…
    Article by: btan
    The intent is not to repeat what many has know about Ransomware but more to join its dots of what is it, who are the victims, why it exists, when and how we respond on infection. Lastly, sum up in a glance to share such information with more to help…
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now