How can I run a PowerShell script after a synchronization (i.e. add PowerShell to a workflow activity) RRS feed

  • General discussion

  • Hi,

    I've downloaded and installed the FIM PowerShell workflow activity from Codeplex ( )

    I've added an assembly into c:\windows\assembly and created the powershell activity in the portal by using the script provided (the only adjustment I've made is to set the server name, rather than use 'FIMServiceHost'. I've restarted IIS and my FIM services as required.

    In my FIM environment I have a workflow that appends users to AD and Exchange (this works fine, apart from some delta import warnings after my export). I went into my AD provisioning workflow and simply added a PowerShell Activity to the end.

    The PowerShell script I'm using is simply "get-date > c:\temp\date.txt" which works fine outside of FIM and dumps the current date into date.txt

    I've ran a FIM MA full sync, export, delta import and full sync again to update the FIM database with any portal changes.

    I've then ran through the necessary run profiles to detect a new user in an input file and provision that user to AD - this works fine, but at no point does the PowerShell script run (I'm assuming it doesn't run as my text file doesn't get an updated date).

    I'm really looking for the easiest way to run a PowerShell script after a fim run profile executes or workflow finishes. I'm running the PowerShell activity as the fim service account and it has full access to the file and folder to write to.

    There's nothing in the Windows App event log which indicates why this is failing, however I've found a few Event ID 3 errors in the Forefront Identity Manager event log as shown:

    Any help to get a PowerShell script to run after would be appreciated.


    Tuesday, May 14, 2013 9:55 PM

All replies

  • Just an update, I've managed to some of this working. I noticed some incorrect DNS settings (as an IP address and not machine name was registered in the event logs) and I've also set the "run on policy update" with my workflow activity which provisions users to AD.

    Interestingly, if I update a user the PowerShell doesn't trigger (eventhough the AD user is updated and the AD workflow activity is in the same workflow as the PowerShell activity).

    My file doesn't have the date applied, however I can tell the file is being modified as the time date stamp on the file is being changed.

    Wednesday, May 15, 2013 10:11 AM