Friday, July 15, 2011

Querying for Pending or Finished FIM Requests

Just a follow-up to a previous post.  Here are two sample FIM XPath filters based on the RequestStatus values.

001
002
003
004
005
006
007
008
009
010
011
012
013
014
015
016
017
018
019
020
021
022
023
024
025
026
027
028
029
030
031

###
### Find pending requests
###

$xpathFilter = 
@"
/Request
    [
            RequestStatus != 'Denied'
        and RequestStatus != 'Failed'
        and RequestStatus != 'Canceled'
        and RequestStatus != 'CanceledPostProcessing'
        and RequestStatus != 'PostProcessingError'
        and RequestStatus != 'Completed'
    ]
"@

$requests = Export-FIMConfig -CustomConfig $xpathFilter

###
### Find finished requests
###

$xpathFilter = 
@"
/Request
    [
           RequestStatus = 'Denied'
        or RequestStatus = 'Failed'
        or RequestStatus = 'Canceled'
        or RequestStatus = 'CanceledPostProcessing'
        or RequestStatus = 'PostProcessingError'
        or RequestStatus = 'Completed'
    ]
"@

$requests = Export-FIMConfig -CustomConfig $xpathFilter

No comments: