• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

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
0
snowei1
Asked:
snowei1
2 Solutions
 
EDDYKTCommented:
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
 
MADisonMANCommented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now