CreateImportObject
Applies To: Forefront Identity Manager 2010
This is an example of a Windows PowerShell function that creates a new ImportObject object based on a FIM object type. For more information, see FIM Windows PowerShell Cmdlet Examples.
CreateImportObject Function
function CreateObject
{
PARAM([string]$ObjectType)
END
{
$importObject = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportObject
#Sets an ID for the ImportObject. The ID is not used by the FIM Service.
$importObject.SourceObjectIdentifier = [System.Guid]::NewGuid().ToString()
$importObject.ObjectType = $ObjectType
$importObject
}
}
Remarks
This is a basic function that is reused by other example functions, such as the CreatePerson and CreateGroup functions, which populate the attributes of the object and commit the changes to the FIM Service.
The SourceObjectIdentifier property of the ImportObject must be specified so that the cmdlet can distinguish between ImportObject instances. However, this value is not stored in the FIM Service database. You cannot use the SourceObjectIdentifier property to define the ObjectID for the resource. The FIM service will assign an ObjectID value for the new resource when it is imported into FIM.
See Also
Concepts
FIM Windows PowerShell Cmdlet Examples
Configuration Migration Deployment Guide
CreateImportChange
AddImportChangeToImportObject