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
172 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

726 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