Skip to main content

How to use PowerShell to Change the Email Address of Office 365 Groups


One of the odd things about Office 365 is how much you have to resort to PowerShell to get things done. That's currently the case with the Office365 Groups, a recently introduced type of group that works particularly well across all of the Office365 applications. 

I've been setting a few things up with Office365 groups lately and I've had two instances where I needed to do some renames. Once was when the people who asked for the group changed their mind about the name and the other was when I wanted to rebuild an existing sharepoint site (and reuse the name).

In both cases, I was able to change the name but the email address itself was greyed out. 

The Solution is to use PowerShell

Start Powershell by clicking Start and typing PowerShell, then Right-click on the icon and run as Administrator.


In the console that appears, type;

Set-ExecutionPolicy RemoteSigned

This elevates some privileges. You'll need to choose Y and press enter. 

Next, you'll want to sign into your Office 365 account as an administrator. Type

$UserCredential = Get-Credential

and press enter.  You'll be prompted for a user name and password.

Next we need to connect a session to Microsoft Exchange in the cloud.

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

and you'll want to import that session.

Import-PSSession $Session

Changing the Email Address

This last command is the one that changes the email address but you'll need to know your group name and the new email address first.

Don't type this, you'll want to change the bold bits.

Set-UnifiedGroup -Identity "GroupName" -PrimarySmtpAddress GroupEmailAddress -RequireSenderAuthenticationEnabled $false

So, in our case, we want to change InformationTechnology1@mycompany.com.au to InformationTechnology@mycompany.com.au.  The group name is Information Technology. This means that the command to use would be;

Set-UnifiedGroup -Identity "Information Technology" -PrimarySmtpAddress informationtechnology@mycompany.com.au -RequireSenderAuthenticationEnabled $false

That's it. If you switch back to the admin screen and refresh, you'll see that the group now has the correct email address.

If you want to change more groups, you can simply run that last command line again with different parameters (all the earlier lines were just set up lines).  If you've finished, you can simply close PowerShell.

Comments

Anonymous said…
Perfect instructions, this greatly helped my issue with some domain groups
Thank you :) +++++++++++++

Popular posts from this blog

How to Change Your Notification Options for New Lotus Notes Mail in version 8.x

Don't worry, I'm not patronizing you (my readers), I just decided to re-document this for one of our internal users and thought you might want to be able to use it in your own user documentation. WHAT IS THIS DOCUMENT ABOUT? Some people who don't get a lot of mail, like to be notified when such an event occurs. Notification can be; via a sound via a pop-up box via the system tray (where the computer clock is) The pop up box looks like this; Other people, who like myself, get too much mail would rather not be notified. The aim of this document is to tell you how (and where) to turn these options on and off. CHANGING YOUR SETTINGS To change your settings from the Notes 8.x client; On the Menu, click File , then Preferences... On the left hand side , click on the little plus sign to the left of Mail to expand the options. Click on the option marked Sending and Receiving . In the middle section, under receiving, you can control your notifications. If you untick the box mark

How to Create an Auto-Response Mail Message in Lotus Notes 8.5.3+

Why would you do this? Suppose that you have an externally accessible generic email address for your company; support@mycompany.com or info@mycompany.com. You might expose this to the web and allow people to send messages to you. Setting up an auto-response email will tell the senders that their message reached its destination and that it will be dealt with accordingly.  It's also good practice to include links to FAQs or other useful information. Why 8.5.3 The techniques we'll be using here work in older versions of Notes but some of the options seem to have moved around in 8.5.3.  I figured it was a good time to show you where they've moved to. The Procedure Start Domino Designer and open the Mail file to be modified.  A really quick way to do this is to right-click on the application tab and choose "Open in Designer". In the Left hand panel of designer, expand Code and then double-click Agents.  A new window should appear. Click the action

How to Do a Mail Merge to Email using Lotus Notes

Why do one? In today's "green" world, it makes much better sense to send out emails than letters but you still want to personalize them. Sadly, by itself Lotus Notes doesn't support mail merge to email. Of course, we know that outlook does (but then it lets anyone and anything send emails for you - even when you don't want them to). So, how to do it in Notes? OpenNTF The first port of call is OpenNTF ( http://www.openntf.org/ ). This place is full of great things but most of them are really badly documented. Still, these guys give things away for free and they develop in their spare time, so we should be grateful for what we get. There's a great little project there called MailMerge Excel to Notes . Go there, click on releases and download the ZIP file. Getting to the Code The installation is tricky though I've noted that since I asked the author about the install, it's been updated (so maybe these steps are less necessary). Unzip the files to somewher