Discussion:
Is it possible to determine which site a server/client is member o
(too old to reply)
n***@nospam.nospam
2006-04-17 01:09:02 UTC
Permalink
I’m looking for something like IADsADSystemInfo::GetDCSiteName but I need to
be able to lookup remote servers and client PC's not Local like GetDCSiteName
does.

Brgds
Martin
Jeffrey Tan[MSFT]
2006-04-17 11:16:46 UTC
Permalink
Hi Martin,

Thanks for your post!

Can you be a little clarify regarding your question? Do you mean that you
want your program to run in PC1 and specify the another PC2 as the client
machine to query its "Active Directory site"?

Thanks

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
n***@nospam.nospam
2006-04-17 13:14:02 UTC
Permalink
Hi Jeffrey,

Yes,
I have an app running on PC X and this app uses service A. Service A is
installed and running on both Server Z and Server Y. Servers Z and Y are not
domain controllers.

The client app running on PC X needs to identify which AD Site the servers Z
and Y is currently in.

I am hoping for a method like string GetADSiteForServer(string serverName)
which can be called from the client app.

The client app will use the result to determine if any of the servers are in
the same site as it self.
If none of the server are in the same AD site as the Client PC the client
app will select a server based on the link cost of a Domain controller in the
AD site which the PC X is member of to a Domain controller which the Server
is member of.


Thanks,

Martin
Post by Jeffrey Tan[MSFT]
Hi Martin,
Thanks for your post!
Can you be a little clarify regarding your question? Do you mean that you
want your program to run in PC1 and specify the another PC2 as the client
machine to query its "Active Directory site"?
Thanks
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Joe Kaplan (MVP - ADSI)
2006-04-17 15:15:05 UTC
Permalink
Sites are mapped by IP subnets. If you just do a DNS lookup to get the
server's IP address, you should be able to figure out its site as well.

You might then try an LDAP query in the configuration context or subnet
objects whose name matches the IP address of the server and find its
associated site via the siteObject attribute.

Joe K.
Post by n***@nospam.nospam
Hi Jeffrey,
Yes,
I have an app running on PC X and this app uses service A. Service A is
installed and running on both Server Z and Server Y. Servers Z and Y are not
domain controllers.
The client app running on PC X needs to identify which AD Site the servers Z
and Y is currently in.
I am hoping for a method like string GetADSiteForServer(string serverName)
which can be called from the client app.
The client app will use the result to determine if any of the servers are in
the same site as it self.
If none of the server are in the same AD site as the Client PC the client
app will select a server based on the link cost of a Domain controller in the
AD site which the PC X is member of to a Domain controller which the Server
is member of.
Thanks,
Martin
Post by Jeffrey Tan[MSFT]
Hi Martin,
Thanks for your post!
Can you be a little clarify regarding your question? Do you mean that you
want your program to run in PC1 and specify the another PC2 as the client
machine to query its "Active Directory site"?
Thanks
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jeffrey Tan[MSFT]
2006-04-17 12:54:11 UTC
Permalink
If I did not misunderstand you, I think DsGetSiteName() may meet your need.

Just pass the target machine name as the first parameter:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ad/ad/dsget
sitename.asp

Hope this helps

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
n***@nospam.nospam
2006-04-17 13:31:01 UTC
Permalink
Hi Jeffrey,

Thanks for the answer and yes this almost does what I want but it uses the
netlogon service on the computer specified in the first parameter to get the
site.

Do you know if any method exists that uses the AD instead of the using the
netlogon service on the server/client specified in the first parameter?

brgds
Martin
Post by Jeffrey Tan[MSFT]
If I did not misunderstand you, I think DsGetSiteName() may meet your need.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ad/ad/dsget
sitename.asp
Hope this helps
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Jeffrey Tan[MSFT]
2006-04-20 02:07:41 UTC
Permalink
Hi Martin,

Sorry for letting you wait.

Does DsAddressToSiteNames meet your need? Thanks

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Joe Richards [MVP]
2006-04-28 14:28:30 UTC
Permalink
For an example of this in action check out ATSN

http://www.joeware.net/win/free/tools/atsn.htm


--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net


---O'Reilly Active Directory Third Edition now available---

http://www.joeware.net/win/ad3e.htm
Post by Jeffrey Tan[MSFT]
Hi Martin,
Sorry for letting you wait.
Does DsAddressToSiteNames meet your need? Thanks
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
r***@gmail.com
2013-06-10 15:04:01 UTC
Permalink
Hey Have you tested Lepide Active Directory Self Service for the same.

Since this tool is also a good tool as compared to Joeware tool.

Please have a look at this tool also for the same and hope it helps you.

http://www.lepide.com/active-directory-self-service.html

Thanks.
Post by Joe Richards [MVP]
For an example of this in action check out ATSN
http://www.joeware.net/win/free/tools/atsn.htm
--
Joe Richards Microsoft MVP Windows Server Directory Services
Author of O'Reilly Active Directory Third Edition
www.joeware.net
---O'Reilly Active Directory Third Edition now available---
http://www.joeware.net/win/ad3e.htm
Post by Jeffrey Tan[MSFT]
Hi Martin,
Sorry for letting you wait.
Does DsAddressToSiteNames meet your need? Thanks
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Continue reading on narkive:
Loading...