This project is read-only.

PowerShell Module

The FIM PowerShell module is a wrapper for FIMAutomation snap-in and the WMI classes for the synchronization service.

Installation

Copy the FIM.psm1 file to %WINDIR%\system32\WindowsPowerShell\v1.0\Modules\FIM

Cmdlets Documentation

Add-FIMAttribute
Clear-FIMAttribute
Clear-FIMRunHistory
Get-FIMHelp
Get-FIMManagementAgent
Get-FIMManagementAgentStatus
Get-FIMResource
Get-FIMRunHistory
Get-FIMServer
New-FIMResource
Remove-FIMAttribute
Remove-FIMResource
Set-FIMAttribute
Set-FIMResource
Start-FIMManagementAgent
Stop-FIMManagementAgent

Examples

Import-Module FIM

#Retrieving FIM objects.
Get-FIMResource -Filter '/Person[AccountName = "adam.weigert"]'

#Updating a single-valued attribute.
Get-FIMResource -Filter '/Person[AccountName = "adam.weigert"]' `
  | Set-FIMResource -Set @{DisplayName={$_.DisplayName + ' (The FIM Expert)'}}

#Adding a value to a multi-valued attribute.
Get-FIMResource -Filter '/Person[AccountName = "adam.weigert"]' `
  | Set-FIMResource -Add @{ ProxyAddresses = { $_.AccountName + '@fim.codeplex.com' } }

#Removing a value from a multi-valued attribute.
Get-FIMResource -Filter '/Person[AccountName = "adam.weigert"]' `
  | Set-FIMResource -Remove @{ ProxyAddresses = { $_.AccountName + '@fim.codeplex.com' } }

# Clearing a single-valued attribute
Get-FIMResource -Filter '/Person[AccountName = "adam.weigert"]' `
  | Set-FIMResource -Clear 'Email'

#Delete a FIM object.
Get-FIMResource -Filter '/Person[AccountName = "adam.weigert"]' | Remove-FIMResource

#Create a FIM object.
New-FIMResource -ObjectType 'Person' -Set @{
  AccountName = 'adam.weigert';
  Domain = 'fim.codeplex.com';
  DisplayName = 'John Doe';
} -Add @{
  ProxyAddresses = @('adam.weigert@fim.codeplex.com', 'comments@fim.codeplex.com')
} | Set-FIMResource

# Clear the FIM Run History that is older than 30 days ago
Get-FIMServer | Clear-FIMRunHistory -TimeSpan ([TimeSpan]30d)

# Gets the status of all management agents
Get-FIMServer | Get-FIMManagementAgent | Get-FIMManagementAgentStatus

# Start a FIM run profile asynchronously
Start-FIMManagementAgent -Name 'FIM' -Profile 'Export' -AsJob

Last edited Mar 17, 2012 at 2:41 PM by adweigert, version 9

Comments

No comments yet.