Drop down box in asp page loading with active directory login names the we have in our company

Drop down box loading connecting to active directory.
From web page can we have dropdown boxn tie to the active directory and get the UserID list and display in a web page dropdown box.
Can you guys help me providing the code for doing this kind of active directory.

Can we atlease perform this kind of requirement

Please let me know
Thanks
Nirja
nirjabhimAsked:
Who is Participating?
 
frodomanCommented:
You can do it on a web page with a server-side script:

dim objDomain, objUser            
Set objDomain = Getobject("WinNT://www.YOURDOMAIN.com")
objDomain.Filter = Array("User")
            
for each objUser in objDomain
    response.write("<option value='" & objUser.name & "'>" & objUser.name & "</option>")
next
            
Cd& is correct though in that you'll want to be EXTRAORDINARILY careful with this because it is a security nightmare.  We have a web page that does this to allow us to perform user admin functions from home but beyond the normal security we've also restricted access to the page both to specific users and to specific IP addresses (our homes).  Even then we've added safeguards in our code to make it impossible to grant any user access to critical groups (like "admin").

Hope this helps.
0
 
COBOLdinosaurCommented:
Not from a web page.  You have to generate from the server.  It is probably possible to access from the client with activeX, but the security holes that creates are not something a security admin is going to be thrilled with.  

For an intranet, possible if your internal security is good.  On Internet, maybe if yu don't mind putting us a sign that says please hack this site.

Cd&
0
 
nirjabhimAuthor Commented:
I think in my case , I just have to read the user names fron the win directory server. Is it possible just to get updated names from windows active directory server and place it in a drop down box when ever page is loaded in the intranet site webpage.

Please advice
Thanks for your input
nirja bhim
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
frodomanCommented:
Isn't that what I gave you?  Place this code in your intranet webpage at the point you want the dropdown and it'll fill with the users reported by active directory.

<%
dim objDomain, objUser          
Set objDomain = Getobject("WinNT://www.YOURDOMAIN.com")
objDomain.Filter = Array("User")
         
response.write("<select name='UserListing'>")
for each objUser in objDomain
    response.write("<option value='" & objUser.name & "'>" & objUser.name & "</option>")
next
response.write("</select>")
%>
0
 
sunniundaCommented:
Can you help me explain and tell where do I get that -   active directory link- ("WinNT://www.YOURDOMAIN.com")
Should I ask Active directory group people in the department to get that address replace with ("WinNT://www.YOURDOMAIN.com").
Please tell me , there won't be any security issues right, since I am just reading the UserId's from the active directory server and filing that drop down box.
Please advice for the link and security

Thanks for your help
Nirja
0
 
frodomanCommented:
If active directory is enabled then replace "YOURDOMAIN" with the name of the domain that active directory has registered.  This is an active directory object that will exist on your server - if you use Set objDomain = Getobject("WinNT://www.microsoft.com") then it won't work but if you use the name of your own domain it will.

>>> Please tell me , there won't be any security issues right

Anyone that sees this page will have a list of user names so treat it the same way you would a printed list of user names - by itself it's not a threat but combined with other information it could be.  Also as we've already said, be very careful with your code for this page because with the active directory exposed a hack to this page could potentially cause serious problems.  It's like everything else on the web - the more powerful and functional it is, the more potential damage it can cause so develop your code accordingly.

0
 
frodomanCommented:
Recommend points to frodoman

I believe the question was answered with the code I provided and the responsible warning about security risks.
0
 
COBOLdinosaurCommented:
MOD :: DUP accounts?...nirjabhim/sunniunda

Cd&
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.