Skip to content

Add a filter to all Group criteria

Some FIM really REALLY annoys me, mostly when I come up against odd and unexpected limitations, but then I write a quick little PowerShell script to fix something or other and remember that this is really one of the best differentiators of the product. This quick fix came about because I realised that the group filters did not consistently use EmployeeStatus as a criterion, and with hundreds and hundreds of groups, there’s no way they could have been fixed manually.

. E:\scripts\FIMPowershell.ps1 #See http://technet.microsoft.com/en-us/library/ff720152(v=ws.10).aspx

$filter = "/Group"
$objs = Export-FIMConfig -OnlyBaseResources -CustomConfig $filter

foreach ($obj in $objs)
{
    $grpfilter = ($obj.ResourceManagementObject.ResourceManagementAttributes | where {$_.AttributeName -eq "Filter"}).Value
    $DisplayName = ($obj.ResourceManagementObject.ResourceManagementAttributes | where {$_.AttributeName -eq "DisplayName"}).Value
    $DisplayName

    if ($grpfilter)
    {
        if ($grpfilter.contains("EmployeeStatus = 'Active'")) 
        {
            "Skip"
        }
        elseif ($grpfilter.contains("not(EmployeeStatus = 'Inactive')")) 
        {
            "Change Inactive to Active"
            $grpfilter = $grpfilter.Replace("not(EmployeeStatus = 'Inactive')","EmployeeStatus = 'Active'")
            $ImportObject = ModifyImportObject -TargetIdentifier $obj.ResourceManagementObject.ObjectIdentifier -ObjectType "Group"
            SetSingleValue $ImportObject "Filter" $grpfilter
            $ImportObject | import-fimconfig
        }
        else
        {
            "Add filter"
            $grpfilter = $grpfilter.Replace("]</Filter>"," and (EmployeeStatus = 'Active')]</Filter>")
            $ImportObject = ModifyImportObject -TargetIdentifier $obj.ResourceManagementObject.ObjectIdentifier -ObjectType "Group"
            SetSingleValue $ImportObject "Filter" $grpfilter
            $ImportObject | import-fimconfig
        }
    }
}

 

{ 2 } Comments

  1. Peter Stapf | October 4, 2013 at 11:13 am | Permalink

    Nice script as always Carol, i’ve done this also shortly, have to create a Set,MPR combinition for Team Admins, this where around 150 Sets/MPRs, no one wants to click this through the Portal.

    And by the way thanks for all the other posts which helped me a lot to get were I am now.

  2. Carol | October 4, 2013 at 10:19 pm | Permalink

    Thanks for your nice comment Peter. I’ve done lots of automated creation of Sets and MPRs, and even Workflows (using XOML templates). You can even combine with the PowerShell activity to trigger these actions from changes in the Portal – works well!

Post a Comment

Your email is never published nor shared. Required fields are marked *

Spam comments will be blocked by Akismet

*

Prednisone on line buy Prednisone overnight buy cheap Prednisone online free consult buy Prednisone on line amex uk buy Prednisone buy cod Prednisone order overnight Prednisone medikament Prednisone Prednisone order online buy Prednisone no scams buy Prednisone mastercard online purchase Prednisone buy cheap Prednisone no prescription buy Prednisone amex online without rx buy Prednisone canada purchasing Prednisone without a script where to buy generic Prednisone online without a prescription Prednisone drug non rx cheap Prednisone order Prednisone cheap overnight fedex Prednisone overnight without a prescription buy Prednisone 20 mg buy Prednisone where Prednisone without prescription overnight shipping purchasing Prednisone without a script Prednisone without rx overnight shipping where to purchase Prednisone no prescription no fees Prednisone online overnight delivery cod Prednisone prescription order order Prednisone without rx from us pharmacy buy Prednisone pills in toronto buy Prednisone online online pharmacies Prednisone buy Prednisone no prescriptions buy Prednisone once a day order Prednisone pay pal online without rx buy Prednisone where buy line Prednisone best finpecia online pill buy Maxalt us pharmacy Maxalt buy Maxalt with visa Cytotec purchase overnight delivery where buy Lisinopril purchasing finpecia with overnight delivery no prescription requip buy requip over the counter where can i order requip online how to get arimidex arimidex cheap online Lisinopril overnight cod cheap order rx metformin prednisone 40 mg cheapest place to buy Metformin purchase Metformin online Maxalt no prescription needed 10mg Maxalt 10mg canada where to buy Maxalt uk buy generic Maxalt canada buy metformin cod ordering Requip online non prescription Requip Requip without script Requip with no rx where to buy Requip Requip online no prescription buy generic Requip australia canadian pharmacy no prescription Requip Requip no rx buy generic Requip online no prescription buy cheap Maxalt under without rx buy on line Maxalt where can i buy Maxalt buy pharmacy Maxalt waterview buy maxalt online no prescription buy Maxalt visa buy Maxalt pills online maxalt buy buy Maxalt pills buy Maxalt shipped cod buy Maxalt cod Maxalt purchase online Maxalt purchase online where to buy generic maxalt online without a rx buy Maxalt with no prescription Lisinopril no prescription buy cheap Lisinopril buy cheap generic Lisinopril how to buy Metformin without a prescription Metformin price buy Alli without prescription