Powershell to Remove Emails for a certain date range

We are about to move our Email Archive System and are not going to be using stubs anymore.  Our current Email Archive System doesn't provide a solution to remove all the stubs we currently have in Exchange 2010 for all users.  So i need a Powershell
command or script to do this and wonder if anyone hand one handy.  It needs to remove all emails/stubs over 6 months old from all folders on all users mailboxes.  It might be safer to move them to another mailbox if i can so any that aren't stubs
can be moved back.  
Also it would be really helpful if the command first off did this on just one user so i can test it before using it on all users, or can it be ran against a single database - as i can guess this command is going to take some time as we have stubs going back
to 2006 on 200 mailboxes.
Thanks

Just found this 
http://blogs.technet.com/b/exchange/archive/2010/10/27/removing-specific-messages-from-your-exchange-server.aspx
Which fills all my requirements however can't get it to work because Export-Mailbox cmdlet doesn't seem to exist in SP1.  I have followed this guide:
http://blogs.technet.com/b/exchange/archive/2010/03/26/3409621.aspx
But that doesn't seem to enable it.  Anyone know how i can do this?

Similar Messages

  • How to change bucket capacity for a certain date range (duration)?

    Hi,
    I need to update the bucket capacities of Resource at Vendor location in APO live cache for a particular period using BAPI_RSSRVAPS_CHANGEMULTI.
    Here I am executing BAPI by passing -
    Import Parameters:
    LOGICAL_SYSTEM
    COMMIT_CONTROL
    PLANNING_VERSION
    Tables:
    RESOURCE_HEAD
    (RESOURCE = Resource  " Test123
    LOCATION = Vendor Number/Loctaion
    CAPACITY_A = 5000.000
    NUM_OF_PERIODS = 001
    PERIOD = 02    " Day Wise
    UTIL_BUCKET = 100.000 )
    RESOURCE_HEAD_X
    (All corresponding fields X)
    RESOURCE_QUANMODEL
    (RESOURCE = Resource  " Test123
    VERSION = 01
    ENDDA = 02/25/2011
    BEGDA = 02/21/2011
    QUANMODEL = 8000 )
    RESOURCE_QUANMODEL_X
    (All corresponding fields X)
    [ I have a capacity variance:
    Resource = Test123; Capacity Varient = 01; Valid From = 02/21/2011
    Valid To = 02/25/2011; Bucket Util Rate = 100.000; Qty/Rate definition = 8000 ]
    Now, while I execute /SAPAPO/RES01 to display Capacity for that resource-Location-PlanningVersion, Its showing that 'Bucket Capacity' and 'SNP Bucket Capacity' get changed into 5000. But this change happend for all the days and not only for the duration I passed into Bapi (From BEGDA to ENDDA).
    How to change bucket capacity for a certain date range (duration)? Any help please.
    Thanks
    Roy

    I did it myself. Hence closing the thread.
    Solution:
    1. Get RESUID from /SAPAPO/RESKEY table by passing Resource as NAME.
    2. Call Function Module /SAPAPO/CRES_QUANPROF_UPDATE
    3. Call Function Module /SAPAPO/CRES_SAVE_FROM_BT
    For further help, change manually a single record in the 'capacity profile' in TXN /SAPAPO/RES01 and debug both the FM mentioned above.
    BR
    Roy

  • Sync with Outlook ONLY for a specific date range

    I have a Zire 31 that I'm syncing with Outlook via latest Palm Desktop/HotSync.   I did just install the latest conduit.
    I was getting several repeating calendar entries that were not syncing with the Zire (annual birthdays, etc.) - turns out that they did not have an "end-date" specified when created in Outlook.  Creating an end-date solved the problem.
    However - I would like to know if it is possible to specify a certain date range for the device to sync (e.g., sync calendar only for years 2007 through 2050, or in other words sync from 1 year ago to 50 years in future, etc...)
    I recall specifying this once years ago, but I may have been using a third party to sync with Lotus Notes at the time.  I'm wondering if this option is also available with syncing directly with Outlook using HotSync???  I can't imagine it's not, but I can't find where you specify it.
    One more interesting note:  while my Zire 31 had issues syncing those repeating calendar entries - my much older HandSpring Visor Deluxe syncs them no problem!  Go figure.
    Thanks much -
    Post relates to: Zire 31

    I'm not actually looking to purge old items.
    Rather - I would like to ONLY sync calendar entries between a specified range of dates.  For example - ONLY sync for calendar entries between Jan 1 2007 and Jan 1, 2050.
    the problem is that I have some repeating entries (birthdays, etc.) that are set up in Outlook with no end date.  Apparently Palm/HotSync is having trouble syncing these (they don't show up at all - for any year.)
    One resolution is to apply an end-date for each repeating calendar entry.  However, this is just another step my wife needs to remember to do.  If you happen to forget to to this, then Hotsync will ignore that entry.  Fine if you realize that's happening, but if you forget and forget to check - you won't even know it didn't sync!
    The other possible resolution is to only have HotSync sync for a SPECIFIC date range - one that does not presumably go to infinity.  That is my question - how does one sync ONLY for a specific date range.  Has nothing to do with purging old entries.
    Thanks!!
    Post relates to: Zire 31

  • Need to create a report to show values for a particular date range

    I have to create a report, out of which I need two columns : << Customer Value Variance and Churn Score Variance >> to show values only for a custom date range, which will be entered via a dashboard prompt.
    These generic date columns are not present and cannot be added. I have to make use of Pres variables
    What I have currently done is:
    1) Created a prompt with 2 different date columns and passing those values into variables vStartDate and vEndDate. (I don't actually need those 2 column which I have selelcted, but I have taken those so that I can prompt the values in calendar format and pass onto the variables)
    2) Created report with necessary columns, with 2 extra columns (hidden) as vStart Date Column and vEnd Date Column which take the values from the presentation variables defined in the prompt. I have created these columns as then I can reference these in the two required columns if necessary.
    I am already facing error in report after doing this and I am confused how to proceed. Any suggestions?
    Thanks.

    Yes, but it only has one generic Date column, no start date and end date. I can't use that twice in the prompt. Although I can specify it to be 'between', but I'm not sure I can pass values to both variables like that.
    Currently I have used Campaign Start Date and Campaign End Date to enter values in calender format to the variables.

  • Name of users of a particular Tcode for a given date range

    Hi experts,
    I am making an alv where inputs will be
    1> T_code(as parameter)
    2> Date Range(as Select options)
    I have to display the following fields:::
    1> User name
    2> Frequency of use the Tcode for the given Date range.
    Please give me the tables where I can get the relation of those fields.
    N.B. I know the transaction AL08 and SM04.But it won't solve my purpose.
    Thanx in advance,
    Sourav

    >
    SOURAV PAUL wrote:
    > Hi experts,
    > I am making an alv where inputs will be
    > 1> T_code(as parameter)
    > 2> Date Range(as Select options)
    by creating the report As per your this requirement you need not to create any Bulk on your SAP.Just use STAD/STAT transaction they are availabe for this purpose.
    and more you may track by security log audit by SM20 get these details.
    i'm worried about tables which sre storing these details.

  • Any FM to get count of each week day for the given date range

    Hi guys,
    Any FM to get count of each week day for the given date range?
    eg: If i give 14/07/2008 to 14/08/2008
    I need to find how many Mondays, tuesdays...sundays in this given date range.
    If not single FM is available, any logic that gives above result is also appreciated.
    Thanks,
    Vinod.

    hi Vinod,
    this is not a full solution, I just give you a basic idea:
    DATA : lv_start TYPE sy-datum VALUE '20080714',
           lv_end   TYPE sy-datum VALUE '20080814'.
    WHILE lv_start LE lv_end.
      CALL FUNCTION 'FTR_DAY_GET_TEXT'
        EXPORTING
          pi_date = lv_start.
    * IMPORTING
    *   PE_DAY_TEXT1       =
    *   PE_DAY_TEXT2       =
    *   PE_DAY             =
    * you have to summarize the output here somehow...
      lv_start = lv_start + 1.
    ENDWHILE.
    hope this helps
    ec

  • Outlook not downloading icloud emails after a certain date,

    I've installed Outlook 2013 and sync'd icloud but not all my emails have downloaded, they seem to stop up to a certain date 3 months ago.  I've uninstalled both several times but again nothing is downloaded after that date.
    Other email accounts in Outlook are unaffected.
    This happens when I ran Win7 and the same now with 8.

    It will not automatically merge, but import as new On My Mac mailboxes.
    If you have backup for both the com.apple.mail.plist file (Home/Library/Preferences) and the Mail folder (Home/Library) then copy the old ones to replace the existing new ones, and launch Mail, and it will return to where it was at the time of the backup. Then it would redownload the more recent messages.
    Drag the existing Mail folder to the Desktop until you confirm all has been recovered.
    Ernie

  • How to get the weekends days for a specific date range

    I want to select list of only weekend dates from a given date range. Is it possible in SQL?
    For example if the range is '08/01/2011' and '08/30/2011'
    I want a list
    08/06/2011
    08/07/2011
    08/13/2011
    08/14/2011
    08/20/2011
    08/21/2011
    08/27/2011
    08/28/2011Thank You, Naveen email:[email protected]

    First and easy to do is having a Calendar table, which over there you can have those information.
    http://arbibaghdanian.blogspot.com/2011/05/calendar-table.html
    Declare @beginDate Date, @EndDate Date
    Select @beginDate = '08/01/2011', @EndDate = '08/31/2011'
    Declare @Calendar Table
    (CalendarDate Date Primary key, IsWeekend Bit, YearNo SmallInt, QuarterNo TinyInt, MonthNo TinyInt, DayOfYearNo SmallInt, DayNo TinyInt, WeekNo TinyInt, WeekDayNo TinyInt)
    While @beginDate <= @endDate
    Begin
    Insert Into @Calendar
    Select
    @beginDate As CalendarDate
    ,(Case When DATEPART(Weekday, @beginDate) In (7, 1) Then 1 Else 0 End) As IsWeekend
    ,DATEPART(Year, @beginDate) As YearNo
    ,DATEPART(QUARTER, @beginDate) As QuarterNo
    ,DATEPART(MONTH, @beginDate) As MonthNo
    ,DATEPART(DayOfYear, @beginDate) As DayOfYearNo
    ,DATEPART(Day, @beginDate) As DayNo
    ,DATEPART(Week, @beginDate) As WeekNo
    ,DATEPART(WEEKDAY, @beginDate) As WeekDayNo
    Set @beginDate = DateAdd(Day, 1, @beginDate)
    End
    Select * From @Calendar Where IsWeekend = 1
    Best Wishes, Arbi --- MCC 2011; Please vote if you find this posting was helpful or Mark it as answered.

  • How to get XLR to show BPs with no transaction data for a given date range

    Hi -
    I am building an XLR report that does a comparison of net sales data across two periods for a given sales employee's BPs.
    The report has the row expansion:
    FACT BPA(*) SLP(SlpName = "ASalesPersonNameHere") ARDT(Code = "ARCreditMemo", "Invoice") Group by BPA.CardName
    and column expansions:
    FIG(SO_TaxDate = @StartDate:@EndDate)
    and
    FIG(SO_TaxDate = @StartDate2:@EndDate2)
    where @StartDate, @EndDate, @StartDate2, @EndDate2 are parameters that define the two ranges of dates.
    The column formulas are, from left to right:
    =ixDimGet("BPA", "CardName")
    =ixGet("SO_DocTotal")      <-- filtered by column expansion for first date range
    =ixGet("SO_DocTotal")      <-- filtered by column expansion for second date range
    The report works fine except for one problem, I would like it to include BPs for which no transaction occurred in either date range as well.
    Any help is greatly appreciated!
    Thanks,
    Lang Riley

    Really appreciate your feedback!  Those are good suggestions. I should have mentioned that I had already tried both those suggestions.
    Removing FACT on BPA in this case ends up returning all the BPs and not respecting the SLP(SlpName = "aName") part of the query. 
    Using **, i.e., * or #NULL, makes no change in the resulting data in this case.  I had thought that ** would be the solution, but it didn't change the outcome.  I still have BPs for which when their sales employee is used as the filter and they have no transactions for either date range, and yet they still do not appear. 
    I should further mention that the IXL query, as it now stands, does return BPs for which one of the periods has no data, just not both, and I have verified that applicable BPs with no transaction data for both periods do exist in my data set.  It seems that perhaps the IXL query needs to be restructured?  Please keep the suggestions coming including how this query might be restructured if necessary.

  • Getting last-day-of-week dates within certain date range

    Hi all,
    I have the following Challenge:
    I want to know the dates of the last day of all the weeks within a certain range of dates.
    For instance if my range would be 01-jun-2002 - 31-jun-2002
    then the returned days should be (lastday of the week is sunday):
    . 02-jun-2002
    . 09-jun-2002
    . 16-jun-2002
    . 23-jun-2002
    . 30-jun-2002
    I want to accomplish this by only using sql (no pl/sql) in a ora 8.0.x rdbms
    How would I do this? (if it's possible)
    Tia,
    Martin

    Christian's solution returns
    01-JUN-02
    08-JUN-02
    15-JUN-02
    22-JUN-02
    on my system. The first day of the week is dependent on NLS settings.
    SELECT MAX(realdate)
    FROM (
    SELECT TO_CHAR(TO_DATE('31-may-2002','dd-mon-yyyy') + ROWNUM,'IW') weekno,
           TO_DATE('31-may-2002','dd-mon-yyyy') + ROWNUM realdate
    FROM all_objects
    WHERE rownum <= TO_DATE('30-Jun-2002','dd-mon-yyyy') - TO_DATE('01-Jun-2002','dd-mon-yyyy')
    GROUP BY weeknoThe IW format model give ISO standard week numbers and a week always starts on Monday.

  • Sum an amount between a certain date range

    Hello,
    I am working out a home budget and want to know how to calculate what is due this month.
    I have two columns - "Amount" and "Due Date". Some content for an example is:
    Amount,Due Date
    20,15/05/2009
    300,16/05/2009
    40,1/06/2009
    What I want is a formula which will sum the total amount of items due within this months' date range. If the date range could be as automatic as "This Month" that would be great otherwise I would say IF "Due Date" between 1/05/2009 and 31/5/2009.
    Is this possible?

    In column D, the formula is:
    =YEAR(C)*100+MONTH(C)
    In B8 and in B9 the formula is:
    =SUMIF(D,YEAR(A)*100+MONTH(A),B)
    Yvan KOENIG (from FRANCE jeudi 14 mai 2009 15:30:56)

  • Count records for a specific date range

    Hi,
    I am using BI Publisher with Siebel 8.1.1.1. I have a monthly report where I want to count the number of service requests entered per customer per month.
    I am using the following expression that works for one month:
    <?count(ssServiceRequest[ssSeverity[.='1-Critical'] and xdoxslt:date_diff('d',psfn:getCanonicalDate(ssCreated), xdoxslt:current_date($_XDOLOCALE,$_XDOTIMEZONE), $_XDOLOCALE, $_XDOTIMEZONE) <=28])?>
    However, I want to be able to specify a specific date range for my count, i.e ssCreated >= '01/02/2011' and <= '28/02/2011', as opposed to count for the past 28 days. Can you please advise what syntax I can use to specify a date range?
    Any help will be greatly appreciated!
    Claire

    Hello,
    Many many thanks for your reply.
    I'm doing as you suggest and am using the date_diff to the end of the period in question. I've tried the following to get the number of Service Requests with Severity 1-Critical, created in Jan 2011, feb 2011:
    <?count(ssServiceRequest[ssSeverity[.='1-Critical'] and xdoxslt:date_diff('d', (psfn:getCanonicalDate(ssCreated), $_XDOLOCALE, $_XDOTIMEZONE), '2011-01-31', $_XDOLOCALE, $_XDOTIMEZONE) <=31])?>
    <?count(ssServiceRequest[ssSeverity[.='1-Critical'] and xdoxslt:date_diff('d', (psfn:getCanonicalDate(ssCreated), $_XDOLOCALE, $_XDOTIMEZONE), '2011-02-28', $_XDOLOCALE, $_XDOTIMEZONE) <=28])?>
    In my xml sample data that I'm using I have 2 service requests that mean the criteria for Jan, yet when I run my report I'm getting '0'. The problem seems to be with my end of period date '2011-01-31'. I've also tried with both start and end period date (using a negative value as per your suggestion), but I still get '0':
    <?count(ssServiceRequest[ssSeverity[.='1-Critical'] and xdoxslt:date_diff('d', (psfn:getCanonicalDate(ssCreated), $_XDOLOCALE, $_XDOTIMEZONE), '2011-01-01', $_XDOLOCALE, $_XDOTIMEZONE) <=-31 and xdoxslt:date_diff('d', (psfn:getCanonicalDate(ssCreated), $_XDOLOCALE, $_XDOTIMEZONE), '2011-01-31', $_XDOLOCALE, $_XDOTIMEZONE) <=31])?>
    Many thanks,
    Claire

  • How to see Control chart for a specific date range in QGC3

    Hi
    I am developing SPC for my client.I am facing one problem.
    I am using one control chart for all inspection lot for a particular MIC.Free inspection point is used in inspection plan.
    Control chart is used 516.(XMR chart)
    Now when i am calling control chart for MIC executing QGC3,chart is showing results since creation chart date to todays date.
    Now if i want to see chart for a particular period or date range,what is the procedure.
    Thanks in advance
    Nilanjan

    Hi,
    1. Even though when i give the Created on, and to date the system is displaying the report which is prior to the created on date.
    2. Similarly the report data is different when the field is maximum no of Hits is given. for example when i giving this field as 10, 20, 30, etc the report is showing only 10 line items. if i enter 50, 60 etc it is showing the list for half i given.
    Note that system is having more than 1000 line items to display..
    Regards,
    R. Loganathan

  • LX25 displays wrong data for the entered date range

    System says "Inventory not executed" status for the bins even if Inventory is executed for the bins in the date range provided in the selection screen.
    For e.g.
    I execute report for Warehouse XYZ. I specify date range as 01.04.2014 to 31.03.2015.
    I get some bins in the status "No Inventory executed".I presume that Inventory is not executed for these bins within this period.
    But when I go to each bin in the status "No Inventory executed" I find that The bins are counted on the dates 24.09.2014 and then on 05.04.2015.
    Then I changed the date in the selection screen to 01.04.2014 to 05.04.2015.
    Those bins which were earlier in the status of "No inventory status executed" are now not present in this status.
    Does this mean that LX25 report is based on the Last counted date? Or the report is not displayed correctly for the date range provided?
    I want to know the criteria based on which the LX25 report works.
    Thanks In Advance.

    Hi Jurgen,
    Below information I found from the LX25 report info in SAP.
    Inventory status
    Description
    This report provides information on the stock in the storagae bins and presents this on the screen.  You can limit your selection by warehouse number, storage type and storage bin, or choose the following criteria:
    Total number of bins
    Number of inventoried bins in the selection period
    Bins with active inventory
    Bins with planned inventory
    Bins without executed inventory
    From this list, you can obtain a plan of the individual storage bins with further detail information within a storage type, by clicking on the relevant line total.
    It clearly shows that the report should be able to show the number of inventoried bins in the selection period, which it doesn't. Does it mean that system is not working as expected?
    Regards
    Soumya

  • Function Module for separating a date range into days

    Hi all,
    Does anyone know if there is a function module which gives back the list of days when we give a date range as input parameter to the function module. For example, we enter the range 10.07.2006 - 13.07.2006 and the function module gives back a table  in form 10.07.2006, 11.07.2006, 12.07.2006, 13.07.2006.
    Thanks,
    Sükrü

    Hi suekrue,
    1. Exactly for this purpose,
       i have written an
       INDEPENDENT FORM (subroutine)
      wherein we pass
       a) fromdate
       b) todate
       c) ITAB
    2. and it gives all the dates in the internal table.
    3. just copy paste
    4.
    data :  itab type table of sy-datum with header line.
    parameters : fromdate type sy-datum default '20060701'.
    parameters : todate type sy-datum default sy-datum.
    perform getdays tables itab using fromdate todate.
    break-point.
    FORM
    form getdays
    tables itab
    using fromdate todate.
      data : curdate type sy-datum.
      curdate = fromdate.
      do.
        if curdate > todate.
          exit.
        endif.
        itab = curdate.
        append itab.
        curdate =  curdate + 1.
      enddo.
    endform.                    "getdays
    regards,
    amit m.

