locked
Mailbox Issue with punctuation marks in distinguishedName for users RRS feed

  • Question

  • Hi All,

    I am facing an issue with below powershell script when the user's distinguishedName has a punctuation mark.

    Mailbox creation seems to be failing for users who have apostrophes(below example user) in their names. However, mailbox creation works perfectly for users who doesn't have punctuation marks in them.

    I took a test user who had apostrophe in the name, below is the script I am  powershell window and it seems to be failing.

    Enable-Mailbox -Identity 'CN=Catherine O'Shea,OU=Users,OU=CASUAL,DC=bth-pp,DC=catholic,DC=edu,DC=au' -Database 'CN=Mailbox Database,CN=First Storage Group,CN=InformationStore,CN=BAT-GS-IDM-EPP1,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=CEO PreProd,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=bth-pp,DC=catholic,DC=edu,DC=au' -DomainController 'BAT-GS-IDM-APP1'


    Googling the error suggests that it is because the user have apostrophe in the name and suggests to insert a powershell escape character in to the above script. I tried even the below command and it seems to be failing too. 

    Enable-Mailbox -Identity 'CN=Catherine O`'Shea,OU=Users,OU=CASUAL,DC=bth-pp,DC=catholic,DC=edu,DC=au' -Database 'CN=Mailbox Database,CN=First Storage Group,CN=InformationStore,CN=BAT-GS-IDM-EPP1,CN=Servers,CN=Exchange Administrative Group (FYDIBOHF23SPDLT),CN=Administrative Groups,CN=CEO PreProd,CN=Microsoft Exchange,CN=Services,CN=Configuration,DC=bth-pp,DC=catholic,DC=edu,DC=au' -DomainController 'BAT-GS-IDM-APP1'


    Just wanted to check if anyone faced the above issue and if so, how was it rectified
    We are using Exchange 2007 and AD server - windows 2008 R2. Powershell version installed is 2.0.

    Advice appreciated!!

    Friday, September 28, 2012 7:06 AM

All replies

  • Have you tried with userprincipalName or alias of the user with enable-mailbox cmdlet?

    Else we can try this: Run the command Get-User "Catherine O`'Shea" | Enable-Mailbox -Database "BAT-GS-IDM-EPP1\First Storage Group\Mailbox Database"

    If this doesn't work we can then try the below:

    Get-User "Catherine O`'Shea" | Fl Name,samAccountName,UserPrincipalName

    We can try the enable-Mailbox with either SamAccountName (or) UserPrincipalName and it should work seamless.

    ______________________________________________________

    Pavan ~ ( Exchange Support | 2003/2007/2010) ~Mark this if Helpful
    • Proposed as answer by PK M Saturday, October 6, 2012 2:22 AM
    Friday, September 28, 2012 7:55 AM
  • What is the exact error you get when you run the script to enable mailbox (with punctuation marks)?

    Thanks,

    Evan


    Evan Liu

    TechNet Community Support

    Monday, October 1, 2012 6:54 AM
    Moderator