Synkronisering av användarkonton och e-postlistor från Scoutnet till Office 365
Creates and emails the mandatory moment report.
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.
Send-SNSMandatoryMomentReport [[-Configuration] <Object>] [[-Memberlist] <IDictionary>] [[-LastSentValue] <Object>] [[-AsOfDate] <datetime>] [[-FrequencyOverride] <string>] [<CommonParameters>]
Type: Object; optional.
Report configuration. Defaults to the current SNS configuration.
Type: IDictionary; optional.
Optional Scoutnet member list. When omitted, the member list is fetched using the configured member-list credential.
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.
Type: DateTime; optional.
Date used for reporting cadence, member ages, and moment validity. Defaults to today.
Type: String; optional.
$lastSent = Get-AutomationVariable -Name 'MandatoryMomentReportLastSent'
$sent = Send-SNSMandatoryMomentReport -Configuration $conf -LastSentValue $lastSent
if ($sent) {
Set-AutomationVariable -Name 'MandatoryMomentReportLastSent' -Value (Get-Date -Format 'o')
}