Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. ExpDaysMax = CInt(InputBox("Enter amount of days:","Find expire passwords",""))
  2.  
  3. dim targetGroups(4)
  4.  
  5. targetGroups(0) = "Account Managers"
  6. targetGroups(1) = "Resource Managers"
  7. targetGroups(2) = "General Admins"
  8. targetGroups(3) = "Help Desk"
  9.  
  10. For Each objGroup in targetGroups
  11.  
  12. Set group = GetObject("WinNT://bsit/" & CStr(objGroup))
  13.  
  14. For Each user in group.Members
  15.  
  16. ExpDays = CInt(user.PasswordExpirationDate - Now() - 1)
  17.  
  18. If ExpDays < ExpDaysMax Then
  19.  
  20. Wscript.Echo("Password for user " & user.Name & " will expire soon. " & ExpDays & " days left.")
  21.  
  22. End If
  23.  
  24. Next
  25. Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement