Windows2k Logons in ASP

the_monq
03-21-2002, 12:44 AM
Hi,

I have a set of ASPs that only a set of users can access based on their windows2k logons.

What i want to know is if it is possible from ASP to view windows2k security groups and/or users. This is on our intranet and we do not want to manage another set of logons(within a database). For instance, i want to have a dropdown of windows2k users to enable private messaging between users on our forum.

Any help on this ASAP is much appreciated.

thanx. :confused:

Jaws
03-21-2002, 03:28 PM
I did something similar to this, I passed in the domain name and group name -- the group name came from a drop down box and the domain name was hard-coded. Here is the code:

'This is the API call - pass in the domain name and group name
Set Group = GetObject("WinNT://" & sDomainName & "/" & sGroupName)

For Each Member in Group.Members
On Error Resume Next

If Member.Class = "User" Then
sUserStreamHTML = sUserStreamHTML & "<OPTION VALUE=" & Member.Name & ">" & Member.Name & "</option>"

end if
next

Hope this helps.

the_monq
03-25-2002, 05:07 AM
thanx jaws.

but what i wanna know is how u got the group names in a drop down box. that is currently what i have a problem with.

thanx again.

Jaws
03-25-2002, 12:23 PM
Just plug in the server name that you wan't to enumerate.

on error goto 0
dim IADsCont

'API call
Set IADsCont = GetObject("WinNT://ServerName" & ",computer")
IADsCont.Filter = Array("group")

Response.Write "<select name=""NTGroups"">"

For Each Group In IADsCont
'Get the name
Response.Write "<option>" & Group.Name & "</option>"
Next

Response.Write "</select>"

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum