Microsoft`s Strategy to Centralize and Manage Automated Installations: SMS 2003 - Can we connect and develop desktop applications using SMS?
(Page 4 of 6 )
The answer is "YES." We can develop any desktop based (or even web based) solution which can directly interact with SMS server using SMS SDK (freely downloadable from Microsoft's website). If you could implement a web solution (together with both SMS SDK and SMS Data Store), then the total enterprise could be managed from any client throughout the world very easily with a few clicks.
The core part of SMS has been completely implemented using WMI (Windows Management Instrumentation). I don't think WMI is a new technology for any administrator. It has already been in existence for years. Eighty percent of SMS development is based on WMI. With the help of WMI, we will able to connect to any client (or workstation), find information, transfer information, exchange information, send information, receive information and do several other network tasks.
Another wonder is that SMS itself can be managed with our own customizable WMI scripts. We can even develop applications in other technologies like .NET using WMI as a core interface to SMS activities (apart from direct SMS SDK and SMS data store).
Let us see how we can connect SMS server. Consider the following statement:
Set locator = CreateObject("WbemScripting.SWbemLocator")
The above statement tries to create one object to work with WMI using VBScript. The WBEM stands for Web Based Enterprise Management. You can rewrite the same in JavaScript using the following statement, which may be useful when you want to connect from client-side JavaScript:
var locator = new ActiveXObject ("WbemScripting.SWbemLocator");
Once we create the above object, we need to connect to an existing SMS server. Let us go through the following statement:
Set smsserver = locator.ConnectServer("SERVERNAME", "rootsms")
The above statement tries to connect an existing SMS Server based on the namespace "rootsms." This namespace gets automatically installed once you install SMS Server. If you try to log onto the primary SMS server site (with administrative privileges), the script for connecting that could be as simple as the following:
Set smsserver = locator.ConnectServer("", "rootsmssitename", "", "")
The above statement simply connects to the current server with the current user's (who logged on) credentials. To work with a sample script, proceed to the next section.
Next: A sample WMI script to connect and retrieve SMS information >>
More BrainDump Articles
More By Jagadish Chaterjee