Skip to content

SMS\_AddUnitToCollection

SMS_AddUnitToCollection(sSMSServer, sUnitName, sCollectionName, sUserName, sPassword)

Section titled “SMS_AddUnitToCollection(sSMSServer, sUnitName, sCollectionName, sUserName, sPassword)”
OptionDescriptionType
sSMSServerThe SMS Main Site Server.String
sUnitNamePC or Username that already exists in SMSString
sCollectionNameThe SMS Collection to add the unit to.String
sUserNameAccount performing the action on SMS serverString
sPasswordThe password for the above account.String

Boolean, TRUE if function completed successfully.

Adds a unit to a collection on the specified SMS server using the direct method.
The unit and collection must already exist on the SMS site.
Note that the command is performed on the server and therefore you must be sure to have the right permissions.
Specify * as a password to let CapaInstaller decrypt a password already specified by CapaInstaller in the registry. Notes:
sSMSServer: SMS Main Server. Sub Site Servers are not supported. collection name: The SMS Collection must exist in the Collection.

<Add Function Scripting Guidelines here>

bStatus=True
If bStatus Then bStatus=IncludeScript(“customlib.cis”)
If bStatus Then bStatus=IncludeScriptingLibrary(“CapaInstaller Scripting Library.cin”)
If bStatus Then bStatus=Job_Start(“WS”,“Add SMS Unit to Collection”,“1.0”,“Capalib_test.log”,“INSTALL”)
If bStatus Then bStatus=SMS_GetUnitIDFromName(“SMSSRV01”,“FIRMWS34”, “FIRM PCs”,“DOMAIN\Admin”,“Password”)
Job_End(bStatus)

SMS_GetSiteCode SMS_GetUnitIDFromName SMS_GetCollectionIDFromName