How to check if a user belong to a particular domain

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
snowei1Asked:
Who is Participating?
 
EDDYKTConnect With a Mentor Commented:
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
 
MADisonMANConnect With a Mentor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.