locked
Add mailbox via powershell RRS feed

  • Question

  • Hi,

     

    i've written a gui around powershell to create users and there mailboxes. I first creating the user and after that i make the mailbox. I will run my tool from behind my worstation

    Command:

    enable-Mailbox -Identity OurDomain\PUK -Database "OurExchangeServer\First Storage Group\Mailbox Database"

     

    But the command returns a error:

    Enable-Mailbox : The Name property contains leading or trailing whitespace, which must be
     removed.
    At line:1 char:15
    + enable-Mailbox <<<<  -Identity andreas\PUK -Database "OurExchangeServer\First Storage Group\Mailbo
    x Database"
        + CategoryInfo          : InvalidData: (OurDomain/A...n/Puk P. VanDe :ADObjectId
       ) [Enable-Mailbox], DataValidationException
        + FullyQualifiedErrorId : E7473FB4,Microsoft.Exchange.Management.RecipientTasks.Enab
       leMailbox

    What am i doing wrong i dont get it because i've used this command before to create mailboxes without any problem. What ever i try i cant get it to work anymore :(

     

    Jos

    Friday, March 18, 2011 3:04 PM

Answers

All replies

  • That's by design you need to fix those accounts first, having leading or trailing white space is not rfc compliant.

    How to Remove Spaces From Recipient Aliases by Using the Exchange Management Shell

    http://technet.microsoft.com/en-us/library/bb851499(EXCHG.80).aspx


    James Chong MCITP | EA | EMA; MCSE | M+, S+ Security+, Project+, ITIL msexchangetips.blogspot.com
    • Marked as answer by Mike Crowley Tuesday, March 22, 2011 3:50 AM
    Friday, March 18, 2011 3:22 PM
  • Hi,

     

     

    You could test to enable a single recipient mailbox without space in  alias first. If you can enable his mailbox with your code, It should be the issue.


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Tuesday, March 22, 2011 3:35 AM