Maybe you are looking for

  • Error in Updating Billing Docs

    Hi Gurus, When i'm updating the some billing docts in VBOF,  the system thros the "No correction due to value change" error. Can u tell me what is the problem? cheers, Sumith

  • Oracle Tag in Report Header Text

    I am trying to use the Oracle tag in the Report and Customization Form Text Header Section. I would like to show the current date/time as well issue a select statement. Does this not work? <ORACLE> htp.p(to_char(sysdate,'Day, Month DD YYYY HH:MI AM')

  • [solved] Gnome + Openbox: I simply can't get it to work.

    I'm trying to replace Metacity with Openbox on a gnome desktop. I've read the wiki entry and followed both the steps for Gnome 2.26 and 2.24 and neither of them works correctly for me. I autologin x and my user using this script in /etc/rc.local (so

  • How do I put artwork on my own podcast in itunes store?

    I just created a new podcast using audacity.  Got the first episode recorded, exported as an MP3, uploaded to Podbean, submitted it to itunes and got approved.  It is now searchable in the itunes store. When I pull it up on itunes on my computer it n

  • AS2 swf problem under AS3 swf (probably Tweener problem)

    Hello. I have this problem for a days and it hasn't been soluted yet although I put it on couple of forums. I have 3 files: test.fla, file_as2, file_as3. The test.fla file is a typical Loader, which loads external swf files and shows them on the scre