473,410 Members | 1,857 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

active directory

Hi.

How to make a query to active directory from web service?

Thanx.
Nov 16 '05 #1
6 1345
Use the DirectorySearcher object from the System.DirectoryServices
namespace. Make sure you pass a username and password to the construcor of
the root (DirectoryEntry) for the search since the webservice itself does
not have access.
Arild

"Ivan G." <iv************@hotmail.com> wrote in message
news:OE**************@TK2MSFTNGP15.phx.gbl...
Hi.

How to make a query to active directory from web service?

Thanx.

Nov 16 '05 #2
Hi, Arild!

What if I don't know username and password? How can I do that without them?

AB> Arild

AB> "Ivan G." <iv************@hotmail.com> wrote in message
AB> news:OE**************@TK2MSFTNGP15.phx.gbl...
??>> Hi.
??>>
??>> How to make a query to active directory from web service?
??>>
??>> Thanx.
??>>

Me.
Nov 16 '05 #3
All you need is a username and password to an account you create in your AD
that you use only to access AD.

The problem with this is that any user accessing the webservice will get the
access to all the same objects. If you need the results to vary depending on
WHO is accessing the webservice, then you will need to do some
authentication in the webservice so that you get a valid login or
impersonation token.

For regular ASP.NET apps this means enabling impersonation in the web.config
and enabling basic authentication on the website. I've never written a
webservice myself, but I guess there are similar ways of doing it.
Arild

"Ivan G." <iv************@hotmail.com> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
Hi, Arild!

What if I don't know username and password? How can I do that without
them?

AB> Arild

AB> "Ivan G." <iv************@hotmail.com> wrote in message
AB> news:OE**************@TK2MSFTNGP15.phx.gbl...
??>> Hi.
??>>
??>> How to make a query to active directory from web service?
??>>
??>> Thanx.
??>>

Me.

Nov 16 '05 #4
Hi Arild,

Using impersonation in the web service is exactly the same as it is in
ASP.NET.
This will allow Ivan's code to access the Active Directory with the
credential supplied.

--- Nick

"Arild Bakken" <ar*****@hotmail.com> wrote in message
news:eY**************@tk2msftngp13.phx.gbl...
All you need is a username and password to an account you create in your AD that you use only to access AD.

The problem with this is that any user accessing the webservice will get the access to all the same objects. If you need the results to vary depending on WHO is accessing the webservice, then you will need to do some
authentication in the webservice so that you get a valid login or
impersonation token.

For regular ASP.NET apps this means enabling impersonation in the web.config and enabling basic authentication on the website. I've never written a
webservice myself, but I guess there are similar ways of doing it.
Arild

"Ivan G." <iv************@hotmail.com> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
Hi, Arild!

What if I don't know username and password? How can I do that without
them?

AB> Arild

AB> "Ivan G." <iv************@hotmail.com> wrote in message
AB> news:OE**************@TK2MSFTNGP15.phx.gbl...
??>> Hi.
??>>
??>> How to make a query to active directory from web service?
??>>
??>> Thanx.
??>>

Me.


Nov 16 '05 #5
Hi, Nick!

Yes, but it works only in ASP.NET Web Applications not in web services. I
don't know why.

NM> Using impersonation in the web service is exactly the same as it is in
NM> ASP.NET.
NM> This will allow Ivan's code to access the Active Directory with the
NM> credential supplied.

NM> --- Nick

NM> "Arild Bakken" <ar*****@hotmail.com> wrote in message
NM> news:eY**************@tk2msftngp13.phx.gbl...
??>> All you need is a username and password to an account you create in
??>> your
NM> AD
??>> that you use only to access AD.
??>>
??>> The problem with this is that any user accessing the webservice will
??>> get
NM> the
??>> access to all the same objects. If you need the results to vary
??>> depending
NM> on
??>> WHO is accessing the webservice, then you will need to do some
??>> authentication in the webservice so that you get a valid login or
??>> impersonation token.
??>>
??>> For regular ASP.NET apps this means enabling impersonation in the
NM> web.config
??>> and enabling basic authentication on the website. I've never written a
??>> webservice myself, but I guess there are similar ways of doing it.
??>>
??>> Arild
??>>
??>> "Ivan G." <iv************@hotmail.com> wrote in message
??>> news:uP**************@TK2MSFTNGP11.phx.gbl...
??>>> Hi, Arild!
??>>>
??>>> What if I don't know username and password? How can I do that without
??>>> them?
??>>>
AB>>>> Arild
??>>>
AB>>>> "Ivan G." <iv************@hotmail.com> wrote in message
AB>>>> news:OE**************@TK2MSFTNGP15.phx.gbl...
??>>>>> Hi.
??>>>>>
??>>>>> How to make a query to active directory from web service?
??>>>>>
??>>>>> Thanx.
??>>>>>
??>>> Me.
??>>>

