none
How do you make the Filter so we can use the FIM cmdlets to list Users who have no Manager attribute RRS feed

  • Question

  • I can easily create a Set of Users who are "unusual"

    The SET criteria is

    EmployeeID starts with %

    and Any of

        EmployeeStatus not starts with %

        EmployeeType not starts with %

        Manager not in All FIM users

    This criteria works and gives me all the users when I push the View Members button.

    But when I look at the Set's Filter it seems to refer to a uuid of that All FIM users Set. To be honest I dont fully understand the set's XPATH filter.

    What I hope to do is to some how build a filter so that the FIM cmdlets can be used to identify and fix up these users, especially those who do not have a valid Manager. There are hundreds of these non-standard users and although possible, its not practical to do this by hand via the "All Non Standard Users" set.

    Any hints welcomed.

    Thursday, January 23, 2014 8:54 AM

Answers


  • All users without a manager: Xpath Filters

    /Person[not(Manager=/Person)]
    or,
    /Person[Manager!=/Set[DisplayName='All People']/ComputedMember]

    <# Please do not anything in the production environment unless and until you are very much sure #>

    # Powershell Cmdlet to find all users in portal not having manager
    # Load FIMAutomation module

     if(@(Get-PSSnapin | ? { $_.Name -eq "FIMAutomation" } ).Count -eq 0)
     {
         Add-PSSnapin FIMAutomation;
     }
    $users = Export-FIMConfig -customConfig "/Person[not(Manager=/Person)]" -Uri "http://localhost:5725"  -OnlyBaseResources
    foreach ($user in $users)
    {
    $x = (($user.ResourceManagementObject.ResourceManagementAttributes | Where-Object {$_.AttributeName -eq "DisplayName"}).Value) 
    Write-Host "$x"
    }

    Thanks and regards,
    Anirban Singha(Bangalore)



    Thursday, January 23, 2014 9:41 PM