3

I have a O365 with Exchange, and a local AD.

I want to manage distribution groups and distribution groups members via PS scripts (that will run by scheduled task), that look users' AD attributes (don't know which attributes right now).

The script will be hosted in the local AD.

So If I want to manage distribution groups (DG), I can use PS to connect to my O365, and then manage DG. But I don't know If i'll be able to check AD users' attributes from a PS Session on O365 ?

So I'm wondering what is the best way to handle this.

Can I just manage DG from the AD without the need to connect to O365 Exchange ?

This means that I create AD Group, enable mail, and put users I want, in. Then, the replication will synchronize AD Group with O365 (with DirSync if I'm right).

Do these groups will be see as "Distribution Group" in O365 Exchange view ? And people will be able to email these DG ?
Or Do I have to do some stuff in O365 Exchange side ?

To be clear, question is : Can I create a DG from local AD server in PS (Create-Group), by setting the mail address (and others attributes I dont now yet), and then Exchange will see it as a good DG and I'll be able to send email to it ?

Feel free to ask for more details if needed. hope I'm clear enough.

2 Answers 2

4

This means that I create AD Group, enable mail, and put users I want, in. Then, the replication will synchronize AD Group with O365 (with DirSync if I'm right).

That's pretty much it, yes. There's plenty of resources out there covering the installation and setup of DirSync, and you may refer to this table of attributes that are synced from on-premises AD to Office 365. You can manually trigger a sync of dirsync by opening DirSyncConfigShell and running Start-OnlineCoexistenceSync

So you can create a DG on-premises, set the Mail and ProxyAddresses attributes and then DirSync will create a synchronised DG in O365. This group will show up in the ECP > Groups, the same as a group which is created online. However, since the group was created on-premises it must be managed on-premises (as the sync is one-way). Trying to alter the attributes online will give you:

The action 'Set-DistributionGroup', 'PrimarySmtpAddress', can't be performed on the object 'IT-team' because the object is being synchronized from your on-premises organization.

There is no need to mail-enable the DG, as DGs are mail-enabled by default at creation.

To be clear, question is : Can I create a DG from local AD server in PS (Create-Group), by setting the mail address (and others attributes I dont now yet), and then Exchange will see it as a good DG and I'll be able to send email to it ?

Broadly yes. You'll have to use a PS cmdlet that actually exists though, ie New-ADGroup and specify -GroupCategory Distribution

0

Ok, I've just found the good article here.

So I can do all the stuff I want with local AD Server : Create/Delete/Manage Groups.
But if I want the group I created to be a mail one, I have to use this command with ExchangeManagementShell (EMS) (or PS Session with O365 I guess) :

Enable-DistributionGroup -Identity MyDistributionGroup

Then If I use the AD to edit my group, I see updates on Exchange Admin Center (or ECP).

If someone have any ideas about how can I go through this need, because I don't want to depend of a PS Session to manage groups and members.

Edit : Do you think the best practise to be non-dependent of the connection, would be creating all groups I need, then, open a PSSession with O365, and just send all the Enable-DistributionGroup I need ? (I could save those commands in an array)

4
  • You don't need to use powershell to mail-enable the DG. You can just create the DG on-premises and sync it up with Dirsync. I'm surprised you haven't been able to test this yourself? Aug 18, 2014 at 11:16
  • I did not have a test tenant within O365. I test it with my Exchange 2013. If I just created a mail-enabled DG, Exchange didn't see anything, but if I used the mail-enable cmdlet on the Exchanger server, I could see the DG on the ECP.
    – Nico
    Aug 19, 2014 at 6:47
  • 1
    If you create a distribution group in on-premises AD , then run dirsync, the DG will show up in the Office 365 ECP. Try it! Aug 21, 2014 at 14:04
  • I must agree with you, since I have not any o365 tenant available anymore ... If you decide to post an answer with a little explanation about how to 'run dirsync', I would accept it as an answer with pleasure. (The project is ended, and I cannot use o365, i'm sorry)
    – Nico
    Aug 21, 2014 at 14:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .