How can I query a user's active directory site name?

R

Richard Mueller [MVP]

Ojas said:
What is the best way to programmatically query a user's active
directory site name?

It's actually the computer's site, but the ADSystemInfo object provides
this. In VBScript:
=========
Set objSysInfo = CreateObject("ADSystemInfo")
strSite = objSysInfo.SiteName
 
O

Ojas

Richard,

Thanks. I have a background server application that the AD user does
not directly interact with, or connect to, and so I don't know the IP
address or the machine name that the user is currently using. Given
that context, is there anyway for me to determine the current site
that an AD user is associated with?
 
F

Florian Frommherz [MVP]

Ojas,
Thanks. I have a background server application that the AD user does
not directly interact with, or connect to, and so I don't know the IP
address or the machine name that the user is currently using. Given
that context, is there anyway for me to determine the current site
that an AD user is associated with?

Users don't have sites. The site information is attached to the machine
via the IP address that it is configured to. The IP<->Site definition is
made in Active Directory. The only way to figure the site a user has
currently logged on to is the machine and the ip address.

cheers,

Florian
 
J

Jorge de Almeida Pinto [MVP - DS]

in another newsgroup, Joe Kaplan said the following (which is the answer on
HOW-TO accomplish):
Jorge is absolutely correct here. You might want to check out the
ActiveDirectorySite.GetComputerSite method to see if that helps you.


--

Cheers,
(HOPEFULLY THIS INFORMATION HELPS YOU!)

# Jorge de Almeida Pinto # MVP Identity & Access - Directory Services #

BLOG (WEB-BASED)--> http://blogs.dirteam.com/blogs/jorge/default.aspx
BLOG (RSS-FEEDS)--> http://blogs.dirteam.com/blogs/jorge/rss.aspx
------------------------------------------------------------------------------------------
* This posting is provided "AS IS" with no warranties and confers no rights!
* Always test ANY suggestion in a test environment before implementing!
------------------------------------------------------------------------------------------
#################################################
#################################################
------------------------------------------------------------------------------------------

Florian Frommherz said:
Ojas,
Thanks. I have a background server application that the AD user does
not directly interact with, or connect to, and so I don't know the IP
address or the machine name that the user is currently using. Given
that context, is there anyway for me to determine the current site
that an AD user is associated with?

Users don't have sites. The site information is attached to the machine
via the IP address that it is configured to. The IP<->Site definition is
made in Active Directory. The only way to figure the site a user has
currently logged on to is the machine and the ip address.

cheers,

Florian
--
Microsoft MVP - Group Policy
eMail: prename [at] frickelsoft [dot] net.
blog: http://www.frickelsoft.net/blog.
Maillist (german): http://frickelsoft.net/cms/index.php?page=mailingliste
 

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

Top