Here are 2 VB scripts that will list all diabled accounts. Hope this helps.

-------------------------------------------------------------------
Script 1
-------------------------------------------------------------------
Dim Domain
Dim DomainName  
Dim UserAccount
Dim Counter
Counter = 0
DomainName = "Target_Domain_Name"
Set Domain = GetObject("WinNT://" & DomainName)
Domain.Filter = Array("User")
Wscript.Echo "The following accounts are disabled in domain: " & Domain.Name
For Each UserAccount In Domain
    If UserAccount.AccountDisabled = True Then
        Wscript.Echo UserAccount.Name
        Counter = Counter + 1
    End If
Next
If Counter = 1 Then
    Wscript.Echo "Only 1 user account in the " & Domain.Name & " domain is
disabled."
Else
    Wscript.Echo Counter & " user accounts are disabled in the " &
Domain.Name & " domain."
End If

-------------------------------------------------------------------
Script 2
-------------------------------------------------------------------
Dim User
Dim UserName
Dim UserDomain
UserDomain = "Target_User_Domain"
UserName = "Target_User_Name"
Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user")
Wscript.Echo User.AccountDisabled
--------------------------------------------------------------

-----Original Message-----
From: Chris [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 31, 2001 4:35 AM
To: NT 2000 Discussions
Subject: filtering users by attribute in Active Directory


Hi everyone!

I've read the following in Technet about using LDAP queries in advanced
filters to display only users matching certain criteria. What I want to do
is display all accounts that are currently disabled.

Technet : "In advanced filters, you can use matching rules to implement
search flags if you know the correct LDAP control object identifier (also
known as an "OID") value to use and how to compute the value. For example,
you can search on the userAccountControl attribute to specify users who
have disabled accounts"

as you can see from the above it seems you can do it but how exactly? I've
searched high and low (!) and don't know enough about LDAP to achieve
this.

Soultions/suggestions would be greatly appreciated!

cheers
Chris

------
You are subscribed as [EMAIL PROTECTED]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to [EMAIL PROTECTED]

------
You are subscribed as [email protected]
Archives: http://www.swynk.com/sitesearch/search.asp
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to