Link to home
Start Free TrialLog in
Avatar of nirjabhim
nirjabhim

asked on

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
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

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&
ASKER CERTIFIED SOLUTION
Avatar of frodoman
frodoman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nirjabhim
nirjabhim

ASKER

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
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>")
%>
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
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.

Recommend points to frodoman

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

Cd&