How to use get-mailbox -Identity to select or target multipul users.

When I use this statement, the command executes just fine, and all is while.
Get-Mailbox user1 | Search-Mailbox -SearchQuery 'Attachment:"Query1"' -targetmailbox "admin" -targetfolder "test" -searchdumpster -loglevel full
what also works is this:
Get-Mailbox -Server Server1 | Search-Mailbox -SearchQuery 'Attachment:"Query1"' -targetmailbox "admin" -targetfolder "test" -searchdumpster -loglevel full }
However I need to target about 10 user mailboxes for this search (and larger a delete\purge) I'd rather not run the same command 10times just changing the user name, is there a way to put that all on one search command?

Run your command like this:
"User1","User2","User3","User4","User5","User6","User7","User8","User9","User10" | Get-Mailbox | Sort Name |
Search-Mailbox -SearchQuery
'Attachment:"Query1"' -targetmailbox
"admin" -targetfolder
"test" -searchdumpster
-loglevel full
That will iterate through each mailbox individually.  You can also put all the names into a txt file (one alias to a row) and use
Get-Content <filename> instead of the list of aliases - that makes it simpler to update your list.
Get-Content <filename> | Get-Mailbox | Sort Name | Search-Mailbox
-SearchQuery 'Attachment:"Query1"'
-targetmailbox "admin"
-targetfolder "test"
-searchdumpster -loglevel full

