Solved

Cannot remove duplicate user mailbox from Office 365 Exchange

Posted on 2013-11-13
24
3,127 Views
Last Modified: 2013-11-15
HI All, i setup my Office 365 with this account:

tyrone@trextechnologies.co.za

This was the main admin account and a mailbox was setup for it etc...

I noticed that emails were bouncing back when sending to this address, decided to create a new admin account and deleted this one, i was going to recreate it.

The user account is gone but it shows "tyrone@trextechnologies.co.za" twice under the exchange mailboxes, i cannot edit the email address and therefore cannot create a new user as it says this email address already exists.

Been on a few sites and tried to remove it via Powershell but without any luck.

I am desperate to get this mailbox removed as i need to recreate this user account as i'm not getting any emails through

Please help
0
Comment
Question by:KTM200
  • 13
  • 10
24 Comments
 
LVL 18

Expert Comment

by:Peter Hutchison
ID: 39645230
Run the following cmdlets to see what comes up:
Get-Mailbox tyrone
Get-Mailuser tyrone
 Get-MsolUser -USer tyrone@trextechnologies.co.za
Get-User tyrone

A useful trick, is to change or remove and then re-apply the O365 License to the account to see if that clears it.
0
 
LVL 14

Expert Comment

by:comfortjeanius
ID: 39645266
Is the user in the recycle bin and did you try to delete the user:

Get-MsolUser -ReturnDeletedUsers -Searchstring tyrone@trextechnologies.co.za | select UserPrincipalName, OjectId


then

Remove-MsolUser -RemoveFromRecycleBin -ObjectId <objected number>

Note without < >.

See what happens after you delete it; does it still show duplicate email addresses

Get-Mailbox -Identity *tyrone* | FL *DisplayName

Plus do you have DirSync Enabled?
0
 

Author Comment

by:KTM200
ID: 39645598
Nope, i ran some commands which removed it from the deleted items, now its just the mailbox listing.

Its also strange that its listed twice??
0
 
LVL 14

Expert Comment

by:comfortjeanius
ID: 39645684
Did you try to remove the mailbox itself?

Remove-Mailbox "displayname"

example: Remove-Mailbox "John Doe"


When you go to the Admin Exchange Center ------>mailboxes
 Are you able to delete the duplicate mailbox from here.
0
 

Author Comment

by:KTM200
ID: 39645883
Nope, there is no option in the Exchange Admin to delete a mailbox, i also find this frustrating, why would there be no option to delete a mailbox
0
 
LVL 14

Expert Comment

by:comfortjeanius
ID: 39645915
Are you authenticating with an account that is a Global Admin?

When you select Users and Groups ------> click on the filter icon  -----> select the Global Admins and see what users are in this group.


Plus when you click the three dots ...  You do not see anything the allow you to delete the mailbox.

Location of the Delete Mailbox function
0
 

Author Comment

by:KTM200
ID: 39646005
Yes i am logging on with Global Admin rights, i do see the 3 dots and drop down menu as per your picture, but it shows no entries under deleted mailboxes but the duplicate mailboxes for: tyrone@trextechnologies.co.za are listed under "Mailboxes"

I cant find an option to delete them
0
 
LVL 14

Expert Comment

by:comfortjeanius
ID: 39646011
Yeah I was trying to tell you to ignore that.  Did you remove the license from the account?
0
 

Author Comment

by:KTM200
ID: 39646015
Admin Screen #1
0
 

Author Comment

by:KTM200
ID: 39646019
Admin Screen #2
0
 

Author Comment

by:KTM200
ID: 39646025
Admin Screen #3
0
 

Author Comment

by:KTM200
ID: 39646030
As you can see above, the duplicate mailbox entry, i cannot edit either of them as i get an error which seems to suggest that they are connected somehow and wont let me make changes to them because of this link, there are no entries under Deleted mailboxes
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 14

Expert Comment

