Reset Local Admin Passwords via GPO

Posted on 2006-05-05
Last Modified: 2010-04-13
I have a script that I am using to reset the local admin passwords on my PCs via a GPO.  I put the following vbscript in the startup of the policy.

Set WshNetwork = WScript.CreateObject("WScript.Network")
Set objUser = GetObject("WinNT://" & WshNetwork.ComputerName & "/Administrator, user")
objUser.SetPassword "password"

It works great for XP, actually changes the password, but I get a script error on line #2 on Windows 2000 machines.

Any help you can give me would be greatly appreciated,

Question by:IFITDepartment
    LVL 7

    Accepted Solution

    First of all it's not a really good idea to reset the local administrator password by policy because then all your workstations would have the same password, and since extracting the password from the local system is not too difficult (if you know what you're doing), you are potentially giving anyone control over all workstations. It's better to set a different password for every computer and maintain control using a domain administrator user.
    However if you still would like to enforce the password, you may use the following batch command:
    net user [username] [password]
    LVL 4

    Assisted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
    If you're not part of the solution, you're part of the problem.   Tips on how to secure IoT devices, even the dumbest ones, so they can't be used as part of a DDoS botnet.  Use PRTG Network Monitor as one of the building blocks, to detect unusual…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    761 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

    15 Experts available now in Live!

    Get 1:1 Help Now