Similar Messages

  • How do i get current active or selected page item's  reference

    Hi all,
    How do i get current active or selected page item's  reference .
    Please help me

    You can implement a selection suite for your need, this selection suite will be placed into the kLayoutSuiteBoss.
    In this selection suite place a method to give you the UIDRef of the selected pageitem, which you can get by using the method "GetUIDList" of the "ILayoutTarget" interface.
    Manan Joshi
    - Efficient InDesign Solutions -
    MetaDesign Solutions
    http://metadesignsolutions.com/services/indesign-development.php

  • How to use X-Fi Effects without selecting SB as the default sound device?

    How to use X-Fi Effects without selecting SB as the default sound device?Hello everyone,
    That's my situation.
    I have Sound Blaster X-Fi Go sound card and I am using SRS HD Audio Lab. SRS HD Audio Lab was selected as the default audio device and X-Fi effects (X-Fi CMSS-3d, Equalizer etc.) was working without any problem in Windows Xp. I have Windows 7 now and when i select SRS HD Audio Lab as the default device, Creative effects are not working, i must select "SB X-Fi Go!" to get them working but i can't use SRS HD Audio Lab in that case. SRS is also using SB X-Fi Go sound card as the output and volume adjustment on console launcher is working but something is disabling the effects. Any solutions to enable effects ?
    Thanks.

    If the kernel modules for your sound card and webcam both support the index parameter (use modinfo to find out) then adding
    options <name_of_preferred_card's_kernel_module> index=0
    options <name_of_second_card's_kernel_module> index=1
    to /etc/modprobe.d/modprobe.conf (or another modprobe conf file of your choice) should solve the problem.

  • How can I get width that multiple selected items?

    How can I get width that multiple selected items? (Not grouped.)
    //---------- source code ----------
    var mm = 2.83464566929134 //unit conversion. (point->milimeter)
    var W = docRef.selection[0].width/mm;
    alert(W);
    //---------- source code ----------

    That's right Carlos
    @kimDino8,
    my script in Carlos link creates a green rectangle around the selected items. If you don't need this rectangle than you can remove this lines:
    var newRGBColor = new RGBColor();
    newRGBColor.red = 0;
    newRGBColor.green = 255;
    newRGBColor.blue = 0;
    and replace this:
    var aRectangle = aDoc.pathItems.rectangle(vBounds_Ob, vBounds_Li, vBounds_Re - vBounds_Li, vBounds_Ob - vBounds_Un);
    aRectangle.strokeColor = newRGBColor;
    aRectangle.strokeWidth= 2;
    aRectangle.filled = false;
    aRectangle.stroked = true;
    aDoc.selection = null;
    with this:
    var mmFactor = 2.83464567;
    alert("width = "+ (vBounds_Re - vBounds_Li)/mmFactor);
    alert("height = "+ (vBounds_Ob - vBounds_Un)/mmFactor);
    Further you only have to do: create a function for rounding of the result.

  • How to use get getResourceAsStream

    Gday all,
    I gave up trying to comprehend the API doco and tutorials on the How to use get getResourceAsStream. I don't care how the class loader locates resources... I just it to work. Now!
    Here's what works... and what doesn't work...
    package krc.geometry;
    import java.util.Properties;
    import java.io.FileInputStream;
    import java.io.IOException;
    import krc.utilz.io.RuntimeIOException;
    abstract class GeometryProperties {
      private static Properties properties = new Properties();
      static {
        try {
          // properties.load(new FileInputStream("c:/java/home/src/krc/geometry/Geometry.properties")); //WORKS
          // properties.load(new FileInputStream("c:/java/home/classes/krc/geometry/Geometry.properties")); //WORKS
          // properties.load( (new Object()).getClass().getResourceAsStream("krc/geometry/Geometry.properties")); //DOES NOT WORK
          // properties.load( (new Object()).getClass().getResourceAsStream("krc.geometry.Geometry.properties")); //DOES NOT WORK
          // properties.load( (new Object()).getClass().getResourceAsStream("Geometry.properties")); //DOES NOT WORK
          // properties.load( (new Object()).getClass().getResourceAsStream("krc\\geometry\\Geometry.properties")); //DOES NOT WORK
          properties.load( (new Object()).getClass().getResourceAsStream("/krc/geometry/Geometry.properties")); //WORKS
        } catch(IOException e){
          throw new RuntimeIOException("Failed to load GeometryProperties: " + e.getMessage());
      static Properties get() {
        return properties;
      static String getProperty(String key) {
        return properties.getProperty(key);
      public static void main(String... args) {
        System.out.println(GeometryProperties.getProperty("format.double"));
    }I hope someone finds this helpful someday.
    Some related links are:
    http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResourceAsStream(java.lang.String)
    http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getSystemResourceAsStream(java.lang.String)
    http://java.sun.com/javase/6/docs/api/java/lang/ClassLoader.html#getSystemClassLoader()
    http://www.google.com.au/search?hl=en&q=getResourceAsStream+tutorial&meta=&btnG=Google+Search
    http://rachel.sourceforge.net/tutorial.html
    http://forum.java.sun.com/thread.jspa?threadID=5227823&messageID=9928698
    PS: I think the API has ludicrously complicated explanation of something which can be explained succinctly by example... It's a classic case of a "correct" description which only makes sense once you already know how it works. Whomever wrote that one gets 3 out of 10 stars from me... ie No bananas.
    Cheers. Keith.
    Edited by: corlettk on Dec 2, 2007 9:28 AM - typos.

    I've noticed a good google hit rate on this forum, especially on threads with meaningful a subject lines... That's how I found these forums in the first place... I'm hoping that posting solutions and comments here (as well as the occasional question) will make them available to others from google... I doubt that any site I created would earn the same "front page" status as Sun's site.
    Besides, doesn't it still cost money to setup a blog or your own homepage?
    I admit I'm intrigued despite myself... I'm aware that both http://www.joelonsoftware.com/ and http://www.dreamincode.net/ (and problably many others) started as little personal blogs.

  • How can I get Win 10 to open to my prefered user account?

    How can I get Win 10 to open to my prefered user account?  It insists on going to my Administrative account.

    Hi,
    We could click the Back button beside the account Picture, then the screen would list the account available on this PC:
    After that, we could choose the account we want to use.
    Another way is to enable this policy:
    Interactive logon: Do not display last user name
    If this policy is enabled, the full name of the last user to successfully log on is not displayed on the Secure Desktop, nor is the user’s logon tile displayed;
    If this policy is disabled, the full name of the last user to log on is displayed, and the user’s logon tile is displayed.
    Press Win +X, then open the Run box, type Gpedit.msc,  when opening the Local Group Policy Editor, navigate to the following path:
    Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options
    On the right pane, find the above policy and then enable it.
    More information about that policy, please see:
    Interactive logon: Do not display last user name
    Best regards
    Michael Shao
    TechNet Community Support

  • Urgent******how can i get the number of rows enterd by the user in a table

    Hi Frndz..
    As per my requirement i need to do the validations for the multipple rows in a table that was enterd by the user,
                   T
              The prob is how can i get that number of rows that enterd by user,
           WDMessageManager msg = wdComponentAPI.getMessageManager();
         String col1= "";
         String col2= "";
         double col3= 0;
         double col4= 0;
         double amount= 0;
         int nodesize = wdContext.nodeTest().size();
         try
         for(int i=0; i<=2 ; i++)
                   col1 = wdContext.nodeTest().getTestElementAt(i).getCol1();
                 //msg.reportSuccess("col1 size is :"+col1);
                   col2 = wdContext.nodeTest().getTestElementAt(i).getCol2();
                   col3 = wdContext.nodeTest().getTestElementAt(i).getCol3();
                   col4 = wdContext.nodeTest().getTestElementAt(i).getCol4();
                    amount = wdContext.nodeTest().getTestElementAt(i).getAmount();
              if(col1 == "" )
                        msg.reportException("Plz fil the col1 for line:",true);
                   break;
              else
              if(col2 == "" )
                                  msg.reportException("Plz fil the col2 for line:",true);
                             break;
                        else
              if(col3 <= 0)
                   msg.reportException("Plz fil the col3:",true);
                   break;
              else
                   if(col4 <= 0)
                   msg.reportException("Plz fil the col4:",true);
                   break;
              msg.reportSuccess("skvgjhdfgasdfgsjkafguisafisenvtvyeriy");
                                                       wdThis.test();
         catch (Exception e)
                   msg.reportException("strMessage in catch block",true);
         this is the code am going
    Regards
    Rajesh

    Hi,
       You can try this:
    * Let's say the table's datasource is a node called Table  and it has two attributes first & second.
    * You want to check if any of these attributes has been changed by the user or not. If they have been
    * changed then you want to do some validations against them.
      int sizeOfTable = wdContext.nodeTable().size();
      for(int i = 0; i < sizeOfTable; i++){
         IPrivate<view name>.ITableElement ele = wdContext.nodeTable().getTableElementAt(i);
         if(ele.isChangedByClient(ITableElement.<attribute name>)){
            //value has been changed, do some validation. You can get the row index using ele.index().
    Regards,
    Satyajit.

  • How do I get a modorator to reset my target SNR

    At approx 11.30 on 3.5.11 my line continuously dropped and re-established connection for about 20-30 mins (each time synchronising at circa 4800kbps and SNR of 6.0).
    By 5.5.11, the (target) SNR had risen to 9db and the line was synching between 3700 and 4200kbps.
    On Saturday 7.5.11 I spoke to customer support who reset target snr margin to 6 and line synched at >4800kbps. Unfortunately, in the evening, target snr margin was at 12db with synch between 2800-3500kbps. It has been like this ever since.
    I have asked for target snr to be reset to 6db almost every day since then with assurances that it will happen. It hasn't (even when put through to UK help team last night). My line has operated perfectly well for the past 3 years at target snr of 6db. I know both from previous dealings with BT and from these community support forums that BT Wholesale can manually change target SNR to the default of 6th either by a team leader talking to them or a forum moderator instigating the change.
    Unless this change is made, I will not achieve the synch speed I know is possible. How do I get a modorator to reset my target SNR back to 6db?

    welcome to the forum
    have you found the cause of all your reset problems which resulted in your increase in noise margin and reduction in speed?  If you get the noise margin dropped to normal 6 and the noise problem is still there then in a few days maybe even sooner you will be back with a noise problem of 12 again
    has you connection been stable with noise margin of 12 or has it still been resetting.
    you can email the mods  by completing the form http://bt.custhelp.com/app/contact_email/c/4951
    may take a few days for the mods to get back to you.
    it would help your case if you psot you adsl stats showiing your stable connection
    If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • HT4191 How do I get to "When prompted, select Delete Notes to remove the duplicates from the device."?  I can't get to this!

    I have duplicate Notes on my iphone 4 (upgraded to iOS 5.1.1)  I have followed your instructions to remove the duplicates.  How do I get "select Detete Notes" to appear on my Mac?  I have connected my phone to my Mac and selected it in iTunes.  I clicked the Info pane and deselected the option to Sync Notes.  THEN WHAT should I do?  How do I get the prompt "Select Delete Notes to remove the duplicates from the device.  (I do want to sync them using the over-the-air feature.)

    I would try the following:
    First sync your phone with iTunes to create a new backup (just in case).  When done, disconnect your phone from your computer.
    Next be sure that all of your Notes are on your mac (Don't proceed any further if they aren't).  If so, turn off iCloud syncing for Notes on your phone go to Settings>iCloud and turning Notes to Off.  When prompted choose to delete the notes from your phone.
    Next, without connecting your phone to your computer, open iTunes and go to iTunes>Preferences, on the Devices tab check "Prevent...from syncing automatically".
    Now connect your phone to your computer, click on the name of your phone when it appears in iTunes on the left sidebar.
    Go to the Info tab and under Other check Sync Notes, then further down under Advanced: Replace information on this iPhone, check Notes.
    Click Apply at the bottom right to sync your phone.  This should sync the Notes from your mac to your phone and you should no longer have duplicate Notes.
    Next, on the Info tab uncheck Sync Notes and click Apply, when prompted select to keep the Notes on your phone (haven't tested this step but I believe you will be given the option to keep them on your phone).
    Now disconnect your phone from your computer and check the Notes on your phone to confirm that they are still there and that you don't have any duplicates.
    Next turn on iCloud syncing on your phone again by going to Settings>iCloud and turning Notes to On.
    On your computer, without connecting your phone, go back to iTunes>Preferences>Devices and uncheck "Prevent…from syncing automatically" to re-enable automatic syncing.
    That should do it.

  • How to use get column name.vi in SQL toolkit 2.0?

    Due to the vi "get column name.vi" paremeters,no table name has connected to the vi. So, I want to ask how to use this vi for gain one column name of a table. Maybe there are some other ways to solve column name getting.
    Thanks.

    Thanks!
    Error 4101 Description:
    Execute SQL - The connection, statement, or query handle you provided is not valid.
    I don't just used the toolkit in a while,now, I am developing a irrigation system. For the table field names defined by users,column names must be known before any select operations. Do you have any other good idea about drawing out the columnname parameters?
    As you know, a valid DSN and table have been also available. The database I used is Access. The bad thing to me is that there is no any text information gotten. And I think, it may be some problems in connection way which I don't find out.
    Really appreciated by your reply.
    Could you give me some example in the aspect?
    Thank you again.

  • How to use Multiple Single Option for selection in the Customer Exit

    Hi,
    How can we handle the multiple single values in the customer exit variable.
    I have a requirement which is as follows -
    Table A fiields -> Field Coach, Partner 2, Relation between PArtner 1 & Partner 2, Valid from, valid to date.
    Table B ->  Service Month, Start Date, End Date.
    Table C -> Billing Date, Execution Partner,cal month /year.
    For the Field coach in TABLE A, multiple Partner 2 are present.
    Report has to be built on Table C.
    User inputs the Service month and Field Coach . User can enter multiple field coach values.
    For the All the Field Coach values entered, corresponding Partner2's have to be found from Table A and to be passed to the Execution Partner in Table C.
    Now if we want to use customer exit variable on the field Execution Partner, how can we handle the Multiple Single selections in the customer exit.
    Thanks,
    Shubham

    Hi,
    While creating the variable you must have to specify multiple value.
    In customer exit
    write code multiple times and append the values.
    For example:
    when 'variable'.
    l_s_range - sign = 'I'.
    l_s_range - OPT = 'EQ.
    l_s_range - LOW = EXECUTION PARTNER 1.
    APPEND L_S_RANGE TO E_T_RANGE.
    l_s_range - sign = 'I'.
    l_s_range - OPT = 'EQ.
    l_s_range - LOW = EXECUTION PARTNER 2.
    APPEND L_S_RANGE TO E_T_RANGE.
    l_s_range - sign = 'I'.
    l_s_range - OPT = 'EQ.
    l_s_range - LOW = EXECUTION PARTNER 3.
    APPEND L_S_RANGE TO E_T_RANGE.
    Regards,
    Ranganath.

  • How to use Field-symbol with dynamic select query

    Can anybody tell me, how to use field-symbols in the dynamic select query.

    FIELD-SYMBOLS <fs> { typing | STRUCTURE struc DEFAULT dobj }.
    1. ... typing
    2. ... STRUCTURE struc DEFAULT dobj
    The FIELD-SYMBOLS statement declares a field symbol <fs>. The name conventions apply to the name fs. The angle brackets of the field symbols indicate the difference to data objects and are obligatory. You can declare field symbols in any procedure and in the global declaration section of an ABAP program, but not in the declaration section of a class or an interface. You can use a field symbol in any operand position in which it is visible and which match the typing defined using typing.
    After its declaration, a field symbol is initial - that is, it does not reference a memory area. You have to assign a memory area to it (normally using the ASSIGN statement) before you can use it as an operand. Otherwise an exception will be triggered.
    eg.
    FIELD-SYMBOLS <fs> TYPE ANY.
    DATA: BEGIN OF line,
            string1(10) VALUE '0123456789',
            string2(10) VALUE 'abcdefghij',
          END OF line.
    WRITE / line-string1+5.
    ASSIGN line-string1+5(*) TO <fs>.
    WRITE / <fs>.
    output:
    56789
    56789
    reward if helpful
    anju

  • How to "use this mailbox for"....in 10.8

    I am trying to designate a different mailbox for trash. However, prior posts which said to create the "new"  mailbox, select it , and then use the above mentioned menu selection do not appear to work in 10.8. All the selections for this menu item (including "using  this mailbox for trash" are grayed out and not selectable).
    Any thoughts?????

    I am on office 365, and these options are greyed out. IMAP doesn't seem to be an option. Any advice? I really prefer mac mail app to outlook, but being able to access my sent mail is also fairly crucial. thanks!!

  • How to use get() method of hashmap in jsp

    Hi,
    Iam using hashMap in action form from which I want to retrieve the value by giving the key in jsp page.
    ex: HashMap m = new HashMap();
    m.add("key", "value");
    String v = m.get("key");
    I want to know how implement m.get("key") in jsp without doing iteration.
    Thanks & Regards,
    Nasrin.N

    Hi
    First of all I would say that there is no "add" method for Hashmap, its put
    secondly try this
    <bean:write property="map_key" name="mapSetterGetter" />

  • How to use MODIF ID at a SELECTION-SCREEN

    Hello,
    how can use a SELECTION-SCREEN block with MODIF ID? My SELECTION-SCREEN definition looks like the example below and I want to combine it with a MODIF ID - how can I do this?
    SELECTION-SCREEN BEGIN OF BLOCK par3 WITH FRAME TITLE text-003.
    PARAMETERS:    p_pfadn  LIKE rlgrap-filename
                   DEFAULT    '/home/dsbftp/due_test/konditionen_avs3.txt'.
    SELECTION-SCREEN SKIP 1.
    PARAMETERS:    p_trans  TYPE tcode DEFAULT 'JC03',
                   p_appl   TYPE kappl DEFAULT 'J0'.
    SELECTION-SCREEN END OF BLOCK par3.
    thx

    Hi Mike,
    To modify the appearance of an input field on the selection screen, you must assign the parameter to a modification group as follows:
    PARAMETERS <p> ...... MODIF ID <key> ......
    The name of modification group <key> should be a three-character variable name without quotation marks.
    The MODIF ID addition always assigns <key> to the SCREEN-GROUP1 column of internal table SCREEN.
    Parameters assigned to a modification group can be processed as an entire group with the LOOP AT SCREEN and MODIFY SCREEN statements during the AT SELECTION-SCREEN OUTPUT event.
    You can do the following modifications to the selection screen elements:
    1) REQUIRED: When you set REQUIRED = 1, a field that is ready for input is made mandatory
    2) INPUT: When you set INPUT = 1,  Ready for input, even if Input is not set statically.
    3) OUTPUT: When you set OUTPUT = 1, Field is for display only
    4) INTENSIFIED: When you set OUTPUT = 1, Field is highlighted
    4) INVISIBLE: When you set INVISIBLE = 1, Screen field is not displayed, regardless of the static attributes.
    5) ACTIVE: When you set ACTIVE = 1, At the beginning of the PBO, ACTIVE is always set to 1, regardless of the static attribute settings. Setting ACTIVE to 0 automatically sets INPUT = 0, OUTPUT = 0, and INVISIBLE = 1. 
    Here is the sample code:
    REPORT modif_example.
    PARAMETERS: FIELD1(10) MODIF ID FL1,
                FIELD2(12) MODIF ID FL2,
                FIELD3(15) MODIF ID FL3,
                FIELD4(20) MODIF ID FL3.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
      IF SCREEN-GROUP1 = 'FL1'.
        SCREEN-INPUT = '1'.
        MODIFY SCREEN.
        CONTINUE.
      ENDIF.
      IF SCREEN-GROUP1 = 'FL2'.
        SCREEN-INPUT = '0'.
        MODIFY SCREEN.
        CONTINUE.
      ENDIF.
      IF SCREEN-GROUP1 = 'FL3'.
        SCREEN-REQUIRED = '1'.
        MODIFY SCREEN.
        CONTINUE.
      ENDIF.
    ENDLOOP.
    Hope it helps.
    Regards,
    Neeraj Gupta

Maybe you are looking for

  • Problem using a conditional suppress in a cross-tab ?

    is there a problem using a conditional suppress in a cross-tab on a row  or summarized field  in crystal XI? I am using the following conditional suppress on a summarized field and its rows          If {@SortCode}=4 then true; Sortcode is a group sor

  • BOSSY STACKED CANVAS

    I have a simple form with two canvases, one content and one stacked. When I run the form, the stocked canvas always displays first despite having the property 'display on entry' set to 'no'. I have only encountered this problem having converted the f

  • E 63 FACEBOOK

    I am having a problem with the Facebook application.Whenever I type the username and password and then try to log in,I get a message that they don't match.What could be the cause? Nokia E63-1, RM-437, 510.21.010 Nokia C5-00.2,RM-745,091.002

  • I lost my i pad while in my tour how to protect my content in i pad

    i lost my i pad while in my tour how to protect content in i pad

  • How to create a sample from a target group

    Hi experts: When I create a target group I want to create a sub target group of this. (a sample) The objective is to test a marketing campaign with a sample, according of the results we decide to make the real marketing campaign with all the members