How to Use PowerShell to Export Requests Since a Given DateTime

How to Use PowerShell to Export Requests Since a Given DateTime

FIM ScriptBox Item

Summary

This one-liner shows how to use an Xpath filter to export Request objects since a given DateTime.
the [DateTime].AddHours() method is used with a negative number in this example.  The AddDays(), AddMinutes() and other methods could easily be swapped in here.

Script Code

001
Export-FIMConfig -only -Custom ("/Request[CreatedTime >= '{0}']" -F [DateTime]::UtcNow.AddHours(-12).ToString("yyyy-MM-ddTHH:mm:ss.fff"))

 

note Note
To provide feedback about this script, create a post on the FIM TechNet Forum.
For more FIM related Windows PowerShell scripts, see the FIM ScriptBox.

 

Leave a Comment
  • Please add 4 and 1 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Craig  Martin edited Revision 1. Comment: changing the width of the script window to make scrolling easier

  • Maheshkumar S Tiwari edited Original. Comment: Added Tag

Page 1 of 1 (2 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Maheshkumar S Tiwari edited Original. Comment: Added Tag

  • Craig  Martin edited Revision 1. Comment: changing the width of the script window to make scrolling easier

Page 1 of 1 (2 items)