Solved

How to check if a user belong to a particular domain

Posted on 2004-03-22
5
194 Views
Last Modified: 2010-05-01
I want to check if a user belong to a particular domain.

How can I go about it.

Please provide sample codes if possible
Thanks
0
Comment
Question by:snowei1
5 Comments
 
LVL 26

Accepted Solution

by:
EDDYKT earned 50 total points
ID: 10657210
Private Sub Command1_Click()
Dim myobj, user

Set myobj = GetObject("WinNT://yourdomainname")
myobj.Filter = Array("user")
For Each user In myobj
  Debug.Print user.Name & " " & user.Parent & " " & user.AccountDisabled
Next

End Sub
0
 
LVL 1

Assisted Solution

by:MADisonMAN
MADisonMAN earned 50 total points
ID: 10662032
Check the following site. This will helps you for this question as well as understanding some basics.
http://www.15seconds.com/issue/020130.htm
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question