Archived Boards > Network Extenders
Get computers AD site name
(1/1)
Trippinout:
Anyone have a quick simple script to just get the current AD Site name from a computer.
Script will be run locally on the computer.
Thanks
td:
This longish script illustrates how to obtain the site name for the current domain along with a bunch of other stuff.
http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WIL~Extenders/ADSI/Samples~from~Users+Useful~ADSI~Site~server~functions.txt
td:
Here's a two liner that may (or may not) get you what you want.
adSys = CreateObject('ADSystemInfo')
strSiteName = adSys.GetDCSiteName('ServerNameHere')
Trippinout:
Perfect. Thanks..
td:
A not very elegant ADSI extender version.
--- Code: Winbatch ---AddExtender("wwads44i.dll")
strServer = 'yourserver'
strServerPath = dsFindPath('LDAP://CN=Sites,CN=Configuration,DC=yoursub,DC=yourdomain', '(&(objectClass=server)(cn=%strServer%))')
strSite = ItemExtract(2, ItemExtract(3, strServerPath, ','), '=')
Pause(strServer:"'s Site", strSite)
Navigation
[0] Message Index
Go to full version