Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Dec 2009
    Location
    Columbus, OH
    Posts
    66
    Thanks
    12
    Thanked 5 Times in 4 Posts

    Running Exchange 2007 command for multiple mailboxes

    My company recently had an issue with our old AD/Exchange 2003 server and had to restore from a backup which turned out to be quite a project. We also run Exchange 2007 on another server and had about half the company moved to the new server when this happened. We restored the old server and moved all the mailboxes to the new server leaving AD on the old server. Now when people try to access their mailbox using OWA they get an error that the mailbox is not accessable. The solution is to run the following commands from the command line for each mailbox.

    Get-Mailbox <User_Name>| format-list ExchangeVersion

    Set-Mailbox <User_Name> -ApplyMandatoryProperties

    Since we're dealing with 159 mailboxes is there any way to make this do all of them at once?

    Any help would be appreciated.

  2. #2
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,203
    Thanks
    49
    Thanked 989 Times in 919 Posts
    The first command only checks what version they are using. I assume you want to use the output of that to determine which ones need to be moved (have policy applied)? Something like this in Powershell should work.
    Note: I haven't used the correct version name because I don't have a box to test. Can you provide the output of a get-mailbox command so we can check?
    Note 2: You probably need to test if the user is a real user as well, not an alias or public address.

    cheers, Paul

    $Exusers = get-mailbox *
    foreach ($user in $Exusers) {
    if ($user.ExchangeVersion = 2003) {Set-Mailbox $user -ApplyMandatoryProperties}
    }

  3. The Following 2 Users Say Thank You to Paul T For This Useful Post:

    Chris the Computin' Guru (2014-12-04),rmallen07 (2014-12-02)

  4. #3
    Star Lounger
    Join Date
    Dec 2009
    Location
    Columbus, OH
    Posts
    66
    Thanks
    12
    Thanked 5 Times in 4 Posts
    Thank you so much Paul. Your script worked like a champ. We were even able to modify it to assign mailbox rights en-mass to all the mailboxes. You've always been a great help to me and I appreciate it more than you know.

  5. #4
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,203
    Thanks
    49
    Thanked 989 Times in 919 Posts
    Glad to be of service.

    cheers, Paul

  6. #5
    New Lounger
    Join Date
    Mar 2014
    Posts
    21
    Thanks
    1
    Thanked 1 Time in 1 Post
    @rmallen07 - I strongly recommend you pick up a book on PowerShell, or better yet, take class (online classes are good for PowerShell). It will elevate your understanding of what is happening when you run any Exchange commands, and help you to build more complex commands to work on multiple mailboxes. If your organization is growing, or if you take greater advantage of Exchange features, this new skill will come into play quite often.

    A nice added benefit is that PowerShell can be used for Active Directory administration, Windows server and workstation administration, SQL administration....the list goes on. The basic concepts are shared across each type of administration, with specific commands used for specific administrative tasks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •