Help about account lockedout 
Author Message
 Help about account lockedout

You can find which user accounts are locked out or
disabled, but not their workstation. A script that would
find all such accounts in a domain, then reset the account
if you consent, could be:

Set oShell = CreateObject("Wscript.Shell")
Set oDomain = GetObject("WinNT://MyDomain")
oDomain.Filter = Array("user")
sTitle = "Account Status"
sConstants = vbYesNo + vbExclamation

For Each oUser In oDomain
  Flags = oUser.Get("UserFlags")
  If (Flags And &H10) <> 0 Then
    sText = "User " & oUser.Name & " is locked out."
    sText = sText & vbCrLf & "Unlock the account?"
    bAns = oShell.Popup(sText, 0, sTitle, sConstants)
    If bAns = vbYes Then
      Flags = Flags Xor &H10
      oUser.Put "UserFlags", Flags
      oUser.SetInfo
    End If
  End If
  If (Flags And &H2) <> 0 Then
    sText = "User " & oUser.Name & " is disabled."
    sText = sText & vbCrLf & "Re-enable account?"
    bAns = oShell.Popup(sText, 0, sTitle, sConstants)
    If bAns = vbYes Then
      Flags = Flags Xor &H2
      oUser.Put "UserFlags", Flags
      oUser.SetInfo
    End If
  End If
Next

Richard

Quote:
>-----Original Message-----
>How can I find the workstation name, or other
information,
>that are locked out an account????
>I use Adsi for check and unlocked the accounts on my
>domain.
>Thanks in advance for collaboration,

>Valerio
>.



Sun, 04 Jul 2004 01:47:43 GMT  
 Help about account lockedout
Try Lan's code.

Alternatively, you also can use LDAP protocol.

This posting is provided ?AS IS?, with no warranties, and confers no
rights.



Tue, 06 Jul 2004 13:54:29 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Help with creating list of User accounts and then determining Account status

2. automatic create user account, computer account in 2000 server

3. Change Service account User Account and Password

4. Help with VBScript for account creation

5. HELP: Page account on ethernet

6. Help with Unlock NT User Account Script

7. Help: Creating machine accounts in the domain?

8. HELP: Need accounting software for postscript printer!

9. Help with AD Contact Account

10. help help help help help

11. adding user account to "Users" container

12. Accounting info on banner page

 

 
Powered by phpBB® Forum Software