24 July 2014

Use FIM powershell cmdlets on another computer

in order to use FIM posershell cmdlets to another computer you need to register the FIM libraries.

first the dll files must be copy from the FIM installation directory to the local computer.
usually is C:\Program Files\Microsoft Forefront Identity Manager\2010\Service\
and we need this files:

  • Microsoft.ResourceManagement.Automation.dll
  • Microsoft.IdentityManagement.Logging.dll
  • Microsoft.ResourceManagement.dll
  • Microsoft.ResourceManagement.Automation.dll-Help.xml (only if if you need help on the imported cmdlets)
we also need gacutil.exe. it's included with Visual Studio (as part of the Microsoft SDK) and the .Net framework (v1 and 1.1 only!)  So it might be in one of the following location:
  •  %programfiles%\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\gacutil.exe
  • %programfiles%\Microsoft SDKs\Windows\v6.0\Bin
  • %programfiles%\Microsoft SDKs\Windows\v6.0A\Bin
  • %windir%\Microsoft.NET\Framework\v1.0.3705
  • %windir%\Microsoft.NET\Framework\v1.1.4322

after the files were copyed (to your prefered spapin directory) the libraries must be registred :

open a powershell console with elevated rights and set current directory to where you copyed the dll file.

create an alias for the instalutil.exe
Set-Alias installutil  C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil
 for x64 use C:\Windows\Microsoft.NET\Framework64\v4.0.30319\installutil

Register libraries:


  1. InstallUtil.exe -i .\Microsoft.ResourceManagement.Automation.dll
  2. gacutil -i Microsoft.ResourceManagement.dll
  3. gacutil -i Microsoft.IdentityManagement.Logging.dll

to verify if the snapin has been registred use: Get-Pssnapin -Registred

Later edit:
gacutil is not available by default on windows server 2012 - powershell can help overcame this:

Set-Location 'to fim dll directoy'
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")
$publish = New-Object System.EnterpriseServices.Internal.Publish
$publish.GacInstall("Microsoft.ResourceManagement.dll")

$publish.GacInstall("Microsoft.IdentityManagement.Logging.dll")

later edit source

No comments:

Post a Comment