Create a Cloud distribution group

Hi,

We'd like to create a form in Active Roles web client that allows the creation of an Exchange online distribution group with the command New-DistributionGroup without creating an on-premise AD object in a hybrid environment.  There isn't an out-of-the-box solution for this but I'm hoping we can use the method of creating a cloud shared mailbox as a template. I tested it last year but I can't find the article now on how to do it and deleted everything I'd done when I found an alternative.  All we're looking for is for helpdesk staff to type in a name and select an owner from AD that will create a cloud group, which the owner can then populate themselves.  Has anyone else tried to do this?  We've got a script I think will work for the creation, the problem is getting some kind of form and/or command to trigger the creation using a workflow or provisioning policy and that's where I'm stumbling.

Thanks in advance

$owner = <who is going to manage list>
$newgroup = <new distribution group name>
$grouptype = "Distribution"
$PrimaryEmail = ($newgroup).replace(" ","") + "@domain"
New-DistributionGroup -Name $newgroup -PrimarySmtpAddress $PrimaryEmail -managedby $owner -Type $grouptype
Parents
  • Though perhaps somewhat unorthodox, you could create 2 virtual attributes and associate them with AD OUs.

    Example:

    edsva_New_DL_Name

    edsva_New_DL_Owner (make this one DN syntax)

    Create a new command calling a property editing form for OUs and add these to it.

    Create a change workflow that looks for an edit to these properties and triggers your group creation script as a script activity.

    Here's a snippet:

    Function CreateNewCloudDL ($Request)
    {
    $owner = $Request.get("edsva_New_DL_Owner")
    $newgroup = $Request.get("edsva_New_DL_Name")
    $grouptype = "Distribution"
    $PrimaryEmail = ($newgroup).replace(" ","") + "@domain"
    New-DistributionGroup -Name $newgroup -PrimarySmtpAddress $PrimaryEmail -managedby $owner -Type $grouptype

    }

    You would need to include the "O365 script execution configuration" activity in your workflow to establish the PoSh session with your tenant.

  • Hi Johnny,

    Thanks very much for your quick reply, I think I understand this.  It might a few goes to get my head around it but I'll give it a go.

    Cheers!

Reply Children