none
The specified mailbox isn't unique - Office 365 RRS feed

  • Question

  • Hi 

    I'm trying to set the time zone and language for all users with a specific attribute in the city field, but im getting an error:

    The specified mailbox "jsmith"  isn't unique.
        + CategoryInfo          : NotSpecified: (:) [Set-MailboxRegionalConfiguration], ManagementObjectAmbiguousException
        + FullyQualifiedErrorId : [Server=DB4PR03MB506,RequestId=4a7051f3-49e5-40f2-9c03-c236ad32b7a6,TimeStamp=17/07/2015 11:17:55] [FailureCategory=Cmdlet-ManagementObjectAmbiguousEx 
       ception] F5DFAB59,Microsoft.Exchange.Management.StoreTasks.SetMailboxRegionalConfiguration
        + PSComputerName        : pod51047psh.outlook.com

    it fails for 30 users, whose name isn't unique, how can I make the script use a unique part of the mail box 

    my script is as follows

    $UnProvisionedUsers = get-user -filter {(city -ne "provisioned")} 

    $UnProvisionedUsers | %{Set-MailboxRegionalConfiguration $_.Identity -TimeZone "GMT Standard Time" –Language 2057} 

    Friday, July 17, 2015 11:24 AM

Answers

  • You can try using $_.DistinguishedName instead of $_.Identity.
    • Marked as answer by Mtdmitchell2 Friday, July 17, 2015 12:09 PM
    Friday, July 17, 2015 12:00 PM
  • Sorry - I missed that you were using Get-User.  THis is how to prevent that:

    $UnProvisionedUsers = get-user -filter {(city -ne "provisioned")} |Get-Mailbox -ea 0

    I suppress the errors to skip users without mailboxes.  This should also eliminate disabled users.


    \_(ツ)_/

    • Marked as answer by Mtdmitchell2 Friday, July 17, 2015 12:28 PM
    Friday, July 17, 2015 12:16 PM

All replies

  • $UnProvisionedUsers | %{$_ | Set-MailboxRegionalConfiguration  -TimeZone "GMT Standard Time" –Language 2057} 

    \_(ツ)_/

    Friday, July 17, 2015 11:49 AM
  • Thanks but No luck , still the same issue

    PS C:\> $UnProvisionedUsers | %{$_ | Set-MailboxRegionalConfiguration  -TimeZone "GMT Standard Time" –Language 2057} 

    The specified mailbox "Jbrown"  isn't unique.
        + CategoryInfo          : NotSpecified: (:) [Set-MailboxRegionalConfiguration], ManagementObjectAmbiguousException
        + FullyQualifiedErrorId : [Server=DB4PR03MB506,RequestId=07b3fb13-b667-480e-b23d-7c84550c901c,TimeStamp=17/07/2015 11:51:04] [FailureCategory=Cmdlet-ManagementObjectAm 
       biguousException] 5FF63B4B,Microsoft.Exchange.Management.StoreTasks.SetMailboxRegionalConfiguration
        + PSComputerName        : pod51047psh.outlook.com

    Friday, July 17, 2015 11:52 AM
  • You can try using $_.DistinguishedName instead of $_.Identity.
    • Marked as answer by Mtdmitchell2 Friday, July 17, 2015 12:09 PM
    Friday, July 17, 2015 12:00 PM
  • I have no issue with either syntax.  Try contacting O365 support to see if your tenancy has an issue.  Also look closely at what you are returning in the Get.  You cannot set that on system mailboxes and I believe that you can have a disabled mailbox with a duplicate name.


    \_(ツ)_/


    • Edited by jrv Friday, July 17, 2015 12:07 PM
    Friday, July 17, 2015 12:05 PM
  • Thank you Leif-Arne Helland $_.DistinguishedName worked!! 
    Friday, July 17, 2015 12:10 PM
  • Are you hosting multiple mail domains on your system?  If so then alias may not be unique but using the original method should work as it would use the more restrictive identity.

    \_(ツ)_/

    Friday, July 17, 2015 12:13 PM
  • Yes i have multiple domains ( 200+) and yes there are lots of users with same Alias.  $_.DistinguishedName solved the problem for me.
    Friday, July 17, 2015 12:15 PM
  • Sorry - I missed that you were using Get-User.  THis is how to prevent that:

    $UnProvisionedUsers = get-user -filter {(city -ne "provisioned")} |Get-Mailbox -ea 0

    I suppress the errors to skip users without mailboxes.  This should also eliminate disabled users.


    \_(ツ)_/

    • Marked as answer by Mtdmitchell2 Friday, July 17, 2015 12:28 PM
    Friday, July 17, 2015 12:16 PM
  • These users are enabled though with mailboxes, i don't want to skip them
    Friday, July 17, 2015 12:17 PM
  • These users are enabled though with mailboxes, i don't want to skip them

    It does not skip users with mailboxes it just suppresses errors on users without mailboxes like utility accounts and service accounts.

    Either way you do it should work.  I just missed realizing that you might have multiple domains.  Glad yougot it working.

    G.L.


    \_(ツ)_/

    Friday, July 17, 2015 12:26 PM
  • Oh Ok thanks
    Friday, July 17, 2015 12:28 PM