Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get a list of users in domain

Status
Not open for further replies.

AccessSQLUser

Programmer
Joined
Apr 23, 2001
Messages
101
Location
US
Ok, I'll try to describe what I'm trying to do.
I would like to create a form in MS Access that will be a user-friendly way to add Windows NT users to SQL Server logins. I would like the end-user to be able to pick the NT USer that they wish to add using a combo box. My problem is this - how do I automatically fill that combobox with a list of all users in a specific domain?
 
Try something like this (it does require WSH installed on your machine)

strDomain="MyDomainName"

Set oDomain = GetObject("WinNT://" & strDomain)
For Each oUser In oDomain.Users
'Add users to your list box here
Next

oDomain=Nothing

HTH Jamie Gillespie
j-gillespie@s-cheshire.ac.uk
 
Thanks for the reply. I do have WSH installed but I get the error "Object doesn't support this property or method" by this line: For Each oUser In oDomain.Users
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top