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

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

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.
0
EDIE_IT
Asked:
EDIE_IT
  • 4
  • 4
1 Solution
 
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
 
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
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
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
 
EDIE_ITAuthor 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:
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

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

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