Office 365 deleting residual distibution groups

I am experiencing a dilemma and hoping one of you may had experience this issue before.

Currently, I notice that there are leftover distribution groups in office 365 after they have been completely deleted from Active Directory. I can see these distribution groups in office 365 admin console.

Dirsync is currently being used in the domain and has been working great, but for whatever reason several distribution groups were not deleted from office 365 when they were deleted from Active Directory.

I have tried to run 'Remove-DistributionGroup' in powershell and I am unsucessful. The following error comes up: The action 'Remove-DistributionGroup', 'Identity', can't be performed on the object '' because the object
is being synchronized from your on-premises organization. This action should be performed on the object in your on-premises organization.


Obviously it does not exist in Active Directory anymore but still exists in office 365. I do not want to disable DirSync in order to delete these ghost distribution groups.

I have administrator rights in office 365 and the domain, I can add / remove permissions, I can change UPN, etc.

I have also tried to delete these ghost distribution groups from the admin console in office 365 and I receive the same error as when I try to delete them with powershell.

Is there a way to disable dirsync for one item only? or is there any other way I might be able to delete these distribution groups which are no longer in use, but still show up in office 365 only?

Thank you, your comments and help are appreciated.
LVL 1
EDIE_ITAsked:
Who is Participating?
 
EDIE_ITConnect With a Mentor Author Commented:
There is no Get-MsolDistributionGroup command, only Get-DistributionGroup.

I called Microsoft and they said that the only way to remove these ghost distribution groups, would be to disable DirSync. I did not want to disable it since it takes 72 hours to disable and 24 hours to enable again, this is very incovenient.

I don't know, I might have to ponder about this one. Maybe I would just have to create completely new distribution groups instead. There is no real solution but to disable DirSync, it seems.
0
 
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
0
 
EDIE_ITAuthor Commented:
I tried it and does not work. After all it is a distribution group that one I am trying to get rid off in office 365, not a user. Also, I am not trying to retrieve any deleted users. I tried also 'msol-group' without any success.
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
Commonly used PowerShell scripts
https://eastridge.zendesk.com/entries/21573608-commonly-used-powershell-scripts

FIRST:  $Cred = Get-Credential
SECOND:  $Session = new-pssession -configurationname microsoft.exchange -connectionuri https://ps.outlook.com/powershell/ -credential $cred -authentication basic -allowredirection
THIRD:  set-executionpolicy remotesigned
FOURTH:     import-pssession $session

I guess you first have to run these commands and then proceed.

- Rancy
0
 
EDIE_ITAuthor Commented:
Rancy, I do not have a problem connecting to Office365 or Msolonline, I can already execute any command and it works such as changing UPN, adding mailbox permissions, etc. What I am having issues is with these ghost distribution groups which they do not longer exists in AD, but do not want to dissapear from Office 365 Admin Console
0
 
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
Ohk what i was thinking is that Instead of Mailbox\User we can provide DistributionGroup

First run the command and check if you get the information for the DL's you have concerns with
Get-MsolDistributionGroup -ReturnDeletedDistributionGroup

- Rancy
0
 
Manpreet SIngh KhatraSolutions Architect, Project LeadCommented:
I called Microsoft and they said that the only way to remove these ghost distribution groups, would be to disable DirSync. I did not want to disable it since it takes 72 hours to disable and 24 hours to enable again, this is very incovenient - Agree and also that MS should have something like they have for Mailbox :( Agrrrrr

Disable and Enable is almost 3-4 days and can only be done if you have a Long weekend.

- Rancy
0
 
EDIE_ITAuthor Commented:
Answered own question.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.