Solved

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

Posted on 2004-04-02
11
168 Views
Last Modified: 2010-04-06
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
0
Comment
Question by:nirjabhim
11 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10742659
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
 
LVL 42

Accepted Solution

by:
frodoman earned 500 total points
ID: 10744396
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
 

Author Comment

by:nirjabhim
ID: 10760394
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
 
LVL 42

Expert Comment

by:frodoman
ID: 10760862
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Expert Comment

by:sunniunda
ID: 10761031
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
 
LVL 42

Expert Comment

by:frodoman
ID: 10761099
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
 
LVL 42

Expert Comment

by:frodoman
ID: 10963788
Recommend points to frodoman

I believe the question was answered with the code I provided and the responsible warning about security risks.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10964208
MOD :: DUP accounts?...nirjabhim/sunniunda

Cd&
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now