myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


Determine AD Site

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> Determine AD Site Page: [1]
Login
Message << Older Topic   Newer Topic >>
Determine AD Site - 7/3/2008 2:49:43 AM   
lnesta431


Posts: 901
Score: 59
Joined: 1/26/2006
From: Brussels, Belgium
Status: offline
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?


_____________________________

----------
Please rate if this has helped you! Tnx!

Check out my NEW blog: http://nicosienaert.blogspot.com/
----------
Post #: 1
RE: Determine AD Site - 7/3/2008 4:01:45 AM   
lnesta431


Posts: 901
Score: 59
Joined: 1/26/2006
From: Brussels, Belgium
Status: offline
Leave it

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


_____________________________

----------
Please rate if this has helped you! Tnx!

Check out my NEW blog: http://nicosienaert.blogspot.com/
----------

(in reply to lnesta431)
Post #: 2
Page:   [1]
All Forums >> [Management Products] >> System Center Products >> System Center Configuration Manager >> Determine AD Site Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.203