[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3739
  • Last Modified:

Cannot remove duplicate user mailbox from Office 365 Exchange

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
KTM200
Asked:
KTM200
  • 13
  • 10
2 Solutions
 
Peter HutchisonSenior Network Systems SpecialistCommented:
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
 
comfortjeaniusCommented:
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
 
KTM200Author Commented:
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
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
comfortjeaniusCommented:
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
 
KTM200Author Commented:
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
 
comfortjeaniusCommented:
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
 
KTM200Author Commented:
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
 
comfortjeaniusCommented:
Yeah I was trying to tell you to ignore that.  Did you remove the license from the account?
0
 
KTM200Author Commented:
Admin Screen #1
0
 
KTM200Author Commented:
Admin Screen #2
0
 
KTM200Author Commented:
Admin Screen #3
0
 
KTM200Author Commented:
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
 
comfortjeaniusCommented:
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
 
KTM200Author Commented:
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
 
comfortjeaniusCommented:
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
 
KTM200Author Commented:
I did try that but I get an error that 'Get-Mailbox' is not legitimate command, or something to that effect
0
 
comfortjeaniusCommented:
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
 
KTM200Author Commented:
Yes i am using the Azure Powershell, this is what i get when i try these commands:

Screenshot Powershell
0
 
KTM200Author Commented:
Can anyone tell me why the Azure Powershell keep rejecting these commands, this is hugely frustrating

Thanks
0
 
comfortjeaniusCommented:
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
 
KTM200Author Commented:
Thanks everyone, however i am now getting this

Screenshot
0
 
comfortjeaniusCommented:
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
 
KTM200Author Commented:
Thank you all for your assistance, problem is resolved

This site is awesome
0
 
comfortjeaniusCommented:
Glad to be of assistance!!!!

@(^_^)@
0

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

  • 13
  • 10
Tackle projects and never again get stuck behind a technical roadblock.
Join Now