Click here to Skip to main content
13,197,531 members (45,957 online)
Click here to Skip to main content
Add your own
alternative version


26 bookmarked
Posted 25 Apr 2002

List User Domains using GetObject

, 25 Apr 2002
Rate this:
Please Sign up or sign in to vote.
How to list or manage users from a domain


This article gives you some code to list or manage users from a domain using GetObject

    <TD>Last Login</TD>
    <TD>Password Expiration</TD>

Dim sUserInfo

On Error Resume Next

Set oContainer = GetObject("WinNT://Domain_Name")

For Each oIADs In oContainer

    If (oIADs.Class = "User") Then
        Set oUser = oIADs
        UserName = ""
        FullName = ""
        Descripcion = ""
        LastLogin = ""
        PasswordExpiration = ""
    Disabled = ""
        UserName = oUser.Name
        FullName = oUser.FullName
        Descripcion = oUser.Description
        LastLogin = oUser.LastLogin
        PasswordExpiration = oUser.PasswordExpirationDate
        Disabled = oUser.AccountDisabled 

    <TD><%=UserName%> </TD>
    <TD><%=FullName%> </TD>
    <TD><%=Descripcion%> </TD>
    <TD><%=LastLogin%> </TD>
    <TD><%=PasswordExpiration%> </TD>
    <TD><%=Disabled%> </TD>
<%    End If%>    


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Fernando Finelli
Web Developer
Argentina Argentina
Lic. Fernando Finelli

You may also be interested in...


Comments and Discussions

QuestionIt works! Pin
op115417-Jul-12 4:04
memberop115417-Jul-12 4:04 
GeneralGetObject Pin
jambou7-Jun-05 5:43
memberjambou7-Jun-05 5:43 
Questionhow to get current User Logon in Window 2000 Pin
vund23-Mar-04 17:58
membervund23-Mar-04 17:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171020.1 | Last Updated 26 Apr 2002
Article Copyright 2002 by Fernando Finelli
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid