Thursday, August 05, 2010

Using the FIM Cmdlets to Copy an Object

The FIM Configuration Migration Cmdlets are great for migrating FIM Service configuration between environments.

What if you only want to copy an object or two?  You shouldn’t have to go through the whole song and dance of Export1, Export2, Join, Compare, Import.

One way to do this is to use the Quest FIM Cmdlets that are based on the FIM Web Service.  They are more general purpose, and most importantly the output of the Get- Cmdlet will work as input to the Set- Cmdlets.

Can’t or won’t have the Quest FIM Cmdlets installed? You can do the same thing (mostly) with the FIM Configuration Migration Cmdlets.  The trick is instead of comparing two FIM objects with Join-FIMConfig, just compare to $Null.  It looks something like this:

1. $exportedObject = Export-FIMConfig –CustomConfig “/Person=’HoofHearted’”

2. $matches = Join-FIMConfig –Source $exportedObject –Target $Null –DefaultJoin “DisplayName”

3. $objectToImport = $matches  | Compare-FimConfig

4. Import-FimConfig $objectToImport

No comments: