Thursday, January 16, 2014

Exchange Online Distribution Group Delivery Management


I recently carried out a large migration and my customer had 700 Distribution Groups. My customer asked me to restrict delivery of emails to the groups by members only. So end users could not email the distribution group unless they were a member. 

So how do I do this for 700 users!! Powershell to the rescue.

Connect to Exchange Online via Powershell and run this command.


  1. Get-Distributiongroup | export-csv C:\users\disti.csv
  2. I then deleted all columns in the csv except for PrimarySmtpAddress and then renamed that column to distiname.
  3. Then run this command
    Import-Csv "C:\Users\sofarrell\Desktop\disti.csv" | Foreach-Object{get-distributiongroup $_.distiName | Set-distributiongroup -AcceptMessagesOnlyFromDLMembers $_.distiname}
  4. And then run this command
    Import-Csv "C:\Users\sofarrell\Desktop\disti.csv" | Foreach-Object{get-distributiongroup $_.distiName | Set-distributiongroup -AcceptMessagesOnlyFromSendersOrMembers $_.distiname}
Job done , Happy Customer.



Monday, January 6, 2014

Exchange Online Mailbox only has 25gb Storage Quota

Some of my customers mailboxes were still displaying 25gb as their mailbox storage quota size instead of 50gb. 

So the fix is quite simple.

Firstly connect to Exchange Online via Powershell.


1. Set-ExecutionPolicy unrestricted 
2. $LiveCred = Get-Credential 
3. $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection 
4. Import-PSSession $Session

Then run the following CMDlet which will increase the size to 50gb for all user mailboxes:

Get-mailbox -resultsize unlimited | Set-Mailbox -ProhibitSendReceiveQuota 50GB -ProhibitSendQuota 49.75GB -IssueWarningQuota 49.5GB

Thursday, January 2, 2014

Google Apps - Office365 email co-existence


I recently migrated a large Google Apps tenant to Microsoft Office365 (10k + users). Google require a verification code to set up forwarding to a user's .onmicrosoft.com alias. Which means it is not possible to automate the forwarding from Google Apps to Office365.

So the way we enable co-existence is as follows.

Domain Name : Contoso.com 


  1. Add an alias domain into Google Apps. Relay.contoso.com. Google state that this can take up to 24 hours. I have seen it complete in 10 hours. This will add an alias to all Google Apps users  user@relay.contoso.com
  2. Export all Office365 user's userprincipal names to a csv.
     
  3. Enable forwarding for all users in Office365 to their smtpaddress@relay.contoso.com. This is done by using the following powershell command in Exchange Online.
    Import-Csv "C:\Users\sofarrell\Desktop\RelayAddress.csv" | Foreach-Object{Get-Mailbox $_.DisplayName | Set-Mailbox -ForwardingSMTPAddress $_.MailAddress -DeliverToMailboxAndForward $true} -verbose
  4. When the last mailbox has migrated we then remove the forwarding and edit the delivertomailboxandforward value.
    Get-Mailbox | Set-Mailbox -ForwardingSmtpAddress $null -delivertomailboxandforward $false