Password Expire - Help Needed 
Author Message
 Password Expire - Help Needed

I need to find a way via VBScript I can access domain information about my
users.  I need to have it tell me how many days until thier password
expires.  Does anybody have any info on this?

Thanks
David Heiney



Sat, 03 May 2003 03:00:00 GMT  
 Password Expire - Help Needed

Use ADSI...

This example also uses msg.wsc for output, available at:

Win32 Scripting [Clarence Washington]
http://cwashington.netreach.net

or adapt it to echo to a console window...

==============================================

set msg = createobject("msg.wsc")
with msg
  .resizebypercent 50,100
  .center
  .show
  .buffer = true
end with
vDomainUser = _
  InputBox("Enter domainname/username",,"domainname/username")

if Trim(vDomainUser) = "" then WScript.quit
if Instr(1,vDomainUser,"/") = 0 then WScript.quit
on error resume next
Set oUser = GetObject("WinNT://" & vDomainUser & ",USER")
if err then
  msgbox err.description
  wscript.quit
end if
oUser.GetInfo

on error resume next

msg.write "Class: "      & oUser.Class
msg.write "Name: "       & oUser.Name
msg.write "FullName: "   & oUser.FullName
msg.write "LastLogin: "  & oUser.LastLogin
msg.write "LastLogoff: " & oUser.LastLogoff
msg.write "PasswordExpirationDate: " & oUser.PasswordExpirationDate
msg.write "IsAccountLocked: "        & oUser.IsAccountLocked
msg.writehtml "<hr>"
set prop = oUser.First
for i = 1 to oUser.propertycount
 msg.write prop.name & "=" & oUser.Get(prop.name)
 set prop = oUser.Next
next
msg.writehtml "<hr>"
For Each oGroup In oUser.Groups
  msg.write oGroup.Name
Next
msg.complete

--
Michael Harris
Microsoft.MVP.Scripting
--


Quote:
> I need to find a way via VBScript I can access domain information about my
> users.  I need to have it tell me how many days until thier password
> expires.  Does anybody have any info on this?

> Thanks
> David Heiney




Sat, 03 May 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Password Expire - Help Needed

2. user password never expires

3. Password never expires

4. Querying if Password Never Expires is Checked

5. NT password expire days left

6. Displaying when days until Password Expires in AD

7. Set password never expires?

8. password never expires

9. How to get list of users have expired password

10. Password Expiring Value

11. Propertie "Password Never Expires..."

12. Password never expires

 

 
Powered by phpBB® Forum Software