Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXOSafeLinksPolicy: Added missing properties CustomNotificationText, EnableOrganizationBranding, UseTranslatedNotificationText #1451

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -12,6 +12,10 @@ function Get-TargetResource
[System.String]
$AdminDisplayName,

[Parameter()]
[System.String]
$CustomNotificationText,

[Parameter()]
[Boolean]
$DeliverMessageAfterScan = $false,
Expand All @@ -32,6 +36,10 @@ function Get-TargetResource
[Boolean]
$EnableForInternalSenders,

[Parameter()]
[Boolean]
$EnableOrganizationBranding = $false,

[Parameter()]
[Boolean]
$EnableSafeLinksForTeams = $false,
Expand All @@ -44,6 +52,10 @@ function Get-TargetResource
[Boolean]
$ScanUrls = $false,

[Parameter()]
[Boolean]
$UseTranslatedNotificationText = $false,

[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
Expand Down Expand Up @@ -126,23 +138,26 @@ function Get-TargetResource
else
{
$result = @{
Identity = $SafeLinksPolicy.Identity
AdminDisplayName = $SafeLinksPolicy.AdminDisplayName
DeliverMessageAfterScan = $SafeLinksPolicy.DeliverMessageAfterScan
DoNotAllowClickThrough = $SafeLinksPolicy.DoNotAllowClickThrough
DoNotRewriteUrls = $SafeLinksPolicy.DoNotRewriteUrls
DoNotTrackUserClicks = $SafeLinksPolicy.DoNotTrackUserClicks
EnableForInternalSenders = $SafeLinksPolicy.EnableForInternalSenders
EnableSafeLinksForTeams = $SafeLinksPolicy.EnableSafeLinksForTeams
IsEnabled = $SafeLinksPolicy.IsEnabled
ScanUrls = $SafeLinksPolicy.ScanUrls
Ensure = 'Present'
GlobalAdminAccount = $GlobalAdminAccount
ApplicationId = $ApplicationId
CertificateThumbprint = $CertificateThumbprint
CertificatePath = $CertificatePath
CertificatePassword = $CertificatePassword
TenantId = $TenantId
Identity = $SafeLinksPolicy.Identity
AdminDisplayName = $SafeLinksPolicy.AdminDisplayName
CustomNotificationText = $SafeLinksPolicy.CustomNotificationText
DeliverMessageAfterScan = $SafeLinksPolicy.DeliverMessageAfterScan
DoNotAllowClickThrough = $SafeLinksPolicy.DoNotAllowClickThrough
DoNotRewriteUrls = $SafeLinksPolicy.DoNotRewriteUrls
DoNotTrackUserClicks = $SafeLinksPolicy.DoNotTrackUserClicks
EnableForInternalSenders = $SafeLinksPolicy.EnableForInternalSenders
EnableOrganizationBranding = $SafeLinksPolicy.EnableOrganizationBranding
EnableSafeLinksForTeams = $SafeLinksPolicy.EnableSafeLinksForTeams
IsEnabled = $SafeLinksPolicy.IsEnabled
ScanUrls = $SafeLinksPolicy.ScanUrls
UseTranslatedNotificationText = $SafeLinksPolicy.UseTranslatedNotificationText
Ensure = 'Present'
GlobalAdminAccount = $GlobalAdminAccount
ApplicationId = $ApplicationId
CertificateThumbprint = $CertificateThumbprint
CertificatePath = $CertificatePath
CertificatePassword = $CertificatePassword
TenantId = $TenantId
}

Write-Verbose -Message "Found SafeLinksPolicy $($Identity)"
Expand Down Expand Up @@ -189,6 +204,10 @@ function Set-TargetResource
[System.String]
$AdminDisplayName,

[Parameter()]
[System.String]
$CustomNotificationText,

[Parameter()]
[Boolean]
$DeliverMessageAfterScan = $false,
Expand All @@ -209,6 +228,10 @@ function Set-TargetResource
[Boolean]
$EnableForInternalSenders,

[Parameter()]
[Boolean]
$EnableOrganizationBranding = $false,

[Parameter()]
[Boolean]
$EnableSafeLinksForTeams = $false,
Expand All @@ -221,6 +244,10 @@ function Set-TargetResource
[Boolean]
$ScanUrls = $false,

[Parameter()]
[Boolean]
$UseTranslatedNotificationText = $false,

[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
Expand Down Expand Up @@ -312,6 +339,10 @@ function Test-TargetResource
[System.String]
$AdminDisplayName,

[Parameter()]
[System.String]
$CustomNotificationText,

[Parameter()]
[Boolean]
$DeliverMessageAfterScan = $false,
Expand All @@ -332,6 +363,10 @@ function Test-TargetResource
[Boolean]
$EnableForInternalSenders,

[Parameter()]
[Boolean]
$EnableOrganizationBranding = $false,

[Parameter()]
[Boolean]
$EnableSafeLinksForTeams = $false,
Expand All @@ -344,6 +379,10 @@ function Test-TargetResource
[Boolean]
$ScanUrls = $false,

[Parameter()]
[Boolean]
$UseTranslatedNotificationText = $false,

[Parameter()]
[ValidateSet('Present', 'Absent')]
[System.String]
Expand Down
Expand Up @@ -3,15 +3,18 @@ class MSFT_EXOSafeLinksPolicy : OMI_BaseResource
{
[Key, Description("The Identity parameter specifies the SafeLinks policy that you want to modify.")] String Identity;
[Write, Description("Specify if this policy should exist or not."), ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Write, Description("The AdminDisplayName parameter specifies a description for the policy. ")] String AdminDisplayName;
[Write, Description("The AdminDisplayName parameter specifies a description for the policy.")] String AdminDisplayName;
[Write, Description("The custom notification text specifies the customized notification text to show to users.")] String CustomNotificationText;
[Write, Description("The DeliverMessageAfterScan parameter specifies whether to deliver email messages only after Safe Links scanning is complete. Valid values are: $true: Wait until Safe Links scanning is complete before delivering the message. $false: If Safe Links scanning can't complete, deliver the message anyway. This is the default value.")] Boolean DeliverMessageAfterScan;
[Write, Description("The DoNotAllowClickThrough parameter specifies whether to allow users to click through to the original URL. Valid values are: $true: The user isn't allowed to click through to the original URL. This is the default value. $false: The user is allowed to click through to the original URL.")] Boolean DoNotAllowClickThrough;
[Write, Description("The DoNotRewriteUrls parameter specifies a URL that's skipped by Safe Links scanning. You can specify multiple values separated by commas.")] String DoNotRewriteUrls[];
[Write, Description("The DoNotTrackUserClicks parameter specifies whether to track user clicks related to links in email messages. Valid values are: $true: User clicks aren't tracked. This is the default value. $false: User clicks are tracked.")] Boolean DoNotTrackUserClicks;
[Write, Description("EnableForInternalSenders $true or $false")] Boolean EnableForInternalSenders;
[Write, Description("The EnableForInternalSenders parameter specifies whether the Safe Links policy is applied to messages sent between internal senders and internal recipients within the same Exchange Online organization.")] Boolean EnableForInternalSenders;
[Write, Description("The EnableOrganizationBranding parameter specifies whether your organization's logo is displayed on Safe Links warning and notification pages.")] Boolean EnableOrganizationBranding;
[Write, Description("The EnableSafeLinksForTeams parameter specifies whether Safe Links is enabled for Microsoft Teams. Valid values are: $true: Safe Links is enabled for Teams. If a protected user clicks a malicious link in a Teams conversation, group chat, or from channels, a warning page will appear in the default web browser. $false: Safe Links isn't enabled for Teams. This is the default value.")] Boolean EnableSafeLinksForTeams;
[Write, Description("This parameter specifies whether the rule or policy is enabled. ")] Boolean IsEnabled;
[Write, Description("The ScanUrls parameter specifies whether to enable or disable the scanning of links in email messages. Valid values are: $true: Scanning links in email messages is enabled. $false: Scanning links in email messages is disabled. This is the default value.")] Boolean ScanUrls;
[Write, Description("The UseTranslatedNotificationText specifies whether to use Microsoft Translator to automatically localize the custom notification text that you specified with the CustomNotificationText parameter.")] Boolean UseTranslatedNotificationText;
[Write, Description("Credentials of the Exchange Global Admin"), EmbeddedInstance("MSFT_Credential")] string GlobalAdminAccount;
[Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId;
[Write, Description("Id of the Azure Active Directory tenant used for authentication.")] String TenantId;
Expand Down
Expand Up @@ -29,6 +29,12 @@ AdminDisplayName
- Description: The AdminDisplayName parameter specifies a
description for the policy.

CustomNotificationText

- Required: No
- Description: The custom notification text specifies the customized
notification text to show to users

DeliverMessageAfterScan

- Required: No
Expand Down Expand Up @@ -69,6 +75,13 @@ EnableForInternalSenders
- Description: This parameter specifies whether the policy is enabled
for internal senders. $true or $false

EnableOrganizationBranding

- Required: No
- Description: The EnableOrganizationBranding parameter specifies whether
your organization's logo is displayed on Safe Links warning and
notification pages.

EnableSafeLinksForTeams

- Required: No
Expand All @@ -94,6 +107,13 @@ ScanUrls
$false: Scanning links in email messages is disabled.
This is the default value.

UseTranslatedNotificationText

- Required: No
- Description: The UseTranslatedNotificationText specifies whether to use
Microsoft Translator to automatically localize the custom notification text
that you specified with the CustomNotificationText parameter.

## Example

```PowerShell
Expand Down