Me.
Nov 16 '05 #6
please post the relevant sections from your web.config file under the web
service folder (with your credentials blanked out).

--- Nick

"Ivan G." <iv************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hi, Nick!

Yes, but it works only in ASP.NET Web Applications not in web services. I
don't know why.

NM> Using impersonation in the web service is exactly the same as it is in NM> ASP.NET.
NM> This will allow Ivan's code to access the Active Directory with the
NM> credential supplied.

NM> --- Nick

NM> "Arild Bakken" <ar*****@hotmail.com> wrote in message
NM> news:eY**************@tk2msftngp13.phx.gbl...
??>> All you need is a username and password to an account you create in
??>> your
NM> AD
??>> that you use only to access AD.
??>>
??>> The problem with this is that any user accessing the webservice will
??>> get
NM> the
??>> access to all the same objects. If you need the results to vary
??>> depending
NM> on
??>> WHO is accessing the webservice, then you will need to do some
??>> authentication in the webservice so that you get a valid login or
??>> impersonation token.
??>>
??>> For regular ASP.NET apps this means enabling impersonation in the
NM> web.config
??>> and enabling basic authentication on the website. I've never written a ??>> webservice myself, but I guess there are similar ways of doing it.
??>>
??>> Arild
??>>
??>> "Ivan G." <iv************@hotmail.com> wrote in message
??>> news:uP**************@TK2MSFTNGP11.phx.gbl...
??>>> Hi, Arild!
??>>>
??>>> What if I don't know username and password? How can I do that without ??>>> them?
??>>>
AB>>>> Arild
??>>>
AB>>>> "Ivan G." <iv************@hotmail.com> wrote in message
AB>>>> news:OE**************@TK2MSFTNGP15.phx.gbl...
??>>>>> Hi.
??>>>>>
??>>>>> How to make a query to active directory from web service?
??>>>>>
??>>>>> Thanx.
??>>>>>
??>>> Me.
??>>>

Me.

Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jay Chan | last post by:
We have just installed a SQL Server 2000 (SP 3A) onto a computer that has Windows-2003 Server on it. Now, we cannot get access to that database server from other computers. Seem like this may be an...
0
by: microsoft | last post by:
Hi People, when I try to modify an active directory user programatically, I receive the following exception: The server is unwilling to process the request Reading the microsoft web site, I...
9
by: Mario Rodriguez | last post by:
Hi people. I have a problem adding users to Win2003 active directory programatically. When I execute my app throws the following exception: .................The specified directory service...
4
by: ASGMikeG | last post by:
Hi, How do I find the user object for the current user in Active Directory i.e. the user running my program ? Regards Michael
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
6
by: Leo_Surf | last post by:
Hello, I need your help adding user in Active Directory from ASP.net website. Could any one provide me the complete code for the html page. As this is my curriculam project and I dont have any...
1
by: tangus via DotNetMonster.com | last post by:
Hello all, I'm really struggling with getting some Active Directory code to work in ASP.NET. Can you please provide assistance? I am executing the following code: Dim enTry As DirectoryEntry =...
10
by: Hriday | last post by:
Hi there, Please help me..It is urgent This is Hriday, working on windows authentication with Active Directory... My requirment is when a user sends a request to my web Applicatoin I want to...
0
by: RTT | last post by:
here is my current situation. I develop a program on my computer's localhost. From there i contact Active directory succesfull using a connectionstring like:...
2
by: Jim in Arizona | last post by:
My goal, somehow, is to populate a dropdownlist with all the user names in active directory. I don't even know where to begin, really. I added a reference to System.DirectoryServices so I could...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.