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

Send-SNSMandatoryMomentReport

Creates and emails the mandatory moment report.

Description

Validates the report configuration and saved last-sent value, checks whether the configured reporting period is due, generates the HTML report, and sends it to the configured recipients using Microsoft Graph. Returns false when the report is not due or there are no recipients; returns true after a successful send. If Memberlist is not supplied, it is fetched from Scoutnet.

Syntax

Send-SNSMandatoryMomentReport [[-Configuration] <Object>] [[-Memberlist] <IDictionary>] [[-LastSentValue] <Object>] [[-AsOfDate] <datetime>] [[-FrequencyOverride] <string>] [<CommonParameters>]

Parameters

-Configuration

Type: Object; optional.

Report configuration. Defaults to the current SNS configuration.

-Memberlist

Type: IDictionary; optional.

Optional Scoutnet member list. When omitted, the member list is fetched using the configured member-list credential.

-LastSentValue

Type: Object; optional.

Raw value of the MandatoryMomentReportLastSent Automation variable. An empty, missing or invalid (not a date) value makes the report run regardless of the configured cadence.

-AsOfDate

Type: DateTime; optional.

Date used for reporting cadence, member ages, and moment validity. Defaults to today.

-FrequencyOverride

Type: String; optional.

Examples

Example 1

$lastSent = Get-AutomationVariable -Name 'MandatoryMomentReportLastSent'
$sent = Send-SNSMandatoryMomentReport -Configuration $conf -LastSentValue $lastSent
if ($sent) {
    Set-AutomationVariable -Name 'MandatoryMomentReportLastSent' -Value (Get-Date -Format 'o')
}