Jorge's Quest For Knowledge!

All About Identity And Security On-Premises And In The Cloud – It's Just Like An Addiction, The More You Have, The More You Want To Have!

Archive for the ‘PowerShell’ Category

(2015-03-04) Clearing The MV Object ID Of All Groups In The Portal

Posted by Jorge on 2015-03-04


I had used the script from Carol Wapshere to duplicate FIM Portal objects (groups). With that duplication the MV Object ID was also copied. Therefore from a metaverse perspective I had duplicate objects (multiple objects with the same MV Object ID). When importing those objects into FIM sync you get the error:

image

Figure 1: Ambiguous Import Errors For Specific Objects Against Objects In The Metaverse

image

Figure 2: Ambiguous Import Error For A Specific Object

Because of the duplicate MV Object ID on FIM Portal objects, these (multiple) objects were trying to join to a single MV object instead of projecting new MV objects. The duplicated objects should project into the metaverse instead! The solution to achieve that was to clear the MV Object ID for every group object in the FIM Portal. To get that done I wanted/needed to use PowerShell.

I used the FIM PowerShell Function Library (FIM-PowerShell-Function-Library-Custom.ps1) as described here. Then I created the following simple script

Clearing the MV Object ID of all groups

Add-PSSnapin FIMAutomation
. .\FIM-PowerShell-Function-Library-Custom.ps1
$objectsInFIMToProcess = Export-FIMConfig -Uri $URI –OnlyBaseResources -CustomConfig "/Group"
$objectsInFIMToProcessPSObject = $objectsInFIMToProcess | Convert-FimExportToPSObject
$objectsInFIMToProcessPSObject | %{
    $objectToProcess = $($_.ObjectID).TrimStart("urn:uuid:")
    $objectToProcessPrepared = $objectToProcess | Prepare-FimObject $_.ObjectType
    $objectToProcessPreparedWithChanges = $objectToProcessPrepared | Set-FimAttribute -AttributeName "MVObjectID" -AttributeValue $null
    $objectToProcessPreparedWithChangesToImport = $objectToProcessPreparedWithChanges | Commit-FimObject
}

Cheers,
Jorge
———————————————————————————————
* This posting is provided "AS IS" with no warranties and confers no rights!
* Always evaluate/test yourself before using/implementing this!
* DISCLAIMER:
https://jorgequestforknowledge.wordpress.com/disclaimer/
———————————————————————————————
############### Jorge’s Quest For Knowledge #############
#########
http://JorgeQuestForKnowledge.wordpress.com/ ########
———————————————————————————————

Posted in Forefront Identity Manager (FIM) Portal, PowerShell, Tooling/Scripting | 1 Comment »