Get-date problem

This topic contains 0 replies, has 1 voice, and was last updated by  Forums Archives 5 years, 11 months ago.

  • Author
    Posts
  • #6242

    by taheito at 2012-12-22 06:20:43

    Hello,
    my project start was "01 Sept 2012" and i am generating bi-weekly reports to see the project progress. so i need to pipe the Get-date to be (Today – "01 Sept 2012) how I can do that ?
    the script is below
    get-qaduser -SizeLimit 0 -NotLoggedOnFor (Today – '01 Sept 2012)

    by Klaas at 2012-12-23 02:00:12

    you could try this:
    $DaysSinceSep01 = ($(get-date) - $(get-date('01/09/2012'))).days
    get-qaduser -SizeLimit 0 -NotLoggedOnFor ($DaysSinceSep01)

    Depending on your locale settings you might have to switch '01' and '09'.

You must be logged in to reply to this topic.