Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. GroupName = InputBox("Enter group:","Unblock account","")
  2.  
  3. DomainController = "flight"
  4.  
  5. Set objGroup = GetObject("WinNT://" & DomainController & "/" & GroupName)
  6.  
  7. For Each Member in objGroup.Members
  8.  
  9. If Member.Class = "User" Then
  10. If Member.IsAccountLocked = TRUE Or Member.AccountDisabled = TRUE Then
  11. Wscript.Echo(Member.Name & " has been locked. It unlock now")
  12. Member.IsAccountLocked = FALSE
  13. Member.AccountDisabled = FALSE
  14. Member.SetInfo
  15. End If
  16. End If
  17. Next
  18.  
  19. Wscript.Echo("All users in " & GroupName & " are unlocked now")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement