Click here to Skip to main content
Licence 
First Posted 25 Apr 2002
Views 57,651
Bookmarked 26 times

List User Domains using GetObject

By Fernando Finelli | 25 Apr 2002
How to list or manage users from a domain
1 vote, 20.0%
1
1 vote, 20.0%
2
2 votes, 40.0%
3

4
1 vote, 20.0%
5
2.19/5 - 10 votes
μ 2.19, σa 2.60 [?]

Introduction

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

<TABLE BORDER="1" CELLSPACING="0">
<TR>
    <TD>Username</TD>
    <TD>Name</TD>
    <TD>Description</TD>
    <TD>Last Login</TD>
    <TD>Password Expiration</TD>
    <TD>Disabled</TD>
</TR>
<%

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 
%>

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

License

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

Member
Lic. Fernando Finelli

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralGetObject Pinmemberjambou6:43 7 Jun '05  
Questionhow to get current User Logon in Window 2000 Pinmembervund18:58 23 Mar '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    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 | Mobile
Web04 | 2.5.120210.1 | Last Updated 26 Apr 2002
Article Copyright 2002 by Fernando Finelli
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid