FIM ScriptBox Item
A PowerShell module is available on CodePlex to simplify FIM management (http://fimpowershellmodule.codeplex.com/ ). This article shows how to use that module to start a management agent in the FIM Synchronization Engine. Note: This snippet was copied from the FIM PowerShell Module project documentation. There are more samples there, as well as the module source code.
The Start-ManagementAgent function is a wrapper for the WMI class provided by the Synchronization Service. It adds value by making the operation more PowerShell'ish with features such as:
The online help for the function has more examples, but here are few simple ones:
PS C:\Start-ManagementAgent FIM Export
RunNumber ReturnValue RunProfile MaName --------- ----------- ---------- ------ 12 success Export FIM
PS C:\Start-ManagementAgent FIM Export Start-ManagementAgent FIM Import Start-ManagementAgent FIM Sync
RunNumber ReturnValue RunProfile MaName --------- ----------- ---------- ------ 13 success Export FIM 14 success Import FIM 15 success Sync FIM
@(
('ADMA 1', 'Import'),
('ADMA 2', 'Import'),
('ADMA 3', 'Import')
) | Start-ManagementAgent -AsJob | Wait-Job | Receive-Job
RunNumber ReturnValue RunProfile MaName --------- ----------- ---------- ------ 10 success Import ADMA 1 10 success Import ADMA 2 10 success Import ADMA 3