Grab our RSS feeds Follow us on Twitter Join our Facebook Group Connect with us on LinkedIn
myITforum.com, Powered by You.
you are not logged in

Articles

Newslinks

Links

Downloads

Site Services

Community Forums

Discussion Lists

Article Search

Newsletter

Web Blogs

FAQs

Live Support

myITforum TV

Take a Poll

Monthly Drawing

myITforum Network

User Group Directory

Our Partners

About Us

Register

Login

BRONZE PARTNER:

BRONZE PARTNER:



Industry News:




  Home : Articles : SMS 2.x print | email | | Forums |   print | email | | Blogs |   print | email | | Wiki |   print | email | | FAQs |   print | email | Article Search  
Determine SMS ServerName from SiteCode Script


Bookmark and Share

By: Joe Eager
Posted On: 2/1/2002

In very large SMS 2.0 Hierarchy's it can be tough to remember the ServerName for each SiteCode. This simple VB script will prompt for a SiteCode and return the ServerName.

To make this work copy into notepad, change the <CentralServerName> to the servername of your Central Site Server. Also change the <CentralServerSiteCode> the site code for your Central Site.

Save as a .vbs script.

***************************************
Dim loc
Dim WbemServices
Set WbemServices = GetObject("winmgmts:{impersonationLevel=impersonate}!\\<CentralServerName>\root\SMS\site_<CentralServerSiteCode>")

Dim Site
Dim Sites
Dim Machines

SC=InputBox ("Input the site code, get the server name")

Set Sites = WbemServices.ExecQuery("Select * From SMS_Site")
For Each Site In Sites
If Site.SiteCode=SC Then
MsgBox Site.ServerName
End If
***************************************

  myITforum.com ©2010 | Legal | Privacy