none
Filter for CreatedTime in Powershell for FIM RRS feed

  • Question

  • Hello,

    while this filter works:

    $filter = "/Contract[Country='DE']"
    $res = Export-FIMConfig -CustomConfig $filter -Uri $uri -Credential $cred -OnlyBaseResources

    and gives outputs like this:

    ObjectID = urn:uuid:72afbae3-762d-4d2b-6f03-6437c33796e0
    City = Frankfurt
    CostCenter = 100
    Country = DE
    CreatedTime = 15.10.2014 07:19:01

    I got with

    $filter = "/Contract[CreatedTime='15.10.2014 07:19:01']"
    $res = Export-FIMConfig -CustomConfig $filter -Uri $uri -Credential $cred 

    this error

    Export-FIMConfig : Failure on making enumeration web service call.
    Filter = /Contract[CreatedTime='15.10.2014 07:19:01']
    Error= The web service client has encountered the following class of error: Other
    Details: Additional Text Details: Request could not be dispatched.
    Correlation Identifier: bec76c79-cb01-4fdb-8aa8-e562f6f4ef41
    Failure Message:
    Request Identifier: urn:uuid:401ec817-d016-4809-8e70-1f6ca2fc9492
    At line:35 char:9
    +     $res = Export-FIMConfig -CustomConfig $filter -Uri $uri -Credential $cred -Only ...
    +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [Export-FIMConfig], InvalidOperationException
        + FullyQualifiedErrorId : ExportConfig,Microsoft.ResourceManagement.Automation.ExportConfig

     My question: How to set the xPath-Filter to filter for a date, in this example "CreatedTime" (0, >, =)?

    Regards,

    Stefan


    www.sc-orchestrator.eu , Blog sc-orchestrator.eu


    Thursday, October 23, 2014 2:57 PM

Answers

  • Hello, (oder auch Hallo :-) )

    try to format the date like this: CreatedTime='2014-10-23T15:21:07Z'

    as far as i remember FIM Service stores the date internally in UTC, so please keep that in mind when searching for a specific date.

    Regards (Grüße) Peter


    Peter Stapf - ExpertCircle GmbH - My blog: JustIDM.wordpress.com


    • Edited by Peter_Stapf Thursday, October 23, 2014 5:46 PM
    • Marked as answer by Stefan HorzMVP Thursday, October 23, 2014 8:05 PM
    Thursday, October 23, 2014 5:45 PM

All replies