|
lnesta431 -> Determine AD Site (7/3/2008 2:49:43 AM)
|
I know it's not really the correct place to post this, but it's for the moment the most popular part of the forum[:)] I need to query to find out to which AD site a PC belongs. I use following vbscript to query this out of WMI: On Error Resume Next strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_NTDomain") For each objItem in colItems strvalue = objItem.ClientSiteName Next (I use this script to determine the PC geographically to know on which fileserver to backup/restore his data) This works like a charm for XP machines. Unfortunately I still have some Windows 2000 boxes to migrate. The script does not works as apparently the WMI class does not exist on Windows 2000 machines. Any other idea how I can determine the AD Site of Windows 2000 box?
|
|
|
|