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
167 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

744 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

12 Experts available now in Live!

Get 1:1 Help Now