GAL Photos reloaded–batch import

#exchange, #server edit this page

About two years ago I’ve posted an article about Exchange 2010 and GAL Photos. Now this is not great news anymore, there are two great articles on the Exchange Team Blog, that explain how to configure this, too. Find them here: aka.ms/galphotosand aka.ms/galphotosfaq

Key points are the the minor schema change and the maximum file size of 10KB. Images can be max. 96x96 pixels in size.

Now in the last couple of days I wrote a “cmdlet” to make batch importing images easier. For starters, the cmdlet gets all *.jpg files in folder, then it uses the files BaseName to find corresponding Exchange Mailboxes. After that the image’s physical dimensions as well as file size are verified, if they are ok, the image is imported using Import-RecipientDataProperty.

The folder containing the images can be set using the cmdlet’s –FilePath parameter, the cmdlet takes pipeline input from Get-ChildItem too.

Here are two examples of how the cmdlet could be used:

PS C:\> Import-GalPhoto -FilePath 'c:\temp\pics'
 
PS C:\> dir 'c:\temp\pics' | Select-Object -First 2 | Import-GalPhoto

I’ve pasted the function to PoshCode, here it goes:

enjoy,
tom