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

  • Thread starter Thread starter Ojas
  • Start date Start date
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
 
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?
 
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
 
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
 
Back
Top