Determine AD Site (Full Version)

All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager



Message


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?




lnesta431 -> RE: Determine AD Site (7/3/2008 4:01:45 AM)

Leave it

I'll gather the value out of the good old Registry ;-)




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.296875