BRONZE PARTNER:
BRONZE PARTNER:
Industry News:

| |
 |
 |
 |
| Determine SMS ServerName from SiteCode Script |
 |
|
|
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 ***************************************
|
 |
 |
 |
|
|