Office365-Scoutnet-synk

Synkronisering av användarkonton och e-postlistor från Scoutnet till Office 365


Project maintained by Scouterna Hosted on GitHub Pages — Theme by mattgraham

SNSUpdateExchangeDistributionGroups

Updates exchange distribution groups based on scoutnet maillists.

Description

Fetches the distribution groups members and updates corressponding distribution groups based on the info from scoutnet. As all members of an distribution group must be present in exchange as user or contact, contacts will be created for external addresses. Logs elapsed time for the main data-fetching and synchronization phases.

A rule in MailListSettings without ‘source’ uses a Scoutnet maillist (scoutnet_list_id). With source = ‘troop_roles’ (troops = @(@{ name; id; roles })) or source = ‘group_roles’ (roles) the leaders are instead selected by their roles in Scoutnet, in the same way as for Update-SNMicrosoft365Group, and roles = ‘*’ matches any role. Role based rules use ledare_synk_option to decide which address is added. scoutnet_list_id is not used. group_type = ‘security’ or ‘distribution’ (works for all sources) creates the group as a mail-enabled security group or a regular distribution list with New-DistributionGroup when it does not exist. display_name (the visible name, since the rule key is normally the e-mail address) and mail_nickname (alias) must be specified to create a group, and so must primary_smtp_address unless the rule key is an e-mail address, which is then used as the address; otherwise a warning is logged and the group is skipped while the other lists continue. allow_external_senders (default $true) lets senders outside the organization mail the group (RequireSenderAuthenticationEnabled = $false); it is applied to existing groups too. Group settings are handled by Set-SNSMailListSetting: send_as (accounts/groups given Send As), require_moderation, moderators, bypass_moderation, moderation_notification (Never/Internal/Always, default Never) and member_join_restriction (default Closed) / member_depart_restriction (default Closed). An existing group of another type is not changed. Without group_type the group must already exist. add_prefix = $true creates (or updates) an Exchange mail flow rule that prepends a prefix to the subject of mail sent to the group. The prefix is prefix_text, or [display_name] when prefix_text is not specified. A troop rule with unit_members = $true also adds the members of that unit (the ‘unit’ object of the member) using scouter_synk_option, so a list can hold the scouts of a troop plus its leaders. Roles are optional then.

Syntax

SNSUpdateExchangeDistributionGroups -ValidationHash <string> [-Configuration <Object>] [-ReturnMaildata] [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters

-ValidationHash

Type: String; required.

Hash value used to validate if scoutnet is updated.

-Configuration

Type: Object; optional.

Configuration to use. If not specified the cached configuration will be used.

-ReturnMaildata

Type: SwitchParameter; optional.

Enables return of a Hashtable with mailaddresses for the list. Can be used together with -WhatIf to check settings.