I am trying to create a workflow using the FIM powershell module from codeplex.
I have created a attribute in FIM called "mygroupexpiration" and it is linked to user object.
My aim is to add current date + 90 days to "mygroupexpiration" when user transition in to a set.
I have created transition in MPR and which in turn calls a custom workflow to add date to mygroupexpiration.
In the custom workflow, i have selected action and selected powershell module and added the following script , but in the portal request section i am getting an error that workflow was aborted.
<RequestStatusDetail xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" DetailLevel="Information" EntryTime="2013-08-07T11:09:49.4741289Z">Workflow
Instance '8584232d-c896-437e-af02-39c3584ae583' was aborted.</RequestStatusDetail>
Any suggestion or help in the script is highly appreciated.
##--------------start of the script------------------
### Load the FIM PowerShell Module
###
if (-not (Get-Module FimPowerShellModule))
{
Write-Verbose "Loading the FIM Service Config Module from: C:\CodePlex\FimPowerShellModule"
if (-not (Test-Path C:\installers\FimPowerShellModule.psm1))
{
Throw "This script requires the FimPowerShellModule from http://fimpowershellmodule.codeplex.com"
}
Import-Module C:\installers\FimPowerShellModule.psm1 -Verbose:$false
}
Add-PSSnapin FIMAutomation -Verbose:$false
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
$ENV:ADPS_LoadDefaultDrive = 0
$dates =([DateTime]::Now).ToString('M/d/yyyy')
###
### Get the Target
###
Write-Verbose ("Getting the Targetby ObjectID: {0}" -F $fimwf.TargetId.Guid)
###$Target= Export-FimConfig -CustomConfig ("*[ObjectID='{0}']" -F ###$fimwf.TargetId.Guid) | Convert-FimExportToPSObject
$Target = Export-FIMConfig -CustomConfig [System.String]::Format("*[ObjectID='{0}']") -Uri "http://localhost:5725" | Convert-FimExportToPSObject
New-FimImportObject -ObjectType Person -State Put -AnchorPairs @{ObjectID = $Target } -Changes @(New-FimImportChange -Operation replace -AttributeName 'mygroupexpiration' -AttributeValue $dates ) -ApplyNow
##-------------End of script---------------------------
AdiKumar