Clearing a reference field

Mar 20, 2014 at 8:30 AM
Hi,

I would like to clear a single-value attribute (like Manager). I tried with the following but it didn't work :
New-FimImportObject -ObjectType Person -State Put -AnchorPairs @{ObjectID=$usrattr.ObjectID.Substring(9)} -Changes @(
New-FimImportChange -Operation Replace -AttributeName 'Manager' -AttributeValue " " )-ApplyNow

and I even tried :
$ressource = ModifyImportObject -objectType "Person" -TargetIdentifier $usrattr.ObjectID
SetSingleValue -ImportObject $ressource -AttributeName 'Manager' -NewAttributeValue ""
Import-FIMConfig -ImportObject $ressource

The previous sample work to set a value but it didn't work to reset the field, I can't set a null value. I can manually reset this field via portal so I would guess that it is possible with a script.
Did any one succeed to clear a reference field (single-valued or multi-valued attribute) ?

Thanks
Coordinator
Mar 20, 2014 at 7:59 PM
Good question. Oddly I hadn’t created a sample for that, but now there is one:
https://fimpowershellmodule.codeplex.com/wikipage?title=Update%20a%20Person%27s%20Manager&referringTitle=Samples

Let me know if it works for you!

-Craig
Mar 31, 2014 at 7:54 AM

Hi Craig,

I tried to remove person’s manager from PowerShell script with the sample you sent me, but it still not working…

I don’t know which value I have to place to set it back to a null value. I tried with :

$null

“”(empty string)

“ “ (just a space)

I don’t know which way I should follow to fix it.

Regards

Greg

Ce message a été classé Publique par Gregory Gondouin le lundi 31 mars 2014.
Les labels de classification ont été ajoutés par Titus Message Classification.

Gregory Gondouin
Consultant

Tel : +33 4 76 21 17 03
Email : [email removed]
Cerberis
30 cours de la libération 38100 Grenoble France

Contactez-nous directement en WebChat

Signature créée avec Signature Manager

De : CraigMartin [email removed]
Envoyé : jeudi 20 mars 2014 21:00
À : Gregory Gondouin
Objet : Re: Clearing a reference field [fimpowershellWF:539565]

From: CraigMartin

Good question. Oddly I hadn’t created a sample for that, but now there is one:
https://fimpowershellmodule.codeplex.com/wikipage?title=Update%20a%20Person%27s%20Manager&referringTitle=Samples

Let me know if it works for you!

-Craig

MailScanner CronLabAntiSpamAppliance Signature

CronLab scanned this message. We don't think it was spam. Was it? Report here!

Coordinator
Mar 31, 2014 at 4:58 PM
Apr 1, 2014 at 8:39 AM
Hi Craig,

Thank you for your reply.
I tried your sample above but I get the following error :
New-FimImportChange : Cannot process command because of one or more missing mand
atory parameters: AttributeValue.
At <ScriptFile.ps1..........>
                 New-FimImportChange <<<<  -AttributeName Manager -Operation Replace
     CategoryInfo          : InvalidArgument: (:) [New-FimImportChange], ParameterBindingException
     FullyQualifiedErrorId : MissingMandatoryParameter,New-FimImportChange
Here is what I tried :
New-FimImportObject -ObjectType Person -State Put -AnchorPairs @{AccountName='Bob'}  -Changes @( 
           New-FimImportChange -AttributeName Manager -Operation Replace
) -ApplyNow
May be I did something wrong...

When I try to do it via PowerShellcommand line, it prompts me to supply
Apr 1, 2014 at 8:41 AM
I have to supply a value for the parameter and if I let it empty it doesn't work

Greg