<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Microsoft Exchange Archives - Wiredwolf Canada</title>
	<atom:link href="https://catastrophe.wiredwolf.com/category/microsoft-exchange/feed/" rel="self" type="application/rss+xml" />
	<link>https://catastrophe.wiredwolf.com/category/microsoft-exchange/</link>
	<description></description>
	<lastBuildDate>Sat, 27 Apr 2024 01:20:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Office 365 &#8211; Migrating Distribution Groups</title>
		<link>https://catastrophe.wiredwolf.com/office-365-migrating-distribution-groups/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 27 Apr 2024 00:54:48 +0000</pubDate>
				<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[Microsoft Office 365]]></category>
		<category><![CDATA[PowerShell]]></category>
		<guid isPermaLink="false">https://catastrophe.wiredwolf.com/?p=22459</guid>

					<description><![CDATA[<p>Distribution Groups stuck in Active Directory can cause issues after an Exchange migration.   Users can no longer access the management of a Distribution Group in Outlook Synchronized Distribution Groups in Office 365 cannot be modified in Office 365 - as a synchronized object you must update in Active Directory Adding external contacts to a synchronized  [...]</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/office-365-migrating-distribution-groups/">Office 365 &#8211; Migrating Distribution Groups</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Distribution Groups stuck in Active Directory can cause issues after an Exchange migration.&nbsp;&nbsp;</p>
<ul>
<li>Users can no longer access the management of a Distribution Group in Outlook</li>
<li>Synchronized Distribution Groups in Office 365 cannot be modified in Office 365 &#8211; as a synchronized object you must update in Active Directory</li>
<li>Adding external contacts to a synchronized Distribution Group becomes difficult as you cannot synchronize contacts with Azure AD Connect</li>
</ul>
<p>The solution is relatively simple &#8211; convert all Distribution Groups to Cloud objects.</p>
<p>This script was designed to do exactly that.</p>
<blockquote>
<div>
<div>&lt;#</div>
<div>#########################################################################################</div>
<div>##</div>
<div>## Name: &nbsp; &nbsp; &nbsp; &nbsp;DG_Cloud.PS1</div>
<div>##</div>
<div>## Version: &nbsp; &nbsp; 1.0</div>
<div>##</div>
<div>## Description: $ Installs required components for Exchange Online Powershell Management</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$ Creates a &#8220;Working&#8221; folder for Sea to Sky (C:\STS) for backups.</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$ Creates an &#8220;Exports&#8221; folder for the temp files needed to migrate the</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Distribution Lists.</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$ Backs up the Distribution List Names and Attributes to DG_Details_Backup.csv</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$ Backs up the Distribution List Members to DG_Members_Backup.csv</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$ Capable of running mulitple times and retaining existing backups &#8211; creates</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;new backups each time it&#8217;s run if any new groups are detected</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$ Selectively Creates a copy of each Distribution Group called Cloud_$Group</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;that are specifically Distribution Groups and not Mail-Enabled Security</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;groups.</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$ Deletes the selected Distribtuion Groups from Active Directory</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$ Initiates an Azure AD Connect to remove the AD objects from Cloud Environment</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$ Forces wait period of 5 minutes to allow Azure AD to synchronize with Exchange</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$ Completes process by renaming Cloud_$Group back to original name</div>
<div>##</div>
<div>## Usage: &nbsp; &nbsp; &nbsp; Execute script in PowerShell with elevated privileges</div>
<div>##</div>
<div>## Author: Jason Zondag</div>
<div>##</div>
<div>## Disclaimer: &nbsp;Has not been tried in every conceivable environment &#8211; always check the results</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;and fall back on the backups created to recreate the Distribution Groups if</div>
<div>## &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;necessary</div>
<div>##</div>
<div>#########################################################################################</div>
<div>###### ALTERNATIVE CODE FOR MFA LOGIN TO OFFICE 365 &nbsp;####################################</div>
<div>#Connect &amp; Login to ExchangeOnline (MFA)</div>
<div>$getsessions = Get-PSSession | Select-Object -Property State, Name</div>
<div>$isconnected = (@($getsessions) -like &#8216;@{State=Opened; Name=ExchangeOnlineInternalSession*&#8217;).Count -gt 0</div>
<div>If ($isconnected -ne &#8220;True&#8221;) {</div>
<div>Connect-ExchangeOnline</div>
<div>}</div>
<div>#########################################################################################</div>
<div>#&gt;</div>
<div>clear</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div>Write-Host &#8220;!!!!!IMPORTANT!!!!!!&#8221; -ForeGroundColor Red</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div>Write-Host &#8220;!!!!!IMPORTANT!!!!!!&#8221; -ForeGroundColor Red</div>
<div>Write-Host &#8220;YOU MUST RUN THIS SCRIPT FROM THE DOMAIN CONTROLLER THAT IS RUNNING AZURE AD CONNECT&#8221; -ForeGroundColor Red</div>
<div>sleep 5</div>
<div>Write-Host &#8220;IF YOU ARE NOT PLEASE USE CTRL + C TO ESCAPE AND RUN FROM THE APPROPRIATE DOMAIN CONTROLLER&#8221; -ForeGroundColor Red</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div>Write-Host &#8220;It&#8217;s also important to note that this only affects Distribution Lists and not Mail-Enabled&#8221; -ForeGroundColor Green</div>
<div>Write-Host &#8220;Security Groups. &nbsp;Mail-Enabled Security Groups must be handled differently.&#8221; -ForeGroundColor Green</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div>sleep 15</div>
<div>Pause</div>
<div>Write-Host &#8220;Connecting to Exchange Online &#8211; installing all required PowerShell Modules and initiaing a connection&#8221; -ForegroundColor Green</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div># Load PowerShell Modules</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div>Set-ExecutionPolicy RemoteSigned -Force</div>
<div>Import-Module ActiveDirectory</div>
<div>[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12</div>
<div>Install-Module -Name ExchangeOnlineManagement -Force</div>
<div>Import-Module ExchangeOnlineManagement</div>
<div>#Connect &amp; Login to ExchangeOnline (MFA)</div>
<div>$getsession = get-pssession | select-object -Property State | select -expandproperty state</div>
<div>If ($getsession -ne &#8220;Opened&#8221;) {</div>
<div>Connect-ExchangeOnline</div>
<div>}</div>
<div>Write-Host &#8220;Completed&#8221; -ForegroundColor Green</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div>Write-Host</div>
<div>Write-host</div>
<div>Write-Host &#8220;______________________________________________________________________________________________&#8221; -ForegroundColor Cyan</div>
<div>Write-Host &#8220;Synchronized Distribution Groups with no ManagedBy settings will be defaulted to Organization&#8221; -ForeGroundColor Yellow</div>
<div>Write-Host &#8220;Management. This value cannot be translated.&#8221; -ForeGroundColor Yellow</div>
<div>Write-host</div>
<div>Write-Host &#8220;You must set a default account value to replace Organization Management.&#8221; -ForeGroundColor Green</div>
<div>Write-Host &#8220;The default account must be a valid licensed address for this tenant. &nbsp;IE. seatosky@domain.com &#8221; -ForeGroundColor Green</div>
<div>$ManagedByDefault = Read-host &#8220;Enter the email address of a valid licensed account for this tenant:&#8221;</div>
<div>Write-Host &#8220;______________________________________________________________________________________________&#8221; -ForegroundColor Cyan</div>
<div># Disable Azure AD Connect from initiating a sync while this process is underway</div>
<div>Set-ADSyncScheduler -SyncCycleEnabled $false</div>
<div>Write-host &#8220;Azure AD Connect Schedule Sync has been disabled temporarily.&#8221;</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div># Create Working and Export folders</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div>Write-Host &#8220;Creating a Working Directory C:\DG-Migrate and an Exports Directory within the Working Directory&#8221; -ForegroundColor Green</div>
<div># Create a working directory</div>
<div>$orginfo = Get-OrganizationConfig | select -expandproperty Name</div>
<div>$WorkingDirectory = &#8220;C:\DG-Migrate\&#8221; + $orginfo + &#8220;\&#8221;</div>
<div>$ExportDirectory = $WorkingDirectory + &#8220;ExportedAddresses\&#8221;</div>
<div>If(!(Test-Path -Path $WorkingDirectory )){</div>
<div># if WorkingDirectory doesn&#8217;t exist neither does ExportDirectory &#8211; create them both</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Write-Host &#8221; &nbsp;Creating Directory: $WorkingDirectory&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; New-Item -ItemType directory -Path $WorkingDirectory | Out-Null</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Write-Host &#8221; &nbsp;Creating Directory: $ExportDirectory&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; New-Item -ItemType directory -Path $ExportDirectory | Out-Null</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; } else {</div>
<div># WorkingDirectory may exist but that doesn&#8217;t mean ExportDirectory does &#8211; create if it doesn&#8217;t exist</div>
<div>If(!(Test-Path -Path $ExportDirectory )){</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Write-Host &#8221; &nbsp;Creating Directory: $ExportDirectory&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; New-Item -ItemType directory -Path $ExportDirectory | Out-Null</div>
<div>}</div>
<div>}</div>
<div>Write-Host &#8220;Completed&#8221; -ForegroundColor Green</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div>Write-Host &#8220;Creating a backup of all AD Synchronized Distribution Lists and placing into the Working Directory&#8221; -ForegroundColor Green</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div># Export all the Distribution Group Information to a separate file</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div>$check = (get-distributiongroup | Where {($_.IsDirSynced -eq $true) -AND ($_.RecipientType -eq &#8220;MailUniversalDistributionGroup&#8221;)})</div>
<div>if ((($check | Measure-Object).count) -ne 0) {</div>
<div># Not 0 so we found some Distribution Groups to migrate</div>
<div># We don&#8217;t want to overwrite an existing backup set &#8211; rename any existing files with a time stamp</div>
<div>&nbsp; &nbsp; if (Test-Path ($WorkingDirectory + &#8220;DG_Details_Backup.csv&#8221;)) {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $filename = ($WorkingDirectory + &#8220;DG_Details_Backup.csv&#8221;)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $fileObj = get-item $filename</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $DateStamp = get-date -uformat &#8220;%Y-%m-%d@%H-%M-%S&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $extOnly = $fileObj.extension</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; if ($extOnly.length -eq 0) {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $nameOnly = $fileObj.Name</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rename-item &#8220;$fileObj&#8221; &#8220;$nameOnly-$DateStamp&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; else {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $nameOnly = $fileObj.Name.Replace( $fileObj.Extension,&#8221;)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rename-item &#8220;$fileName&#8221; &#8220;$nameOnly-$DateStamp$extOnly&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; }</div>
<div>$check | select `</div>
<div>&nbsp; &nbsp; GroupType, `</div>
<div>&nbsp; &nbsp; SamAccountName, `</div>
<div>&nbsp; &nbsp; IsDirSynced, `</div>
<div>&nbsp; &nbsp; @{label=&#8221;ManagedBy&#8221;;expression={</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; ($_.managedby `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; | % { get-mailbox -identity $_ | select-object -ExpandProperty PrimarySMTPAddress } `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; | Where-Object {$_ -like &#8220;*@*&#8221;}) -join &#8216;;&#8217;}</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; }, `</div>
<div>&nbsp; &nbsp; MemberJoinRestriction, `</div>
<div>&nbsp; &nbsp; MemberDepartRestriction, `</div>
<div>&nbsp; &nbsp; ReportToOriginatorEnabled, `</div>
<div>&nbsp; &nbsp; Description, `</div>
<div>&nbsp; &nbsp; AddressListMembership, `</div>
<div>&nbsp; &nbsp; Alias, `</div>
<div>&nbsp; &nbsp; DisplayName, `</div>
<div>&nbsp; &nbsp; PrimarySMTPAddress, `</div>
<div>&nbsp; &nbsp; @{label=&#8221;EmailAddressess&#8221;;expression={</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; ($_.EmailAddresses | Where-Object {$_ -like &#8220;*smtp:*&#8221; }) -join &#8216;;&#8217;}</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; },`</div>
<div>&nbsp; &nbsp; ExternalDirectoryObjectId, `</div>
<div>&nbsp; &nbsp; HiddenFromAddressListsEnabled, `</div>
<div>&nbsp; &nbsp; LegacyExchangeDN, `</div>
<div>&nbsp; &nbsp; MaxSendSize, `</div>
<div>&nbsp; &nbsp; MaxReceiveSize, `</div>
<div>&nbsp; &nbsp; ModeratedBy, `</div>
<div>&nbsp; &nbsp; ModerationEnabled, `</div>
<div>&nbsp; &nbsp; PoliciesIncluded, `</div>
<div>&nbsp; &nbsp; PoliciesExcluded, `</div>
<div>&nbsp; &nbsp; EmailAddressPolicyEnabled, `</div>
<div>&nbsp; &nbsp; RecipientType, `</div>
<div>&nbsp; &nbsp; RecipientTypeDetials, `</div>
<div>&nbsp; &nbsp; RequireSenderAuthenticationEnabled, `</div>
<div>&nbsp; &nbsp; WindowsEmailAddress, `</div>
<div>&nbsp; &nbsp; Identity, `</div>
<div>&nbsp; &nbsp; Id, `</div>
<div>&nbsp; &nbsp; Name, `</div>
<div>&nbsp; &nbsp; DistinguishedName, `</div>
<div>&nbsp; &nbsp; ExchangeObjectId, `</div>
<div>&nbsp; &nbsp; Guid `</div>
<div>| Export-CSV ($WorkingDirectory + &#8220;DG_Details_Backup.csv&#8221;) -NoTypeInformation</div>
<div>sleep 20</div>
<div>&nbsp; &nbsp; }</div>
<div>else {</div>
<div>&nbsp; &nbsp; Write-Host &#8220;There are no appropriate Distribution Lists to migrate. &nbsp;Cancelling migration.&#8221;</div>
<div>&nbsp; &nbsp; Break</div>
<div>}</div>
<div>Write-Host &#8220;Completed&#8221; -ForegroundColor Green</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div>Write-Host &#8220;Creating a backup of Distribution List Membership and placing in the Working Directory&#8221; -ForegroundColor Green</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div># Export all the Distribution Group Members to a separate file</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div>$output = @()</div>
<div>$Identities = import-csv ($WorkingDirectory + &#8220;DG_Details_Backup.csv&#8221;) | select Name,PrimarySmtpAddress,Managedby,GroupType,RecipientType</div>
<div>If ($Identities) {</div>
<div>Foreach($group in $Identities) {</div>
<div>&nbsp; &nbsp; $Members = Get-DistributionGroupMember $group.PrimarySmtpAddress -resultsize unlimited</div>
<div>&nbsp; &nbsp; if (@($Members.count) -eq 0) {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; #$managers = ($group | Select @{Name=&#8217;DistributionGroupManagers&#8217;;Expression={[string]::join(&#8220;;&#8221;, ($_.Managedby))}})</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj = New-Object PSObject</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;DisplayName&#8221; -Value EmptyGroup</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Alias&#8221; -Value EmptyGroup</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;RecipientType&#8221; -Value EmptyGroup</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Recipient OU&#8221; -Value EmptyGroup</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Primary SMTP address&#8221; -Value EmptyGroup</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Distribution Group&#8221; -Value $group.Name</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Distribution Group Primary SMTP address&#8221; -Value $group.PrimarySmtpAddress</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Distribution Group Managers&#8221; -Value $managers.DistributionGroupManagers</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Distribution Group Type&#8221; -Value $group.GroupType</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Distribution Group Recipient Type&#8221; -Value $group.RecipientType</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $output+=$UserObj</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; else {</div>
<div>&nbsp; &nbsp; Foreach($Member in $members) {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; #$managers = $group | Select @{Name=&#8217;DistributionGroupManagers&#8217;;Expression={[string]::join(&#8220;;&#8221;, ($_.Managedby))}}</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj = New-Object PSObject</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;DisplayName&#8221; -Value $Member.Name</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Alias&#8221; -Value $Member.Alias</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;RecipientType&#8221; -Value $Member.RecipientType</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Recipient OU&#8221; -Value $Member.OrganizationalUnit</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Primary SMTP address&#8221; -Value $Member.PrimarySmtpAddress</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Distribution Group&#8221; -Value $group.Name</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Distribution Group Primary SMTP address&#8221; -Value $group.PrimarySmtpAddress</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Distribution Group Managers&#8221; -Value $managers.DistributionGroupManagers</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Distribution Group Type&#8221; -Value $group.GroupType</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $userObj | Add-Member NoteProperty -Name &#8220;Distribution Group Recipient Type&#8221; -Value $group.RecipientType</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $output+=$UserObj</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp;}</div>
<div>&nbsp; &nbsp;# We don&#8217;t want to overwrite an existing backup set &#8211; rename any existing files with a time stamp</div>
<div>&nbsp; &nbsp; if (Test-Path ($WorkingDirectory + &#8220;DG_Members_Backup.csv&#8221;)) {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $filename = ($WorkingDirectory + &#8220;DG_Members_Backup.csv&#8221;)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $fileObj = get-item $filename</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $DateStamp = get-date -uformat &#8220;%Y-%m-%d@%H-%M-%S&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $extOnly = $fileObj.extension</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; if ($extOnly.length -eq 0) {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $nameOnly = $fileObj.Name</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rename-item &#8220;$fileObj&#8221; &#8220;$nameOnly-$DateStamp&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; else {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $nameOnly = $fileObj.Name.Replace( $fileObj.Extension,&#8221;)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rename-item &#8220;$fileName&#8221; &#8220;$nameOnly-$DateStamp$extOnly&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; $output | Export-CSV ($WorkingDirectory + &#8220;DG_Members_Backup.csv&#8221;) -NoTypeInformation</div>
<div>&nbsp; &nbsp;}</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</div>
<div>sleep 15</div>
<div>Write-Host &#8220;Completed&#8221; -ForegroundColor Green</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div># Create the Cloud copies of the Distribution Lists</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div>Write-Host &#8220;Creating Cloud copies of each AD Synced Distribution List&#8221; -ForegroundColor Green</div>
<div>$Identities = import-csv ($WorkingDirectory + &#8220;DG_Details_Backup.csv&#8221;) | select -expandproperty PrimarySmtpAddress</div>
<div># Create the cloud versions</div>
<div>If ($Identities) {</div>
<div>&nbsp; &nbsp; foreach ($group in $identities) {</div>
<div>&nbsp; &nbsp; If (((Get-DistributionGroup $group -Resultsize Unlimited -ErrorAction &#8216;SilentlyContinue&#8217;).IsValid) -eq $true) {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $OldDG = Get-DistributionGroup $group</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; [System.IO.Path]::GetInvalidFileNameChars() | ForEach {$Group = $Group.Replace($_,&#8217;_&#8217;)}</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $OldName = [string]$OldDG.Name</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $OldDisplayName = [string]$OldDG.DisplayName</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $OldPrimarySmtpAddress = [string]$OldDG.PrimarySmtpAddress</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $OldAlias = [string]$OldDG.Alias</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ((![string]$OldDG.managedby) -or ([string]$OldDG.managedby -eq &#8220;Organization Management&#8221;)) {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [string]$OldDG.managedby=$ManagedByDefault</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $OldMembers = (Get-DistributionGroupMember $OldDG.PrimarySmtpAddress).primarysmtpaddress &#8220;EmailAddress&#8221; &gt; &#8220;$ExportDirectory\$OldName.csv&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $OldDG.EmailAddresses &gt;&gt; &#8220;$ExportDirectory\$OldName.csv&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &#8220;x500:&#8221;+$OldDG.LegacyExchangeDN &gt;&gt; &#8220;$ExportDirectory\$OldName.csv&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Write-Host &#8221; &nbsp;Creating Group: Cloud-$OldDisplayName&#8221; -ForegroundColor Green</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; New-DistributionGroup `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -Name &#8220;Cloud-$OldName&#8221; `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -Alias &#8220;Cloud-$OldAlias&#8221; `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -DisplayName &#8220;Cloud-$OldDisplayName&#8221; `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -ManagedBy $OldDG.ManagedBy `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -Members $OldMembers `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -PrimarySmtpAddress &#8220;Cloud-$OldPrimarySmtpAddress&#8221; | Out-Null</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Sleep -Seconds 3</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Write-Host &#8221; &nbsp;Setting Values For: Cloud-$OldDisplayName&#8221; -ForegroundColor Green</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Set-DistributionGroup `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -Identity &#8220;Cloud-$OldPrimarySmtpAddress&#8221; `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -AcceptMessagesOnlyFromSendersOrMembers $OldDG.AcceptMessagesOnlyFromSendersOrMembers `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -RejectMessagesFromSendersOrMembers $OldDG.RejectMessagesFromSendersOrMembers `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Set-DistributionGroup `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -Identity &#8220;Cloud-$OldPrimarySmtpAddress&#8221; `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -AcceptMessagesOnlyFrom $OldDG.AcceptMessagesOnlyFrom `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -AcceptMessagesOnlyFromDLMembers $OldDG.AcceptMessagesOnlyFromDLMembers `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -BypassModerationFromSendersOrMembers $OldDG.BypassModerationFromSendersOrMembers `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -BypassNestedModerationEnabled $OldDG.BypassNestedModerationEnabled `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute1 $OldDG.CustomAttribute1 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute2 $OldDG.CustomAttribute2 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute3 $OldDG.CustomAttribute3 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute4 $OldDG.CustomAttribute4 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute5 $OldDG.CustomAttribute5 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute6 $OldDG.CustomAttribute6 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute7 $OldDG.CustomAttribute7 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute8 $OldDG.CustomAttribute8 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute9 $OldDG.CustomAttribute9 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute10 $OldDG.CustomAttribute10 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute11 $OldDG.CustomAttribute11 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute12 $OldDG.CustomAttribute12 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute13 $OldDG.CustomAttribute13 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute14 $OldDG.CustomAttribute14 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -CustomAttribute15 $OldDG.CustomAttribute15 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -ExtensionCustomAttribute1 $OldDG.ExtensionCustomAttribute1 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -ExtensionCustomAttribute2 $OldDG.ExtensionCustomAttribute2 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -ExtensionCustomAttribute3 $OldDG.ExtensionCustomAttribute3 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -ExtensionCustomAttribute4 $OldDG.ExtensionCustomAttribute4 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -ExtensionCustomAttribute5 $OldDG.ExtensionCustomAttribute5 `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -GrantSendOnBehalfTo $OldDG.GrantSendOnBehalfTo `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -HiddenFromAddressListsEnabled $True `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -MailTip $OldDG.MailTip `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -MailTipTranslations $OldDG.MailTipTranslations `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -MemberDepartRestriction $OldDG.MemberDepartRestriction `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -MemberJoinRestriction $OldDG.MemberJoinRestriction `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -ModeratedBy $OldDG.ModeratedBy `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -ModerationEnabled $OldDG.ModerationEnabled `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -RejectMessagesFrom $OldDG.RejectMessagesFrom `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -RejectMessagesFromDLMembers $OldDG.RejectMessagesFromDLMembers `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -ReportToManagerEnabled $OldDG.ReportToManagerEnabled `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -ReportToOriginatorEnabled $OldDG.ReportToOriginatorEnabled `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -RequireSenderAuthenticationEnabled $OldDG.RequireSenderAuthenticationEnabled `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -SendModerationNotifications $OldDG.SendModerationNotifications `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -SendOofMessageToOriginatorEnabled $OldDG.SendOofMessageToOriginatorEnabled `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -BypassSecurityGroupManagerCheck</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; sleep 3</div>
<div>&nbsp; &nbsp; } &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
<div>&nbsp; &nbsp; Else {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Write-Host &#8221; &nbsp;ERROR: The distribution group &#8216;$Group&#8217; was not found&#8221; -ForegroundColor Red</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Write-Host</div>
<div>&nbsp; &nbsp; }</div>
<div>}</div>
<div>}</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div># Delete all the Distribution Groups in Active Directory</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div>Write-Host &#8220;All Distribution Lists have been replicated in the Cloud with Cloud_ as a prefix&#8221; -ForegroundColor Green</div>
<div>Write-Host &#8220;Completed&#8221; -ForegroundColor Green</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div>Write-host &#8220;If you encountered any errors during the creation of the Cloud-Group process you may hit CTRL + C now to kill the process.&#8221; -ForegroundColor Red -BackgroundColor Black</div>
<div>Write-host &#8220;If you kill the process now to fix any issues you should remove the Cloud-Group objects from Azure AD and start fresh.&#8221; -ForegroundColor Red -BackgroundColor Black</div>
<div>Write-host &#8220;WARNING &#8211; The Azure AZ Connect Sync Schedule is currently Suspended. You must complete the script or manually restart the Schedule.&#8221; -ForegroundColor Black -BackgroundColor Red</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div>Write-host &#8220;Press Enter to delete the migrated Distribution Lists from Active Directory&#8221; -ForegroundColor Cyan</div>
<div>pause</div>
<div>If (test-path ($WorkingDirectory + &#8220;DG_Details_Backup.csv&#8221;)) {</div>
<div>&nbsp; &nbsp; $Identities = import-csv ($WorkingDirectory + &#8220;DG_Details_Backup.csv&#8221;) | select -expandproperty Identity</div>
<div>&nbsp; &nbsp; foreach ($group in $identities) {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Remove-ADGroup -identity &#8220;$group&#8221; -confirm:$false</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; sleep 2</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; }</div>
<div>}</div>
<div>Write-Host &#8220;All Distribution Lists have been removed from Active Directory&#8221; -ForegroundColor Green</div>
<div>Write-Host &#8220;Completed&#8221; -ForegroundColor Green</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div>sleep 15</div>
<div>Pause</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div># Initiate a Delta Sync with Azure AD Connect and set a timer of 5 minutes</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div>Write-Host &#8220;Synchronizing Changes with Azure AD Connect. &nbsp;Please allow 5 minutes for process to complete. &nbsp;You will be prompted when to continue.&#8221; -ForegroundColor Green</div>
<div>Start-AdSyncSyncCycle -PolicyType Delta</div>
<div>Write-Host &#8220;PLEASE BE PATIENT &#8211; Confirm the Distribution Lists have been removed from Office 365 Azure AD before continuing&#8221; -ForegroundColor Green</div>
<div>sleep 300</div>
<div>Write-Host &#8220;Completed&#8221; -ForegroundColor Green</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div>Pause</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div># Complete the process by renaming the Cloud copies to the original names</div>
<div># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</div>
<div>Write-Host &#8220;Updating the placeholder Distribution Lists to replace the original AD synchronized Distribution Lists&#8221; -ForegroundColor Green</div>
<div>If (test-path $ExportDirectory) {</div>
<div>&nbsp; &nbsp; $Identities = import-csv ($WorkingDirectory + &#8220;DG_Details_Backup.csv&#8221;) | select -expandproperty Identity</div>
<div>&nbsp; &nbsp; foreach ($group in $identities) {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $TempDG = Get-DistributionGroup &#8220;Cloud-$Group&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $TempPrimarySmtpAddress = $TempDG.PrimarySmtpAddress</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; [System.IO.Path]::GetInvalidFileNameChars() | ForEach {$Group = $Group.Replace($_,&#8217;_&#8217;)}</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $OldAddresses = @(Import-Csv &#8220;$ExportDirectory\$Group.csv&#8221;)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $NewAddresses = $OldAddresses | ForEach {$_.EmailAddress.Replace(&#8220;X500&#8243;,&#8221;x500&#8221;)}</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $NewDGName = $TempDG.Name.Replace(&#8220;Cloud-&#8220;,&#8221;&#8221;)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $NewDGDisplayName = $TempDG.DisplayName.Replace(&#8220;Cloud-&#8220;,&#8221;&#8221;)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $NewDGAlias = $TempDG.Alias.Replace(&#8220;Cloud-&#8220;,&#8221;&#8221;)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; $NewPrimarySmtpAddress = ($NewAddresses | Where {$_ -clike &#8220;SMTP:*&#8221;}).Replace(&#8220;SMTP:&#8221;,&#8221;&#8221;)</div>
<div>&nbsp; &nbsp; Write-Host &#8220;Converting Cloud-$Group to $Group&#8221;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Set-DistributionGroup `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -Identity $TempDG.Name `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -Name $NewDGName `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -Alias $NewDGAlias `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -DisplayName $NewDGDisplayName `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -PrimarySmtpAddress $NewPrimarySmtpAddress `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -HiddenFromAddressListsEnabled $False `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -BypassSecurityGroupManagerCheck</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Set-DistributionGroup `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -Identity $NewDGName `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -EmailAddresses @{Add=$NewAddresses} `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -BypassSecurityGroupManagerCheck</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; Set-DistributionGroup `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -Identity $NewDGName `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -EmailAddresses @{Remove=$TempPrimarySmtpAddress} `</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -BypassSecurityGroupManagerCheck</div>
<div>&nbsp; &nbsp; sleep 3</div>
<div>&nbsp; &nbsp; }</div>
<div>&nbsp; &nbsp; }</div>
<div>Write-Host &#8220;Completed&#8221; -ForegroundColor Green</div>
<div>Write-Host &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#8221; -ForegroundColor Cyan</div>
<div># Re-Enable AD Sync Schedule</div>
<div>Set-ADSyncScheduler -SyncCycleEnabled $true</div>
<div>Write-Host &#8220;The conversion process happens in Exchange and can take a while to reflect in Azure AD&#8221;</div>
<div>Write-Host &#8220;Check to make sure that Azure AD is updated and now showing all of the Distribution Lists are converted to Cloud objects&#8221;</div>
<div>Pause</div>
</div>
</blockquote>
<div>
<div>&nbsp;</div>
</div>
<p>The post <a href="https://catastrophe.wiredwolf.com/office-365-migrating-distribution-groups/">Office 365 &#8211; Migrating Distribution Groups</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Dynamic Distribution Lists</title>
		<link>https://catastrophe.wiredwolf.com/dynamic-distribution-lists/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 08 Jun 2021 01:13:44 +0000</pubDate>
				<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[Microsoft Office 365]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Office 365]]></category>
		<guid isPermaLink="false">https://catastrophe.wiredwolf.com/?p=20957</guid>

					<description><![CDATA[<p>Dynamic Distribution Lists are an easy way to maintain lists without having to constantly maintain lists.  Basic creation is simple - you can do that right from EAC and select which type of recipients in the organization should be included.   More complex options exist but are accomplished with PowerShell.  For instance, you want to create  [...]</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/dynamic-distribution-lists/">Dynamic Distribution Lists</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Dynamic Distribution Lists are an easy way to maintain lists without having to constantly maintain lists.&nbsp;</p>
<p>Basic creation is simple &#8211; you can do that right from EAC and select which type of recipients in the organization should be included.&nbsp;&nbsp;</p>
<p>More complex options exist but are accomplished with PowerShell.&nbsp; For instance, you want to create a distribution list that includes all Exchange Mailbox users, but you don&#8217;t want to include Shared Mailboxes, Equipment or Resource Mailboxes, or any users with attributes that match.&nbsp;&nbsp;</p>
<p>If you want to use custom attributes where you have AAD Connect there&#8217;s a bit more you need to do.&nbsp; I&#8217;ve document that here: <a href="https://catastrophe.wiredwolf.com/azure-ad-connect-and-custom-attributes/">https://catastrophe.wiredwolf.com/azure-ad-connect-and-custom-attributes/</a></p>
<p>This is where it gets a bit tricky.&nbsp; You can&#8217;t mix operators and stay sane, so it&#8217;s important to know how to format the command with not double not nor negatives (joke).</p>
<p>Creating a List:</p>
<p style="padding-left: 40px;">New-dynamicdistributiongroup -name&nbsp;&#8220;<strong><span style="color: #ff6600;">DGNAME</span></strong>&#8221; `<br />
-recipientfilter {((RecipientType -eq &#8216;UserMailbox&#8217;) `<br />
-and (CustomAttribute1 -ne &#8216;<span style="color: #ff6600;">NoMember</span>&#8216;) `<br />
-and (-not(RecipientTypeDetailsValue -eq &#8216;SharedMailbox&#8217;)) `<br />
-and (-not(RecipientTypeDetailsValue -eq &#8216;GuestMailUser&#8217;)) `<br />
-and (-not(Name -like &#8216;SystemMailbox{*&#8217;)) `<br />
-and (-not(Name -like &#8216;CAS_{*&#8217;)) `<br />
-and (-not(Company -eq &#8216;<span style="color: #ff6600;">Acme</span>&#8216;)) `<br />
-and (-not(RecipientTypeDetailsValue -eq &#8216;MailboxPlan&#8217;)) `<br />
-and (-not(RecipientTypeDetailsValue -eq &#8216;DiscoveryMailbox&#8217;)) `<br />
-and (-not(RecipientTypeDetailsValue -eq &#8216;PublicFolderMailbox&#8217;)) `<br />
-and (-not(RecipientTypeDetailsValue -eq &#8216;ArbitrationMailbox&#8217;)) `<br />
-and (-not(RecipientTypeDetailsValue -eq &#8216;AuditLogMailbox&#8217;)) `<br />
-and (-not(RecipientTypeDetailsValue -eq &#8216;AuxAuditLogMailbox&#8217;)) `<br />
-and (-not(RecipientTypeDetailsValue -eq &#8216;SupervisoryReviewPolicyMailbox&#8217;)))} `<br />
-managedby &#8220;admin@yourdomain.com&#8221; `<br />
-DisplayName &#8220;Dynamic Distribution Group Name&#8221; `<br />
-RequireSenderAuthenticationEnabled $false `<br />
-MemberDepartRestriction closed `<br />
-MemberJoinRestriction closed</p>
<p>I&#8217;ve added a couple of <span style="color: #ff6600;">options</span> as an example of how far you can go with RecipientType and RecipientTypeDetails. If synchronized with an on-premises AD you can easily add attributes to the account, such as Company, or CustomAttribute1, at which point you can use these attributes to further hone the scope of your Dynamic Distribution List.</p>
<p>If you&#8217;ve created the dynamic distribution list already you can always edit it:</p>
<p>replace new-dynamicdistributiongroup -Name &#8220;DGNAME&#8221; with set-dynamicdistributiongroup -identity &#8220;DGNAME&#8221;&nbsp;</p>
<p>Getting details from a single list &#8211; export to CSV</p>
<p>Get-Recipient -RecipientPreviewFilter (get-dynamicdistributiongroup <span style="color: #ff6600;"><strong>DGNAME</strong></span>).RecipientFilter -OrganizationalUnit $group.RecipientContainer | select Name, DisplayName, PrimarySMTPAddress, RecipientType*, WindowsLiveID | export-csv &#8220;C:\CSV-PATH\DynDG-DGNAME.CSV&#8221; -NoTypeInformation</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/dynamic-distribution-lists/">Dynamic Distribution Lists</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>SPF &#8211; DKIM &#8211; DMARC</title>
		<link>https://catastrophe.wiredwolf.com/spf-dkim-dmarc/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 19 Jan 2021 07:21:08 +0000</pubDate>
				<category><![CDATA[DNS]]></category>
		<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[Microsoft Office 365]]></category>
		<guid isPermaLink="false">https://catastrophe.wiredwolf.com/?p=20939</guid>

					<description><![CDATA[<p>Email security has been a 'thing' now for quite a while.  Try sending email from unsecured domains and you'll get a lot of rejection letters. If you have Office 365 and you're actively using Exchange online then with just a few steps you can secure your mail properly. Set up SPF SPF is Sender Policy  [...]</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/spf-dkim-dmarc/">SPF &#8211; DKIM &#8211; DMARC</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Email security has been a &#8216;thing&#8217; now for quite a while.&nbsp; Try sending email from unsecured domains and you&#8217;ll get a lot of rejection letters.</p>
<p>If you have Office 365 and you&#8217;re actively using Exchange online then with just a few steps you can secure your mail properly.</p>
<h4>Set up SPF</h4>
<p>SPF is Sender Policy Framework and it basically tells the Internet where email from your domain is legitimately sent from.&nbsp; When a receiving MTA does a check it sees the IP your email originated from then compares that to the SPF record in your DNS Zone.&nbsp; If the IP or FQDN or MX doesn&#8217;t match &#8211; your mail could be blocked.&nbsp;</p>
<p>Setting up SPF is simple and Microsoft gives you what you need right in the tenant.</p>
<ul>
<li>Log in to your Tenant as a Global Administrator</li>
<li>Open Settings &#8211; Domains</li>
<li>Select your primary domain (the one you mail from)</li>
<li>Click on DNS</li>
<li>Copy/paste the TXT record for SPF to Notepad</li>
</ul>
<p>Note &#8211; if you have an email sender on your domain that is not sending through Office 365 you need to update the record to reflect that source.</p>
<p>Typical SPF record:&nbsp; &nbsp;<strong>&#8220;v=spf1 include:spf.protection.outlook.com -all&#8221;</strong></p>
<p>Here&#8217;s an SPF where you&#8217;ve added another source location for email:&nbsp; &#8220;v=spf1 ip4:208.191.17.213 include:spf.protection.outlook.com -all&#8221; where 208.191.17.213 is the public IP of your office where you have a photocopier that sends email</p>
<h4>Set up DKIM</h4>
<p>DKIM is a bit harder to understand.&nbsp; Domain Keys Identified Mail is a domain-level digital signature authentication framework that basically validates the DNS source against a signature from the MTA to validate the authenticity of the mail.&nbsp; Primarily this is to prevent spoofing, where an outside source sends mail through the MTA (Message Transfer Agent) designed to look like it came from your domain.&nbsp; DKIM adds headers to every outbound email that are checked against the DNS servers for your domain to validate the source which can be checked against the recipient MTA.</p>
<p>In this way both the MTA is validating against SPF and DKIM to verify the authenticity of the source of the email.&nbsp; By the way, both are required to set up DMARC which we&#8217;ll get to in a bit.</p>
<p>Setting up DKIM is actually fairly simple.</p>
<p>Let&#8217;s say the domain registered in your MS Tenant is gotmilk.ca.</p>
<p style="padding-left: 40px;">Crack open your PowerShell and connect to Exchange Online</p>
<blockquote>
<p style="padding-left: 40px;">connect-exchangeonline</p>
</blockquote>
<p style="padding-left: 40px;">Run a simple command to pull the DKIM records you&#8217;ll need:</p>
<blockquote>
<p style="padding-left: 40px;">get-dkimsigningconfig -identity gotmilk.ca | select domain,selector*CNAME</p>
<p>You&#8217;ll get a result that looks like this:</p>
<p>Domain Selector1CNAME Selector2CNAME<br />
&#8212;&#8212; &#8212;&#8212;&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8211;<br />
gotmilk.ca selector1-gotmilk-ca._domainkey.gotmilk.onmicrosoft.com selector2-gotmilk-ca._domainkey.gotmilk.onmicrosoft.com</p></blockquote>
<p style="padding-left: 40px;">Copy/Paste the results to the Notepad document where you put your SPF record</p>
<h4>Update DNS</h4>
<p>Now it&#8217;s time to update your DNS Zone records.&nbsp; We&#8217;ll continue to use gotmilk.ca for our examples. Go to your DNS server and create the following records:</p>
<p>@ (domain root) TXT&nbsp; <strong>&#8220;v=spf1 include:spf.protection.outlook.com -all&#8221;</strong></p>
<p>selector1._domainkey.gotmilk.ca <strong>CNAME</strong> gotmilk.ca selector1-gotmilk-ca._domainkey.gotmilk.onmicrosoft.com</p>
<p>selector2._domainkey.gotmilk.ca <strong>CNAME</strong> selector2-gotmilk-ca._domainkey.gotmilk.onmicrosoft.com</p>
<p>While you&#8217;re there create the DMARC record</p>
<p>_dmarc.gotmilk.ca <strong>TXT</strong> &#8220;v=DMARC1; pct=100; p=quarantine&#8221;</p>
<p>Office 365</p>
<p>Time to complete the setup in Office 365.&nbsp;</p>
<ul>
<li>Log in to your Exchange Admin Center and go to protection &#8211;&gt; DKIM</li>
<li>Highlight the domain gotmilk.ca and click on Enable in the action pane on the right
<ul>
<li>If the two CNAME records you created above have propagated DKIM should enable successfully on the domain</li>
<li>Click on Rotate</li>
</ul>
</li>
<li>Open the Spam Filter and double click on the Default policy</li>
<li>Open Advanced Options</li>
<li>Enable two options:
<ul>
<li>SPF record: hard fail</li>
<li>Conditional Sender ID filtering: hard fail</li>
</ul>
</li>
</ul>
<p>That&#8217;s it! SPF, DKIM, and DMARC are now enabled and protecting your domain from general maliciousness.</p>
<p>DMARC has a number of additional options you can enable in the form of tags:</p>
<h3>Declared tags</h3>
<table class="table table-bordered">
<tbody>
<tr>
<th width="80">Tag</th>
<th width="80">Value</th>
<th>Description</th>
</tr>
<tr>
<td class="success">v</td>
<td class="success">DKIM1</td>
<td class="success">DKIM protocol version.</td>
</tr>
<tr>
<td class="success">p</td>
<td class="success">MIGfMA0GCSqGSIb3DQEBAQUAA&#8230;</td>
<td class="success">Your base64 encoded public key.</td>
</tr>
<tr>
<td class="success">k</td>
<td class="success">rsa</td>
<td class="success">The &#8216;k=&#8217; tag provide a list of mechanisms that can be used to decode a DKIM signature. (&#8216;rsa&#8217; is used most often)</td>
</tr>
</tbody>
</table>
<h3>Defaulted tags</h3>
<table class="table table-bordered">
<tbody>
<tr>
<th width="80">Tag</th>
<th width="80">Value</th>
<th>Description</th>
</tr>
<tr>
<td>g</td>
<td>*</td>
<td>Some organizations assign specific business functions to discrete groups, inside or outside the organization. This key is to authorize that group to sign some mail, but to constrain what signatures they can generate. The DKIM granularity (the &#8216;g=&#8217; tag) facilitate this kind of restricted authorization.</td>
</tr>
<tr>
<td>h</td>
<td>&nbsp;</td>
<td>The &#8216;h=&#8217; tag provide a list of mechanisms that can be used to produce a digest of message data. (&#8216;sha1&#8217; or &#8216;sha256&#8217; can be used).</td>
</tr>
<tr>
<td>n</td>
<td>&nbsp;</td>
<td>Notes that might be of interest to a human.</td>
</tr>
<tr>
<td>s</td>
<td>*</td>
<td>The &#8216;s=&#8217; provides a list of service types to which this selector may apply. (&#8216;*&#8217; and &#8217;email&#8217; are used most often)</td>
</tr>
<tr>
<td>t</td>
<td>&nbsp;</td>
<td>The &#8216;t=&#8217; tag provides a list of flags to modify interpretation of the selector. These DKIM Selector Flags for additional flags are optional. (&#8216;y&#8217; and &#8216;s&#8217; are often used)</td>
</tr>
<tr>
<td>q</td>
<td>&nbsp;</td>
<td>The &#8216;q=&#8217; tag-spec provides for a list of query methods. (&#8216;dns&#8217; is used most often)</td>
</tr>
<tr>
<td>l</td>
<td>0</td>
<td>Body length limits (in the form of the &#8216;l=&#8217; tag) are subject to several potential attacks.</td>
</tr>
</tbody>
</table>
<p>The post <a href="https://catastrophe.wiredwolf.com/spf-dkim-dmarc/">SPF &#8211; DKIM &#8211; DMARC</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Office 365 Hybrid to On Premises Exchange &#8211; Mail Flow How-To</title>
		<link>https://catastrophe.wiredwolf.com/office-365-hybrid-to-on-premises-exchange-mail-flow-how-to/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 20 Apr 2020 23:20:59 +0000</pubDate>
				<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[Microsoft Office 365]]></category>
		<category><![CDATA[Networking]]></category>
		<guid isPermaLink="false">https://catastrophe.wiredwolf.com/?p=20807</guid>

					<description><![CDATA[<p>Migrating to Office 365 can be a time consuming endeavor and require that it be conducted in stages.  When moving batches of mailboxes the On-Prem Exchange server shows the mailboxes as "Remote Mailbox" and while appears to be aware of the mailbox, is not immediately able to route mail between the On-Premises Mailboxes and the  [...]</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/office-365-hybrid-to-on-premises-exchange-mail-flow-how-to/">Office 365 Hybrid to On Premises Exchange &#8211; Mail Flow How-To</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Migrating to Office 365 can be a time consuming endeavor and require that it be conducted in stages.&nbsp; When moving batches of mailboxes the On-Prem Exchange server shows the mailboxes as &#8220;Remote Mailbox&#8221; and while appears to be aware of the mailbox, is not immediately able to route mail between the On-Premises Mailboxes and the Remote Mailboxes.</p>
<p>There are a series of steps that must be taken to ensure mail flow:</p>
<ol>
<li>If using Azure AD Connect and filtering by OU or Security Group &#8211; make sure all mailbox users AD accounts are synchronized to Azure AD/Office 365
<ol>
<li>Add all Mail Users
<ol>
<li>In AD this can be easily accomplished with a simple Powershell script:<br />
<blockquote><p>Get-ADUser -Filter &#8216;Enabled -eq $true -and Mail -like &#8220;*@*&#8221;&#8216; | ForEach-Object {Add-ADGroupMember -Identity &#8216;Office365Users&#8217; -Members $_ }</p></blockquote>
<p><em>Where &#8220;Office365Users&#8221; is your security group</em></li>
</ol>
</li>
<li>Add all Contacts</li>
<li>Add all Distribution Lists</li>
<li>Add all Mail-Enabled Security Groups</li>
</ol>
</li>
</ol>
<p>For mail from&nbsp;<em>from</em> Office 365&nbsp;<em>to</em> Exchange On-Premises (Performed in Office 365 Exchange Admin Center):</p>
<ol>
<li>Create an Internal Relay to On-Prem Exchange connector (in EAC)</li>
</ol>
<p>For mail&nbsp;<em>to</em> Office 365&nbsp;<em>from</em> Exchange On-Premises (Performed in On-Premises Exchange Server):</p>
<ol>
<li>Create a&nbsp;<em>tenant.mail.onmicrosoft.com</em> in Accepted Domains and set to&nbsp;<em>Internal Relay</em></li>
<li>Create an &#8220;<em>O365 Relay</em>&#8221; Send Connector
<ol>
<li>FQDN of the connector (<em>mail.domain.com &#8211; the FQDN public name of the On-Premises Exchange server</em>)</li>
<li>Address Scope &#8211;&nbsp;<em>tenant.mail.onmicrosoft.com</em></li>
<li>Smart Host &#8211; the MX provided by Microsoft Office 365 Domains DNS configuration (I.E.&nbsp;<em>domain-com.mail.protection.outlook.com</em>)</li>
<li>Source Server: The On-Premises Exchange server</li>
</ol>
</li>
</ol>
<p>Make sure to check any firewall rules that restrict WAN to LAN to port 25 to specific addresses.&nbsp; Use this list <a href="https://docs.microsoft.com/en-us/office365/enterprise/urls-and-ip-address-ranges">https://docs.microsoft.com/en-us/office365/enterprise/urls-and-ip-address-ranges</a> to set up your rules to lock down unauthorized access to Port 25 inbound.</p>
<table class="table">
<tbody>
<tr>
<td>10</td>
<td>Allow<br />
Required</td>
<td>Yes</td>
<td><code>*.mail.protection.outlook.com</code><br />
<code>40.92.0.0/15, 40.107.0.0/16, 52.100.0.0/14, 104.47.0.0/17, 2a01:111:f400::/48, 2a01:111:f403::/48</code></td>
<td><strong>TCP:</strong>&nbsp;25</td>
</tr>
</tbody>
</table>
<p>The post <a href="https://catastrophe.wiredwolf.com/office-365-hybrid-to-on-premises-exchange-mail-flow-how-to/">Office 365 Hybrid to On Premises Exchange &#8211; Mail Flow How-To</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Setting Shared Mailbox as Primary Mailbox</title>
		<link>https://catastrophe.wiredwolf.com/setting-shared-mailbox-as-primary-mailbox/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 12 Oct 2019 01:16:14 +0000</pubDate>
				<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[Shared Mailbox]]></category>
		<guid isPermaLink="false">http://catastrophe.wiredwolf.com/?p=16985</guid>

					<description><![CDATA[<p>One company I have done work for uses shared mailbox in their On-Premises Exchange.  The difference is, they actually do share these mailboxes as primary mailboxes for each user.   Here's how it's done: Create your new AD account Set the Shared Mailbox address as the Primary Address (AD User Profile - General Tab - Email Address)  [...]</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/setting-shared-mailbox-as-primary-mailbox/">Setting Shared Mailbox as Primary Mailbox</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>One company I have done work for uses shared mailbox in their On-Premises Exchange.&nbsp; The difference is, they actually do share these mailboxes as&nbsp;<em>primary</em> mailboxes for each user.&nbsp;&nbsp;</p>
<p>Here&#8217;s how it&#8217;s done:</p>
<ul>
<li>Create your new AD account
<ul>
<li>Set the Shared Mailbox address as the Primary Address (AD User Profile &#8211; General Tab &#8211; Email Address)</li>
</ul>
</li>
<li>Create a user mailbox in Exchange</li>
<li>Add the user as a Delegate with Full Access and Send As rights to the Shared Mailbox</li>
<li>Now sign in to a PC with the new user account and set up Outlook</li>
</ul>
<p>Outlook will authenticate using the user account, but the mailbox that is assigned in Outlook will be the Shared Mailbox.&nbsp; This now becomes the primary mailbox for the user, and this process can be repeated for each and every delegate, meaning you can have multiple people using the same mailbox as their primary mailbox.</p>
<p>Please note &#8211; if you have already set up the Outlook profile&nbsp;<em>before</em> setting the Shared Mailbox as the Primary Account in Active Directory, you will need to wipe the Outlook profile and create a new one.</p>
<p>Once completed go back in to Exchange, open the user&#8217;s mailbox, and hide from address lists.</p>
<p>This trick is very handy where you have a group of people who share the same job, and are all responsible for responding to email sent to that account.&nbsp; This method allows you to set up individual users for domain account accountability, while sharing the same mailbox without worrying about where Sent Items are stored, or which address appeared in the From: field.</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/setting-shared-mailbox-as-primary-mailbox/">Setting Shared Mailbox as Primary Mailbox</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Office 365 Migration Headaches</title>
		<link>https://catastrophe.wiredwolf.com/office-365-migration-headaches/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 12 Jul 2019 20:12:12 +0000</pubDate>
				<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[Microsoft Office 365]]></category>
		<guid isPermaLink="false">http://catastrophe.wiredwolf.com/?p=16688</guid>

					<description><![CDATA[<p>I have been doing a lot of On-Premises Exchange to Office 365 migrations lately and each time I find new issues that can be very time consuming to research and resolve. One issue I've had is when creating a new migration batch the mailbox I want to migrate is not listed. The issue seems to  [...]</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/office-365-migration-headaches/">Office 365 Migration Headaches</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I have been doing a lot of On-Premises Exchange to Office 365 migrations lately and each time I find new issues that can be very time consuming to research and resolve.</p>
<p>One issue I&#8217;ve had is when creating a new migration batch the mailbox I want to migrate is not listed.</p>
<p>The issue seems to be with Azure AD Connect synchronization and the on-premises Active Directory.&nbsp; If the account/user/mailbox has issues the replication to Azure AD gets horribly malformed.</p>
<p>Step 1 &#8211; remove the user from MS Online</p>
<p>Open PowerShell (elevated privileges) and connect to Msol-Services</p>
<blockquote><p>&nbsp;Install-Module MSOnline</p>
<p>Connect-MsolService -Credential $Credential</p></blockquote>
<p>Provide the tenant Global Admin credentials</p>
<p>At this point you might as well also load up AzureAD</p>
<blockquote><p>Install-Module AzureAD -force</p>
<p>Set-ExecutionPolicy RemoteSigned</p>
<p>$Session = NewPSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Credential -Authentication Basic -AllowRedirection</p>
<p>$Import-PSSession $Session</p></blockquote>
<p>At this point your powershell has two sessions &#8211; one for AzureAD and one for MSOnline Services (Exchange Online)</p>
<p>&nbsp;</p>
<blockquote><p>&nbsp;</p>
<p>&nbsp;</p></blockquote>
<p>The post <a href="https://catastrophe.wiredwolf.com/office-365-migration-headaches/">Office 365 Migration Headaches</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Creating New Users During Hybrid Migration</title>
		<link>https://catastrophe.wiredwolf.com/creating-new-users-during-hybrid-migration/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 09 Jul 2019 21:28:58 +0000</pubDate>
				<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[Microsoft Office 365]]></category>
		<guid isPermaLink="false">http://catastrophe.wiredwolf.com/?p=16657</guid>

					<description><![CDATA[<p>During a Microsoft Office 365 Exchange migration creating new users can be a little bit of a challenge. If done wrong the user will end up with a mailbox that either internal or external users to the domain cannot communicate with.   When the MSOnline license is applied for the mail user a mailbox is created.   [...]</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/creating-new-users-during-hybrid-migration/">Creating New Users During Hybrid Migration</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>During a Microsoft Office 365 Exchange migration creating new users can be a little bit of a challenge. If done wrong the user will end up with a mailbox that either internal or external users to the domain cannot communicate with.&nbsp;&nbsp;</p>
<p>When the MSOnline license is applied for the mail user a mailbox is created.&nbsp; If the user mailbox was not created in Exchange first, none of the mail attributes will synchronize and Exchange Online won&#8217;t know where to correctly route mail for the user.</p>
<p>Step 1: Create User Account in AD<br />
Step 2: Create Mailbox in On-Premises Exchange<br />
Step 3: After AD Sync has completed after new user account was created apply Microsoft Office 365 License<br />
Step 4: Migrate Mailbox from On-Premises Exchange to Office 365 Exchange Online</p>
<p>Should you end up in a situation where this was done incorrectly, the only option is to use PowerShell to remove the Office 365 user account.</p>
<ol>
<li>Ensure local Exchange mailbox has been created for the user</li>
<li>Connect to Office 365 tenant using Azure Active Directory Module for Windows PowerShell</li>
<li>Remove the user from Office 365 Tenant</li>
<li>Remove the user from Office 365 Tenant Recycle Bin</li>
<li>Manually push a sync</li>
<li>Apply Microsoft Office 365 License to user account</li>
</ol>
<blockquote><p>Connect-MsolService</p>
<p>Remove-MsolUser -UserPrincipalName user.name@example.com</p>
<p>Remove-MsolUser -UserPrincipalName user.name@example.com -RemoveFromRecycleBin -Force</p>
<p>Start-AdSyncSyncCycle -PolicyType Delta</p></blockquote>
<p>Monitor the Exchange Online Recipients to ensure no new mailbox is created for the user after the Delta sync has completed.&nbsp; If no mailbox is created, the user will appear under the Contacts as a Mail User and remain there until the migration of the mailbox to Office 365 is completed.</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/creating-new-users-during-hybrid-migration/">Creating New Users During Hybrid Migration</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>From Office 365 to On-Premises Exchange</title>
		<link>https://catastrophe.wiredwolf.com/from-office-365-to-on-premises-exchange/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 28 May 2019 17:15:20 +0000</pubDate>
				<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[Microsoft Office 365]]></category>
		<category><![CDATA[Exchange]]></category>
		<category><![CDATA[mailbox]]></category>
		<category><![CDATA[move mailbox]]></category>
		<category><![CDATA[Office 365]]></category>
		<guid isPermaLink="false">http://catastrophe.wiredwolf.com/?p=16327</guid>

					<description><![CDATA[<p>Recently I was tasked with doing a Hybrid Exchange to Office 365 migration.  In my testing phases I converted two client mailboxes (of departed staff) to Office 365 mailboxes, but then realized when I re-allocated the licensing for each mailbox I orphaned these two mailboxes on Office 365.  The on-premises Exchange showed the mailboxes were  [...]</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/from-office-365-to-on-premises-exchange/">From Office 365 to On-Premises Exchange</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Recently I was tasked with doing a Hybrid Exchange to Office 365 migration.&nbsp; In my testing phases I converted two client mailboxes (of departed staff) to Office 365 mailboxes, but then realized when I re-allocated the licensing for each mailbox I orphaned these two mailboxes on Office 365.&nbsp; The on-premises Exchange showed the mailboxes were now Office 365 mailboxes, but because the accounts no longer had any licensing they didn&#8217;t show up as mailboxes.</p>
<p>Fearing this would cause a problem I tried to batch-convert the mailboxes back to on-premises Exchange.&nbsp; This failed. Instead of looking for a solution why the wizard failed, I decided to look for a Powershell solution.</p>
<p>It turns out it&#8217;s rather easy to do.&nbsp; You already have the Hybrid configuration in place so the endpoints already know about one another.&nbsp; Moving mailboxes around in PowerShell is the easiest solution.</p>
<p>Prerequisites:</p>
<ul>
<li>Domain Admin credentials</li>
<li>Office 365 Global Admin credentials</li>
<li>Database name of On-Premises Exchange</li>
</ul>
<p>Open a PowerShell instance &#8220;as administrator&#8221; and execute these commands:</p>
<ul>
<li>
<blockquote><p>Set-ExecutionPolicy RemoteSigned</p></blockquote>
</li>
<li>
<blockquote><p>$UserCredential = Get-Credential</p></blockquote>
</li>
<li>
<blockquote><p>$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.ofice365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection</p></blockquote>
</li>
<li>
<blockquote><p>Import-PSSession $Session -DisableNameChecking</p></blockquote>
</li>
<li>
<blockquote><p>$opcred = get-credential domain\domainadmin</p></blockquote>
</li>
<li>
<blockquote><p>Get-mailbox -identity user@domain.com | New-MoveRequest -OutBound -RemoteTargetDatabase &#8216;ON-PREM-EXCHANGE-DB&#8217; -RemoteHostName &#8216;mail.domain.com&#8217; -RemoteCredential $opcred -TargetDeliveryDomain &#8216;domain.com&#8217;</p></blockquote>
</li>
</ul>
<p>You can check in the status of your mailbox move:</p>
<ul>
<li>
<blockquote><p>Get-MoveRequest</p></blockquote>
</li>
</ul>
<p>This doesn&#8217;t really tell you a whole lot.&nbsp; It shows the existence of a request, but it doesn&#8217;t give you a real status.&nbsp; A better way is:</p>
<ul>
<li>
<blockquote><p>Get-MoveRequest | Get-MoveRequestStatistics</p></blockquote>
</li>
</ul>
<p>This shows you the stage of the request, the status of the request, the size of the mailbox being moved, and a percentage of progress.&nbsp;</p>
<p>You can queue up as many of these as you like and monitor the progress of all of them using these commands.&nbsp;&nbsp;</p>
<p>When you&#8217;re done you should remove the requests that have been completed or failed:</p>
<ul>
<li>
<blockquote><p>Get-MoveRequest | where {$_.status -eq &#8220;Completed&#8221;| Remove-MoveRequest</p></blockquote>
</li>
<li>
<blockquote><p>Get-MoveRequest | where {$_.status -eq &#8220;Failed&#8221;| Remove-MoveRequest</p></blockquote>
</li>
</ul>
<p>&nbsp;</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/from-office-365-to-on-premises-exchange/">From Office 365 to On-Premises Exchange</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Finding Delegates in Exchange 2010/2013</title>
		<link>https://catastrophe.wiredwolf.com/finding-delegates-in-exchange-2010-2013/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 15 Jan 2018 20:47:39 +0000</pubDate>
				<category><![CDATA[Microsoft Exchange]]></category>
		<guid isPermaLink="false">http://catastrophe.wiredwolf.com/?p=14415</guid>

					<description><![CDATA[<p>There have been numerous occasions where I've gotten complaints about delegates that no longer exist still somehow interfering with mail and calendars.  The logical approach, therefore, is to search for delegates before removing an account to ensure that nothing is left behind that really shouldn't be. I found where a number of people have written  [...]</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/finding-delegates-in-exchange-2010-2013/">Finding Delegates in Exchange 2010/2013</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>There have been numerous occasions where I&#8217;ve gotten complaints about delegates that no longer exist still somehow interfering with mail and calendars.&nbsp; The logical approach, therefore, is to search for delegates before removing an account to ensure that nothing is left behind that really shouldn&#8217;t be.</p>
<p>I found where a number of people have written complicated scripts that invariably (for me anyway) were fraught with errors and unrecognized syntax.</p>
<p>I found a simple solution and a new feature that I wasn&#8217;t aware of:</p>
<blockquote><p>Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne &#8220;NT AUTHORITY\SELF&#8221; -and $_.IsInherited -eq $false} | Out-GridView</p></blockquote>
<p>This is a simple and elegant way to find where any mailbox has a delegate.&nbsp; Also, the output is in a simple &#8220;Grid View&#8221; (feature I didn&#8217;t know about until now) that easily shows:</p>
<p>Identity: (The account delegated out)<br />
User:&nbsp; (The account that has delegate access)<br />
AccessRights: (The level of access)<br />
IsInherited: (if False then was manually applied)<br />
Deny: (self explanitory &#8211; was not delegated with a Deny &#8211; don&#8217;t really see the point of this)</p>
<p>Exchange 2010 doesn&#8217;t seem to be capable of Grid View so if you want a user readable format output to a CSV:</p>
<blockquote><p>Get-Mailbox | Get-MailboxPermission | where {$_.user.tostring() -ne &#8220;NT AUTHORITY\SELF&#8221; -and $_.IsInherited -eq $false} | Export-Csv c:\mailbox-permissions.csv</p></blockquote>
<p>&nbsp;</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/finding-delegates-in-exchange-2010-2013/">Finding Delegates in Exchange 2010/2013</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Office 365 Exchange &#8211; Relay Connectors</title>
		<link>https://catastrophe.wiredwolf.com/office-365-exchange-relay-connectors/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 18 Apr 2017 19:26:52 +0000</pubDate>
				<category><![CDATA[Microsoft Exchange]]></category>
		<category><![CDATA[Microsoft Office 365]]></category>
		<guid isPermaLink="false">http://catastrophe.wiredwolf.com/?p=13338</guid>

					<description><![CDATA[<p>Sending email from a multi-function device or photocopier is a common practice.  Microsoft Office 365 provides two ways to do this: Authenticated SMTP Anonymous SMTP Given that the LAN of most networks is pretty secure we tend towards Anonymous SMTP.  Saves wear and tear when passwords are reset and it's unlikely that a compromised system  [...]</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/office-365-exchange-relay-connectors/">Office 365 Exchange &#8211; Relay Connectors</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sending email from a multi-function device or photocopier is a common practice.&nbsp; Microsoft Office 365 provides two ways to do this:</p>
<ol>
<li>Authenticated SMTP</li>
<li>Anonymous SMTP</li>
</ol>
<p>Given that the LAN of most networks is pretty secure we tend towards Anonymous SMTP.&nbsp; Saves wear and tear when passwords are reset and it&#8217;s unlikely that a compromised system is going to take advantage of the user domain connection back to Exchange Online to send spam.</p>
<p>Set the copier SMTP to:&nbsp;&nbsp; <em>userdomain.</em>mail.protection.outlook.com<br />
Set the copier SMTP port to:&nbsp; 25</p>
<p>In Office 365 -&gt; Admin -&gt; Exchange -&gt; Mail Flow -&gt; Connectors</p>
<p>Set up a static IP connection to listen for anonymous relay.</p>
<p>The post <a href="https://catastrophe.wiredwolf.com/office-365-exchange-relay-connectors/">Office 365 Exchange &#8211; Relay Connectors</a> appeared first on <a href="https://catastrophe.wiredwolf.com">Wiredwolf Canada</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
