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

EXOQuarantinePolicy not including Global Policy #3285

Closed
titlerequired opened this issue May 10, 2023 · 4 comments · Fixed by #3294, #3312 or #3318
Closed

EXOQuarantinePolicy not including Global Policy #3285

titlerequired opened this issue May 10, 2023 · 4 comments · Fixed by #3294, #3312 or #3318
Labels
Enhancement New feature or request Exchange Online

Comments

@titlerequired
Copy link

The global quarantine settings are not exported in the EXOQuarantinePolicy resource.

To export these manually in PowerShell you must use, Get-QuarantinePolicy -QuarantinePolicyType GlobalQuarantinePolicy

Is there a proces to export these or will it be included in future?

@titlerequired
Copy link
Author

I've updated the module, and the Global Policy is included now in an export, but it doesn't seem to have pulled settings like Notification Frequency.
From PowerShell (get-quarantinepolicy -QuarantinePolicyType globalquarantinepolicy)
CustomDisclaimer : EndUserSpamNotificationFrequency : 04:00:00 EndUserSpamNotificationFrequencyInDays : 3 EndUserSpamNotificationCustomFromAddress : MultiLanguageCustomDisclaimer : {} EsnCustomSubject : {} MultiLanguageSenderName : {} MultiLanguageSetting : {} OrganizationBrandingEnabled : True

From Export
EXOQuarantinePolicy "EXOQuarantinePolicy-DefaultGlobalTag" { ApplicationId = $ConfigurationData.NonNodeData.ApplicationId; CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint; Ensure = "Absent"; Identity = "DefaultGlobalTag"; TenantId = $OrganizationName; }

@titlerequired
Copy link
Author

titlerequired commented May 12, 2023

Changing the following has exported the settings.

C:\Program Files\WindowsPowerShell\Modules\Microsoft365DSC\1.23.510.1\DSCResources\MSFT_EXOQuarantinePolicy\MSFT_EXOQuarantinePolicy.psm1

Line 99 changing:
if ($Identity -eq 'DefaultGlobalPolicy')

To

if ($Identity -eq 'DefaultGlobalTag')

Line 211 Adding:

CustomDisclaimer = $quarantinePolicy.CustomDisclaimer EndUserSpamNotificationFrequency = $QuarantinePolicy.EndUserSpamNotificationFrequency EndUserSpamNotificationFrequencyInDays = $QuarantinePolicy.EndUserSpamNotificationFrequencyInDays EsnCustomSubject = $QuarantinePolicy.EsnCustomSubject

Export now includes:

EXOQuarantinePolicy "EXOQuarantinePolicy-DefaultGlobalTag" { ApplicationId = $ConfigurationData.NonNodeData.ApplicationId; CertificateThumbprint = $ConfigurationData.NonNodeData.CertificateThumbprint; EndUserQuarantinePermissionsValue = 0; EndUserSpamNotificationFrequency = "04:00:00"; EndUserSpamNotificationFrequencyInDays = 3; Ensure = "Present"; Identity = "DefaultGlobalTag"; OrganizationBrandingEnabled = $True; TenantId = $OrganizationName; }

@ricmestre
Copy link
Contributor

@NikCharlebois it seems that when exporting the identity gets swapped to a different name, that's easy to solve but I didn't notice that the global policy has additional properties from the regular policies, should this be solved by creating a separate resource? Or just add them as parameters to get/set/test and deal with them depending on if we're setting up the global policy or not?

@max-freshmethod
Copy link
Contributor

max-freshmethod commented May 16, 2023

@ricmestre @titlerequired
I made a pull request that should cover additional properties of GlobalQurantinePolicy.
Waiting for review.
#3312

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment