none
Change default behavior Exchange 2010 - MailboxSentItemsConfiguration not working/running. RRS feed

  • General discussion

  • Need to change the default behavior for shared mailboxes on Exchange 2010.

    Used this to attempt to collect and modify but won't run:

    $mbx = get-mailbox | where {$_.OrganizationalUnit -match "OURORG.local/All Users/These Accounts"}

    Foreach($m in $mbx) {Set-MailboxSentItemsConfiguration alias -SendAsItemsCopiedTo SenderAndFrom -SendOnBehalfOfItemsCopiedTo SenderAndFrom

    }

    Any ideas where I pooched this?

    And how should I get this into the Exchange Powershell?

    • Changed type Bill_Stewart Thursday, September 5, 2019 9:32 PM
    • Moved by Bill_Stewart Thursday, September 5, 2019 9:32 PM Abandoned
    Monday, June 3, 2019 3:41 PM

All replies

  • You didn't share what result you're getting.

    You might try -like instead of -match.


    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
    Celebrating 20 years of providing Exchange peer support!

    Monday, June 3, 2019 6:02 PM
  • You have not set the mailbox alias for the loop.


    \_(ツ)_/

    Monday, June 3, 2019 6:11 PM
  • I'll try the -like.

    Though I do have the exact OU I wish to use - .../Service Acounts

    Monday, June 3, 2019 6:27 PM
  • Bit lost  on the setting alias for loop.

    I wish it to be all mailboxes in that OU.

    They're shared and when originally created the send behavior put sent items into delegated users and not that actual shared mailbox sent item folder(s)

    Monday, June 3, 2019 6:29 PM
  • Bit lost  on the setting alias for loop.

    I wish it to be all mailboxes in that OU.

    They're shared and when originally created the send behavior put sent items into delegated users and not that actual shared mailbox sent item folder(s)

    But you are not setting the mailbox.  You are setting the same mailbox on every pass through the loop.

    If you format and post your code correctly you will see your mistake.


    \_(ツ)_/

    Monday, June 3, 2019 6:37 PM
  • Is this more correct?
    $mbx = get-mailbox | where {$_.OrganizationalUnit -match "mycompany.local/All Users/Service Accounts"}

    Foreach ($m in $mbx) {
    Set-MailboxSentItemsConfiguration $mbx -SendAsItemsCopiedTo SenderAndFrom -SendOnBehalfOfItemsCopiedTo SenderAndFrom
    }

    Or should I have it:

    $mbxs = Get-Mailbox ....

    foreach ($mbx in $mbxs) { ....


    Monday, June 3, 2019 7:31 PM
  • help about_foreach

    Always read the documentation for every command and code element that you don't understand.


    \_(ツ)_/

    Monday, June 3, 2019 7:34 PM
  • Ya, guess I'm a boob or something but still not seeing where I went wrong after RTFing it.
    Monday, June 3, 2019 8:17 PM
  • You are not using the $m variable inside the loop.


    -- Bill Stewart [Bill_Stewart]

    Monday, June 3, 2019 8:24 PM
  • Think about what the words "for each x in y" means.  It is in English and has a meaning.  Why would these words exisit in a programming language.

    If you actually read the whole help I posted and read it carefully it will clear up a great amount of your understanding of programming and PowerShell. 

    The fist rule of technology "THINK!"  - Use your brain.  It is designed to understand these things.


    \_(ツ)_/

    Monday, June 3, 2019 8:28 PM
  • Is this more correct?
    $mbx = get-mailbox | where {$_.OrganizationalUnit -match "mycompany.local/All Users/Service Accounts"}

    Foreach ($m in $mbx) {
    Set-MailboxSentItemsConfiguration $mbx -SendAsItemsCopiedTo SenderAndFrom -SendOnBehalfOfItemsCopiedTo SenderAndFrom
    }

    Or should I have it:

    $mbxs = Get-Mailbox ....

    foreach ($mbx in $mbxs) { ....


    No, this would be more like it.


    $mbx = get-mailbox | where {$_.OrganizationalUnit -like "mycompany.local/All Users/Service Accounts"}
    Foreach ($m in $mbx) {
      $m | Set-MailboxSentItemsConfiguration -SendAsItemsCopiedTo SenderAndFrom -SendOnBehalfOfItemsCopiedTo SenderAndFrom
    }


    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."
    Celebrating 20 years of providing Exchange peer support!




    Monday, June 3, 2019 9:50 PM