?
Solved

Re: How to automatically check Password Never Expires for all user in a Local PC

Posted on 2007-03-27
3
Medium Priority
?
247 Views
Last Modified: 2010-04-16
Hi guys,
i got a questions.... is it possible to automatic check the "password never expires" box option for all local user in the local pc using vbscript???
thank guys inadvance =)
0
Comment
Question by:Manfredtoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 71

Accepted Solution

by:
Chris Dent earned 1500 total points
ID: 18802760

But of course :) This should do it.

Const UF_DONT_EXPIRE_PASSWD = &H10000

strComputer = "SomePC"

Set objUsers = GetObject("WinNT://" & strComputer)
objServer.Filter = Array("user")
For Each objUser In objUsers
      intUserFlags = objUser.Get("userFlags")
      If intUserFlags And Not UF_DONT_EXPIRE_PASSWD Then
            objUser.Put "userFlags", intUserFlags XOr UF_DONT_EXPIRE_PASSWD
      End If
Next
0
 

Author Comment

by:Manfredtoo
ID: 18804212
Chris-Dent:hiya it pops up with this Error: Object required: 'objServer'
code: 800A01A8, Source: Microsoft VBscript runtime error. hmm....
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 18806441

Sorry this is a bit late, had to go to bed.

It should have read:

objUsers.Filter = Array("user")

Doing a few too many things at once. I take it you've got it all working?

Chris
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A common practice in small networks is making file sharing easy which works extremely well when intra-network security is not an issue. In essence, everyone, that is "Everyone", is given access to all of the shared files - often the entire C: drive …
Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

777 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