CreateRelationship Method in Class SMS_UserMachineRelationship

 

Applies To: System Center 2012 Configuration Manager, System Center 2012 Configuration Manager SP1, System Center 2012 R2 Configuration Manager

The CreateRelationship Windows Management Instrumentation (WMI) class method, in System Center 2012 R2 Configuration Manager, creates a relationship between a user and a device.

The following syntax is simplified from Managed Object Format (MOF) code and defines the method.

Syntax

sint32 CreateRelationship (
     uint32 MachineResourceId,
     string UserAccountName,
     uint32 SourceId,
     uint32 TypeId
);

Parameters

  • MachineResourceId
    Data type: UInt32

    Qualifiers: [in]

    Unique Configuration Manager-supplied identifier for the resource.

  • UserAccountName
    Data type: String

    Qualifiers: [in]

    User account name.

  • SourceId
    Data type: UInt32

    Qualifiers: [in]

    Source object identifier for dependency.

    Software Catalog

    The end user enabled the relationship by selecting the option in the AppCatalog Web page.

    Administrator

    An administrator created the relationship manually in the UI.

    User

    Unused/deprecated.

    Usage Agent

    The threshold of activity triggered a relationship to be created.

    Device Management

    The user/device were tied together during enrollment.

    OSD

    The user/device were tied together as part of OSD imaging.

    Fast Install

    The user/device were tied together temporarily to enable an on-demand install from the catalog if no UDA relationship installed before the Install was triggered.

    Exchange Server connector

    The device was provisioned through EAS.

  • TypeId
    Data type: UInt32

    Qualifiers: [in, optional]

    Type identifier.

Return Values

An SInt32 data type that is 0 to indicate success or non-zero to indicate failure.

For more information about handling returned errors, see About Configuration Manager Errors.

Requirements

Runtime Requirements

For more information, see Configuration Manager Server Runtime Requirements.

Development Requirements

For more information, see Configuration Manager Server Development Requirements.

See Also

SMS_Application Server WMI Class
Configuration Manager Application Management Server WMI Classes