none
FIM 2010R2 - Clear Boolean attribute in Portal to delete it RRS feed

  • Question

  • Hi,

    I need to delete a boolean atribute from FIM Portal.

    It seems that firts I need to clear its values.

    I tried a powerschell  script to use the Import-Config but it fails (it succeeds with $true or $false but not with $null)

    the ps error message is: 

      The web service client has encountered the following class of error: ValueViolatesDataTypeFormat
      The specified attribute value is in a format that cannot be stored in the attribute.

    The ps code is like this:

        $importObject = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportObject
        $importObject.ObjectType = "Person"
        $importObject.SourceObjectIdentifier =  $userObject.ResourceManagementObject.ObjectIdentifier
        $importObject.TargetObjectIdentifier =  $userObject.ResourceManagementObject.ObjectIdentifier        
        $importChange = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportChange
        $importChange.Operation = 1
        $importChange.AttributeName = "myattributeName"
        $importChange.AttributeValue = $null
        $importChange.FullyResolved = 1
        $importChange.Locale = "Invariant"
        $importObject.Changes = $importChange
        $importObject | Import-FIMConfig

    I succeed with MIMWAL update resource but since there are 200.000 resources to be affected the IIS seems to be hanged with memory at 99%.

    What is the recomended way to clear the attribute on a such a big number of resources and why does it not succeeds in PS?

    Many thanks?


    • Edited by junidev Thursday, June 27, 2019 2:26 PM
    Thursday, June 27, 2019 12:48 PM

Answers

  • IIRC Operation =1  is a replace so that is good. According to an article by Paolo Tedesco, you can "unset" a single valued attribute by doing a replace operation and then not specifying the Attribute Value, like so:

    $importObject = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportObject
        $importObject.ObjectType = "Person"
        $importObject.SourceObjectIdentifier =  $userObject.ResourceManagementObject.ObjectIdentifier
        $importObject.TargetObjectIdentifier =  $userObject.ResourceManagementObject.ObjectIdentifier        
        $importChange = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportChange
        $importChange.Operation = 1
        $importChange.AttributeName = "myattributeName"
        $importChange.FullyResolved = 1
        $importChange.Locale = "Invariant"
        $importObject.Changes = $importChange
        $importObject | Import-FIMConfig
    I haven't had a chance to test this so tried it on one object first


    David Lundell, Twitter | Hire Identity Managed | FIM Best Practices book | How to Be an MVP in Life book

    • Marked as answer by junidev Sunday, July 21, 2019 4:21 PM
    Thursday, June 27, 2019 4:16 PM

All replies