Convert an Exchange distribution group to an Office 365 Group

This script is intended to demonstrate how an Exchange Online distribution group can be converted to an Office 365 Group. Only mailboxes are supported in Office 365 Groups, so these are the only recipients moved across. The settings of the distribution group are moved as is its

 
 
 
 
 
5 Star
(3)
3,838 times
Add to favorites
Office 365
5/13/2015
E-mail Twitter del.icio.us Digg Facebook
  • not a bug, per se
    1 Posts | Last post October 19, 2017
    • I notice the script assumes an authenticated O365 session. It never checks for one or prompts to create one.
      Just saying'...
  • Outlook Autocomplete NDRs
    2 Posts | Last post November 07, 2015
    • Tony,
      
      Is it possible that Outlook users would have NDRs because of "Outlook autocomplete" cache issues with this conversion?
    • I guess that's possible. You always run the risk that this might happen when addresses change...
  • Errors running the script
    3 Posts | Last post August 25, 2015
    • When I run the script it creates the group but always creates a public group and displays the following errors
      
      
      PS C:\temp> .\ConvertDLtoO365Group.ps1 first
      Collecting some information...
      
       
      Now ready to convert the Distribution Group first@test.com to a new Office 365 Group
      The Alias and email address for the Distribution Group will be switched to the Office 365 Group
      The new alias for the Distribution Group will be firstbirthdaywellington-convert and its email address will be firstbirthdaywellington-Convert@test.com
      The Distribution Group will be renamed to first@test.com (Converted to O365 Group) and it will be hidden from the GAL
      1 recipients will be transferred to the new Office 365 Group
      2 manager(s) for the first@test.com group will be transferred
       
      Do you want to proceed with the conversion?: y
      Processing...
      Creating new Office 365 Group: first@test.com    This might take a moment...
      
      Name                      Alias                ServerName       AccessType                                                                                               
      ----                      -----                ----------       ----------                                                                                               
      firstbirthdaywellingto... firstbirthdaywell... bn3pr0501mb1586  Public                                                                                                   
      WARNING: The command completed successfully but no settings of 'first@test.com_a8707573cf' have been modified.
      Adding members to the new Office 365 Group
      Adding managers
      The operation couldn't be performed because object 'migrationapp' couldn't be found 
      
    • Cannot bind argument to parameter 'Links' because it is null.
          + CategoryInfo          : InvalidData: (:) [Add-UnifiedGroupLinks], ParameterBindingValidationException
          + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Add-UnifiedGroupLinks
          + PSComputerName        : outlook.office365.com
       
      The operation couldn't be performed because object 'migrationapp' couldn't be found on 'DM2PR05A003DC06.NAMPR05A003.prod.outlook.com'.
          + CategoryInfo          : NotSpecified: (:) [Get-Recipient], ManagementObjectNotFoundException
          + FullyQualifiedErrorId : [Server=DM2PR05MB719,RequestId=291fc7b0-f03f-4d9b-be87-f5339cc587fc,TimeStamp=25/08/2015 5:25:14 a.m.] [FailureCategory=Cmdlet-ManagementO 
         bjectNotFoundException] EBE3CA12,Microsoft.Exchange.Management.RecipientTasks.GetRecipient
          + PSComputerName        : outlook.office365.com
       
      Cannot bind argument to parameter 'Links' because it is null.
          + CategoryInfo          : InvalidData: (:) [Add-UnifiedGroupLinks], ParameterBindingValidationException
          + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Add-UnifiedGroupLinks
          + PSComputerName        : outlook.office365.com
    • I don't have a good answer as to why the script isn't working. All I can suggest is that you extract pieces of the code to determine exactly what line is causing the problem. It seems to be with Add-UnifiedGroupLinks, which is where the membership of the new group is built, but I don't know what the references to migrationapp are...
  • Hybrid Configuration Question
    2 Posts | Last post August 08, 2015
    • So will this script work in a situation with a Hybrid and FIM deployed? If so does this some how get around forcing a FIM sync? 
    • The script has nothing to do with directory synchronization. It converts a standard DG to an Office 365 Group. You need AADConnect to synchronize the new Group object back to an on-premises environment, where it shows up as a DG.
  • Receiving a lot of errors when running the PS
    2 Posts | Last post May 29, 2015
    • Hey Tony, 
      
      This PS sounds like the answers to my prayers, but I'ts not running right.
      
      So I connected my PS to O365 via:
      $UserCredential = Get-Credential
      $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
      Import-PSSession $Session
      
      When starting the script I get the following:
      The action 'Set-DistributionGroup', 'Alias', can't be performed on the object 'AllBuilds' because the object is being
      synchronized from your on-premises organization. This action should be performed on the object in your on-premises
      organization.
          + CategoryInfo          : NotSpecified: (:) [Set-DistributionGroup], RuleValidationException
          + FullyQualifiedErrorId : [Server=BY1PR12MB0503,RequestId=f4fc1e60-8159-4131-90c0-293f15543b44,TimeStamp=5/21/2015
          1:49:28 AM] [FailureCategory=Cmdlet-RuleValidationException] 54FE25C2,Microsoft.Exchange.Management.RecipientTask
        s.SetDistributionGroup
          + PSComputerName        : outlook.office365.com
      
      
      Followed by many other error messages.
      
      What am I doing wrong?
      
      Can you help?
      
      Frank
    • Aha... That's because any object created in a hybrid environment has to be managed in the place where it was created. You created this DL on-premises and so it has to be managed on-premises. You could extract the Set-Distribution group commands from the script and execute them in a PowerShell session that is connected to an on-prem Exchange server and that will do the trick.