MGRP.EXE

Overview

MGRP.EXE is a console application that creates a machine group in the SMS site server database and populates it with the machines from the local site server. This sample demonstrates the code required to create and populate a machine group.

Running the Program

MGRP.EXE runs as a console application. To run the program, type mgrp.exe. The program prompts you to enter the information needed to connect to the SQL server and then prompts you to enter a unique name for the machine group to be created. The application creates the machine group and then allows further creates or exits.

Functions

SmsAPIVer
SmsDataSourceConnect
SmsDataSourceDisconnect
SmsOpenContainer
SmsCloseContainer
SmsCreateFolder
SmsPopulate
SmsCloseFolder
SmsGetFolderCount
SmsGetNextFolder
SmsGetFolderID
SmsDupFolder
SmsLinkFolder
SmsCommitFolder
SmsGetFolderID
SmsGetScalarCount
SmsCloseFolder
SmsCreateFilter
SmsAddToken
SmsSetFilter
SmsCloseFilter
SmsSetScalar

Program Flow

After logging on to a datasource and obtaining the machine group name from the user, the program creates the machine group folder and copies machine folders into it using the SmsDupFolder function.