by:comfortjeanius
ID: 39646041
When you go to User & groups and enter the account and hit enter.  Select one of the user and the delete option will be on the right.  You will be able to delete this account as long as it is not syncing with active directory.

User Account
In my case I have Dirsync enable so I am not able to delete in Office 365 admin center
0
 

Author Comment

by:KTM200
ID: 39646055
Thank you but the account has already been deleted from the "Users & Groups" screen, my problem is that there are these duplicate Mailboxes remaining, if i try re-create the user account, tyrone@trextechnologies.co.za, it add the user but show an error state after about 5 minutes stating that this account's are incorrect as there is already an object with the email address, this obviously being the 2 mailbox entries. Basically i need to remove these 2 "mailboxes" before i can re-create the user, this is the problem as the mailboxes cant be deleted or edited
0
 
LVL 14

Assisted Solution

by:comfortjeanius
comfortjeanius earned 500 total points
ID: 39646110
When you run in the Azure Powershell:

Get-Mailbox *tyrone* |fl

or

Get-Mailbox tyrone@trextechnologies.co.za |fl

If the output is too long then:

Get-Mailbox tyrone@trextechnologies.co.za |fl  >> Test.txt

You will have to scroll to locate the SamAccountName

Remove-Mailbox <SamAccountName> without the brackets

Have you tried this?
0
 

Author Comment

by:KTM200
ID: 39646124
I did try that but I get an error that 'Get-Mailbox' is not legitimate command, or something to that effect
0
 
LVL 14

Expert Comment

by:comfortjeanius
ID: 39646179
Are you using these commands in the Azure Powershell to authenticate to the server?

$LiveCred = Get-Credential


$Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection

Import-PSSession $Session
0
 

Author Comment

by:KTM200
ID: 39647119
Yes i am using the Azure Powershell, this is what i get when i try these commands:

Screenshot Powershell
0
 

Author Comment

by:KTM200
ID: 39647120
Can anyone tell me why the Azure Powershell keep rejecting these commands, this is hugely frustrating

Thanks
0
 
LVL 14

Expert Comment

by:comfortjeanius
ID: 39647713
You have to finish performing the commands listed below

$LiveCred = Get-Credential


$Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection

Import-PSSession $Session


You just stop at $LiveCred = Get-Credential

I was able to recreate it
Not completing the the commands gives you this error for Get-Mailbox
Once I authenticate and import the session is should look like this

Completed commands
Now when you perform Get-Mailbox you should get a line of information like this...
Get-Mailbox command

To properly disconnect use this command

Remove-PSSession $Session
0
 

Author Comment

by:KTM200
ID: 39647892
Thanks everyone, however i am now getting this

Screenshot
0
 
LVL 14

Accepted Solution

by:
comfortjeanius earned 500 total points
ID: 39648181
According to this link Got error when run Import-PSSession $Session in PowerShell Make sure you are running Powershell "Run as Administrator"

If it fails with an error message we may need to set the Execution policy to allow running remote PowerShell scripts. Run Get-ExecutionPolicy. If the value returned is anything other than RemoteSigned, you need to change the value to RemoteSigned by running Set-ExecutionPolicy RemoteSigned


Lets try these commands starting with Set-ExecutionPolicy RemoteSigned

Set-ExecutionPolicy RemoteSigned

$LiveCred = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection

Import-PSSession $Session

Open in new window


Then try the Get-Mailbox command
0
 

Author Closing Comment

by:KTM200
ID: 39650429
Thank you all for your assistance, problem is resolved

This site is awesome
0
 
LVL 14

Expert Comment

by:comfortjeanius
ID: 39651554
Glad to be of assistance!!!!

@(^_^)@
0

Featured Post

Do email signature updates give you a headache?

Constantly trying to correctly format email signatures? Spending all of your time at every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today!

Join & Write a Comment

Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
Find out what the Office 365 disclaimer function is, why you would use it and its limited ability to create Office 365 signatures.
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
how to add IIS SMTP to handle application/Scanner relays into office 365.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now