Applies To: Forefront Identity Manager 2010

This is an example of a Windows PowerShell function that modifies an ImportObject object based on the GUID of the object and the FIM object type and returns a reference to that object. For more information, see FIM Windows PowerShell Cmdlet Examples.

ModifyImportObject Function

# States
# 0 = Create
# 1 = Put
# 2 = Delete
# 3 = Resolve
# 4 = None
function ModifyImportObject
    PARAM([string]$TargetIdentifier, $ObjectType = "Resource")
        $importObject = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportObject
        $importObject.ObjectType = $ObjectType
        $importObject.TargetObjectIdentifier = $TargetIdentifier
        $importObject.SourceObjectIdentifier = $TargetIdentifier
        $importObject.State = 1 # Put


This is a basic function that is reused by other example functions, such as the EnableAllMPRs function and the AllRequestsToElevatedSecurityGroup function, which modify the attributes of the object and commit the changes to the FIM Service.

See Also


FIM Windows PowerShell Cmdlet Examples
Appendix A: Configuration Migration Windows PowerShell Scripts
Appendix B: Annotated Configuration Migration Windows PowerShell Scripts
Configuration Migration Deployment Guide