General discussion

Locked

Password never expires

By lynn.mcbee ·
I have aprox. 2500 users and 300-400 of them have password never expire. I am looking for a batch utility that will give me a listing of all users with the password never expire checked. Then to follow up with another batch file to remove that option. The "net user" option will not help - I am unable to find an option specifically for password never expire.

This conversation is currently closed to new comments.

7 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Password never expires

by mmanning In reply to Password never expires

I belive that there is a utlity on the NT 4 Server Resource kit, it looks at the C2 classification setup of the server but it also looks at your issue and then tells you what needs to be done and it i belives that it will rectify this for you. Alternatively Policy i belive can also do this for you.

Collapse -

Password never expires

by lynn.mcbee In reply to Password never expires

Thanks, but what utility are you refering?

Collapse -

Password never expires

by tamj123 In reply to Password never expires

get this free software at
http://www.systemtools.com/somarsoft/
it can convert all your's user account info to a csv files include passowrd nver expire checked. After that, highlight all the users need unchecked, done it in one shoot.

Collapse -

Password never expires

by lynn.mcbee In reply to Password never expires

Poster rated this answer

Collapse -

Password never expires

by lbischofs In reply to Password never expires

Here's a WSH script you can use... It writes to an Excel spreadsheet.
On Error Resume Next

Const UF_HOMEDIR_REQUIRED = &H0008
Const UF_LOCKOUT = &H0010
Const UF_PASSWD_NOTREQD = &H0020
Const UF_PASSWD_CANT_CHANGE = &H0040
Const UF_TEMP_DUPLICATE_ACCOUNT = &H0100
Const UF_NORMAL_ACCOUNT = &H0200
Const UF_INTERDOMAIN_TRUST_ACCOUNT = &H0800
Const UF_WORKSTATION_TRUST_ACCOUNT = &H1000
Const UF_SERVER_TRUST_ACCOUNT = &H2000Const UF_DONT_EXPIRE_PASSWD = &H10000
Const UF_MNS_LOGON_ACCOUNT = &H20000

Dim RowNumber, ColumnNumber, XL, acctexp, MyPos, myUser, Input
ColumnNumber=1
RowNumber=1
Input = InputBox("Enter Domain name","Make Domain Choice")Set XL = CreateObject("Excel.Application")
XL.workbooks.add
XL.Visible = TRUE

XL.Cells(RowNumber, ColumnNumber).Value = "UserID"
XL.Cells(RowNumber, ColumnNumber+1).Value = "UserName"
XL.Cells(RowNumber, ColumnNumber+2).Value = Input & " Domain"
RowNumber=RowNumber+1

Set Group = GetObject("WinNT://" & Input & "/domain users")
For Each Member in Group.Members
MyPos = Instr(1, member.name, "$")
if MyPos = 0 then
Set myUser = GetObject("WinNT://" & Input & "/" & member.name)
Set acctexp = myUser.Get("AccountExpirationDate")
If myUser.UserFlags And UF_DONT_EXPIRE_PASSWD Then
XL.Cells(RowNumber, ColumnNumber).Value = member.name
'XL.Cells(RowNumber, ColumnNumber+1).Value = member.fullname
XL.Cells(RowNumber, ColumnNumber+1).Value = acctexp
XL.Cells(RowNumber, ColumnNumber+2).Value = "Password does not expire"
RowNumber=RowNumber+1
End If
end if
Next
Set XL=nothing
MsgBox ("Done")
WScript.Quit

Collapse -

Password never expires

by lynn.mcbee In reply to Password never expires

This a great script!!! Do you have a script where I can remove "password never expire" without going into UM for Domain? The program Hyena is also helping, but the scrip is what I perfer.

Collapse -

Password never expires

by lynn.mcbee In reply to Password never expires

This question was closed by the author

Back to Windows Forum
7 total posts (Page 1 of 1)  

Related Discussions

Related Forums