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.

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

Parameters

MachineResourceId

Data type: UInt32Qualifiers: [in]MachineResourceId ….  
UserAccountName

Data type: StringQualifiers: [in]UserAccountName ….  
SourceId

Data type: UInt32Qualifiers: [in]SourceId ….  
TypeId

Data type: UInt32Qualifiers: [in, optional]TypeId ….  

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

Development Requirements

See Also