ResourceManagementClientCreateResource Method |
Creates a template of a new object that can be used to save to the resource management service at a later stage
Namespace:
Lithnet.ResourceManagement.Client
Assembly:
Lithnet.ResourceManagement.Client (in Lithnet.ResourceManagement.Client.dll) Version: 1.0.6435.24467
Syntaxpublic ResourceObject CreateResource(
string objectType
)
Public Function CreateResource (
objectType As String
) As ResourceObject
public:
ResourceObject^ CreateResource(
String^ objectType
)
Parameters
- objectType
- Type: SystemString
The object type to create
Return Value
Type:
ResourceObjectAn empty template of a new object that will be created in the resource management service when saved
Examples
The following example shows how to create a new resource in the Resource Management Service
public void CreateResouruce()
{
ResourceManagementClient client = new ResourceManagementClient();
ResourceObject resource = client.CreateResource("Person");
resource.Attributes["AccountName"].SetValue("user0001");
resource.Attributes["Domain"].SetValue("FIM-DEV1");
resource.Attributes["DisplayName"].SetValue("Test user 1");
try
{
resource.Save();
}
catch (Exception)
{
throw;
}
}
See Also