Import pictures into FIM portal

#UPDATE 16. April 2013: Changed the PS script to write directly to binary attribute Picture in CS. Removing the need for rules extension. The new updates is uploaded in the zip file. Also remember to update your Schema file (example further down in this post)..#UPDATE 29. April 2013 – Fixed bug on line 74. From FileDate to FileData.

Søren Granfeldt has done an amazing job creating a Powershell MA for FIM2010. We wanted to use this MA to import user pictures from a fileshare and into the FIM portal. When we got it in the FIM portal it is no problem exporting it to ex. Active Directory.

Our picture filenames was formatted like this: FULLNAME#ACCOUNTNAME.JPG (You can change the filter to your needs in our PowerShell script).

With the help of my good friend and colleague Didier Rossi (who is a master in pretty much everything, include cooking food). We jumped right into it. We`ll show you how we did it.

Prerequisite: As we are using WIA Object trough the Image PS module you have to Add the feature “Desktop experience” and run the “Windows Image Acquisition” Service under Windows Server 2008/R2.

#1 – Download and install the Powershell MA – REMEMBER to donate some to Søren`s great job!

#3 – Now. We have to create three files. Export.ps1, Password-ChangeSet.ps1 and Get-Schema.ps1 I placed my files like this, for now. They are all empty files.
C:\FIMpowershellCode\AccessCardPictures\Export.ps1
C:\FIMpowershellCode\AccessCardPictures\Password-ChangeSet.ps1
C:\FIMSchemaFiles\AccessCardPictures\Get-Schema.ps1

#6 – Re-open the FIM Synchronization service to get the new ma loaded.

#7 – Create a new MA “Powershell” and give it a nice name 🙂 I named mine “AccessCard Pictures”.

#8 – On the “Connectivity” tab, point to the location where you stored your schema file.
ex. C:\FIMSchemaFiles\AccessCardPictures\Get-Schema.ps1 And give it your fimsync engine service account credentials.

#9 – Global Parameters: Point to your Import, Export and PasswordChange scripts.
We are only using the Import script in this MA, but we had to specify all three. (Not sure why) but I just created two empty files Export.ps1 and Password-ChangeSet.ps1. Use the “Export simple Objects”.

#10 – Configure Partitions and Hierarchies: default

#11 – Select Object Types: user (Depending on what you define in the schema file).

#12 – Select Attributes: AccountName, Picture (I only use these two in this version, change if you changed the schema file).

#13 – Configure Anchors: user AccountName (As my picture filenames include the accountname I use it as anchor).

#14 – Configure Connector Filter: None

#15 – Configure Join and Projection Rules: I made a join rule that joins on AccountName->accountName