Find local site for user

  • Thread starter Thread starter Kenny
  • Start date Start date
K

Kenny

Hello,

I'm making a webapp that allows users to make ldap changes. I would
like these changes to be made on their local site so they don't have
to wait for replication to occur. I know I can make a lookup on
_ldap._tcp.dc._msdcs.domain to find all the servers for their domain,
but I'm not sure how to find what site the user would be in.

Different webpages say that this is usually done through an 'AD ping'
or ldap-over-udp ping. Although I don't know how to do this it appears
it would only return the site for the webserver (the connecting IP).

Can anyone tell me how to find the site for the IP of a user connected
to the webapp? I'm doing this in Java, so any JNDI solutions?

Thanks in advance,

Kenny
 
This can only be done when run from the machine the user is logged on to.
The reasoning here is that users don't have sites - they can move around.
Machines are in sites, based on what subnets they
are in.

--
--
Brian Desmond
Windows Server MVP
(e-mail address removed)12.il.us

Http://www.briandesmond.com
 
Brian Desmond said:
This can only be done when run from the machine the user is logged on to.
The reasoning here is that users don't have sites - they can move around.
Machines are in sites, based on what subnets they
are in.

Actually I may have worded that wrong. I don't need the actual site of
the user, just the site for the machine they are connecting from.

It appears I may have to do some type of LDAP query for the subnets
and figure out which one the machine belongs to. Unless you can think
on an easier way.

Thanks,

Kenny
 
Kenny-

That will definetely work. I actually have a better solution.

Check out the DsGetSiteName API on MSDN. You pass the computer name to it,
and it returns the sitename.

--
--
Brian Desmond
Windows Server MVP
(e-mail address removed)12.il.us

Http://www.briandesmond.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top