Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1618
  • Last Modified:

Local admin account - needs password never expires set via Script, GPO, or other

On our Windows 7 computer images, we create a local admin account for IT purposes when we need to login locally when that is our only option.

The problem is, that on the image, I forgot to check the "password never expires".  So now when we use the account months later, it prompts the tech to change the password.

I need to push this change out, where the "password never expires" gets checked, but not sure how.  Again, it's a local admin account on Windows 7 machines and I only need to apply this change only.

Also I may need to push out a change to reset the password back to your current standard, but the most important item is setting the local acocunt password to never expire to start with.
0
tdwhelp
Asked:
tdwhelp
  • 2
  • 2
  • 2
  • +2
3 Solutions
 
dsexton18Commented:
0
 
vnicolaeCommented:
You can create a Group Policy startup script that looks something like that:

Const ADS_UF_DONT_EXPIRE_PASSWD = &h10000
 
Set objUser = "your_username"
intUAC = objUser.Get("userAccountControl")
 
If ADS_UF_DONT_EXPIRE_PASSWD AND intUAC Then
    Wscript.Echo "Already enabled"
Else
    objUser.Put "userAccountControl", intUAC XOR _
        ADS_UF_DONT_EXPIRE_PASSWD
    objUser.SetInfo
    WScript.Echo "Password never expires is now enabled"
End If
0
 
dsexton18Commented:
Also take a look at the net user commands
http://support.microsoft.com/kb/251394
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
TheGorbyCommented:
If for some reason that doesn't work, you could create this simple 1-line batch script and run it as a startup script on all machines. I would of course test this on one computer first.

Note that this will change the setting for all local users on the PC, but not domain users.

http://technet.microsoft.com/en-us/library/bb490698.aspx
NET ACCOUNTS /MAXPWAGE:UNLIMITED

Open in new window

0
 
vnicolaeCommented:
For the "net.exe" commands to work, they have to be executed with local admin privileges.
0
 
TheGorbyCommented:
Since startup scripts run as local system, admin privilages shouldn't be a problem.
0
 
tdwhelpAuthor Commented:
Thanks.  I will use the NET ACCOUNTS /MAXPWAGE:UNLIMTED method
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now