This sample shows how to remove a reference value in a single-valued attribute.

The trick here is to omit the attribute value when creating the FIM ImportChange object. The obvious thing to try would be supply $null or '' for the value, but that does not work.


ipmo .\Desktop\FimPowerShellModule.psm1

###
### Create a Person Object: Harry
###
New-FimImportObject -ObjectType Person -State Create -Changes @{
   DisplayName  = 'The Harry'
   AccountName = 'Harry'
   FirstName   = 'Harry'
   Description = 'Have any grapes?'
   EmployeeType= 'Contractor'
   LastName   = 'Palmer'
   JobTitle    = 'Tester'
   Domain   = 'LITWARE'
   Email      = 'palmer@litware.ca'
} -ApplyNow

###
### Create a Person Object: Sally
###
New-FimImportObject -ObjectType Person -State Create -Changes @{
   DisplayName  = 'The Sally'
   AccountName = 'Sally'
   FirstName   = 'Sally'
   Description = 'Have any grapes?'
   EmployeeType= 'Full Time Employee'
   LastName   = 'Tations'
   JobTitle    = 'Test Lead'
   Domain   = 'LITWARE'
   Email      = 'Sally@litware.ca'
} -ApplyNow

###
### Update Harry's manager to Sally
###
New-FimImportObject -ObjectType Person -State Put -Anchor @{AccountName='Harry'} -Changes @{
   Manager = ('Person','AccountName','Sally')
} -ApplyNow

###
### Remove Harry's manager
###
New-FimImportObject -ObjectType Person -State Put -Anchor @{AccountName='Harry'} -Changes @(
   New-FimImportChange -AttributeName Manager -Operation Replace
) -ApplyNow

Last edited Mar 20, 2014 at 8:55 PM by CraigMartin, version 1

Comments

No comments yet.