Thursday, January 03, 2013

FIM 2010 R2 Service and Portal Configuration Backup Tool

I was looking for something today and stumbled upon this:
FIM 2010 R2 Service and Portal Configuration Backup Tool
While I love seeing new tools, I was a little bummed that it wasn’t provided as a bunch of new PowerShell commands, but instead as an EXE.  Don’t get me wrong, I’m still happy to have a new tool for FIM!
For anybody interested, you could of course get some re-use from the tool since it is a .NET EXE that can be loaded in PowerShell.  BTW – the sample below is totally unsupported, it is just intended to show that PowerShell can be used to consume tools that otherwise would require C#, and that PowerShell can be used as a discovery tool to see what is inside a file.

###
### Add-Type won't work here because the file isn't a DLL
###
$filepath = 'C:\Program Files\Microsoft Forefront Identity Manager\2010\Tools\Configuration Backup\Microsoft.IdentityManagement.ConfigurationBackup.exe'
[System.Reflection.Assembly]::LoadFile($filepath)
 
###
### Try calling one of the static methods
###
[Microsoft.IdentityManagement.ConfigurationBackup.Detection]::DetectIfProductInstalled()
 
UPDATE: had a bad URL - thanks Peter Geelen!

No comments: