From ed4c604f8969298eb02f0274ccbe3449153083ed Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Mon, 27 Mar 2023 11:38:02 -0400 Subject: [PATCH 01/12] O365OrgSettings: Added support for the Viva Insights and Briefing email settings --- CHANGELOG.md | 5 + .../MSFT_O365OrgSettings.psm1 | 115 ++++++++++++++++-- .../MSFT_O365OrgSettings.schema.mof | 5 + .../Dependencies/Manifest.psd1 | 2 +- 4 files changed, 116 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2496762611..b0119a69ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change log for Microsoft365DSC +# UNRELEASED + +* O365OrgSettings + * Added support for the Viva Insights and Briefing email settings. + # 1.23.322.1 * AADRoleSetting diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 index e41de4fc71..84520b4445 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 @@ -17,6 +17,26 @@ function Get-TargetResource [System.Boolean] $M365WebEnableUsersToOpenFilesFrom3PStorage, + [Parameter()] + [System.Boolean] + $MicrosoftVivaBriefingEmail, + + [Parameter()] + [System.Boolean] + $VivaInsightsWebExperience, + + [Parameter()] + [System.Boolean] + $VivaInsightsDigestEmail, + + [Parameter()] + [System.Boolean] + $VivaInsightsOutlookAddInAndInlineSuggestions, + + [Parameter()] + [System.Boolean] + $VivaInsightsScheduleSendSuggestions, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] @@ -56,6 +76,9 @@ function Get-TargetResource -InboundParameters $PSBoundParameters ` -ProfileName 'v1.0' + $ConnectionMode = New-M365DSCConnection -Workload 'ExchangeOnline' ` + -InboundParameters $PSBoundParameters + #Ensure the proper dependencies are installed in the current environment. Confirm-M365DSCDependencies @@ -81,17 +104,33 @@ function Get-TargetResource $CortanaId = '0a0a29f9-0a25-49c7-94bf-c53c3f8fa69d' $CortanaEnabledValue = Get-MgServicePrincipal -Filter "appId eq '$CortanaId'" -Property 'AccountEnabled' + # Microsoft Viva Briefing Email + $vivaBriefingEmailValue = $false + $currentBriefingConfig = Get-DefaultTenantBriefingConfig + if ($currentBriefingConfig.PrivacyMode -eq 'opt-in') + { + $vivaBriefingEmailValue = $true + } + + # Viva Insightss settings + $currentVivaInsightsSettings = Get-DefaultTenantMyAnalyticsFeatureConfig + return @{ - IsSingleInstance = 'Yes' - CortanaEnabled = $CortanaEnabledValue.AccountEnabled - M365WebEnableUsersToOpenFilesFrom3PStorage = $M365WebEnableUsersToOpenFilesFrom3PStorageValue.AccountEnabled - Ensure = 'Present' - Credential = $Credential - ApplicationId = $ApplicationId - TenantId = $TenantId - ApplicationSecret = $ApplicationSecret - CertificateThumbprint = $CertificateThumbprint - Managedidentity = $ManagedIdentity.IsPresent + IsSingleInstance = 'Yes' + CortanaEnabled = $CortanaEnabledValue.AccountEnabled + M365WebEnableUsersToOpenFilesFrom3PStorage = $M365WebEnableUsersToOpenFilesFrom3PStorageValue.AccountEnabled + MicrosoftVivaBriefingEmail = $vivaBriefingEmailValue + VivaInsightsWebExperience = $currentVivaInsightsSettings.IsDashboardEnabled + VivaInsightsDigestEmail = $currentVivaInsightsSettings.IsDigestEmailEnabled + VivaInsightsOutlookAddInAndInlineSuggestions = $currentVivaInsightsSettings.IsAddInEnabled + VivaInsightsScheduleSendSuggestions = $currentVivaInsightsSettings.IsScheduleSendEnabled + Ensure = 'Present' + Credential = $Credential + ApplicationId = $ApplicationId + TenantId = $TenantId + ApplicationSecret = $ApplicationSecret + CertificateThumbprint = $CertificateThumbprint + Managedidentity = $ManagedIdentity.IsPresent } } catch @@ -124,6 +163,26 @@ function Set-TargetResource [System.Boolean] $M365WebEnableUsersToOpenFilesFrom3PStorage, + [Parameter()] + [System.Boolean] + $MicrosoftVivaBriefingEmail, + + [Parameter()] + [System.Boolean] + $VivaInsightsWebExperience, + + [Parameter()] + [System.Boolean] + $VivaInsightsDigestEmail, + + [Parameter()] + [System.Boolean] + $VivaInsightsOutlookAddInAndInlineSuggestions, + + [Parameter()] + [System.Boolean] + $VivaInsightsScheduleSendSuggestions, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] @@ -193,6 +252,22 @@ function Set-TargetResource Update-MgservicePrincipal -ServicePrincipalId $($CortanaEnabledValue.Id) ` -AccountEnabled:$CortanaEnabled } + + # Microsoft Viva Briefing Email + Write-Verbose -Message "Updating Microsoft Viva Briefing Email settings." + $briefingValue = 'opt-out' + if ($MicrosoftVivaBriefingEmail) + { + $briefingValue = 'opt-in' + } + Set-DefaultTenantBriefingConfig -PrivacyMode $briefingValue | Out-Null + + # Viva Insights + Write-Verbose -Message "Updating Viva Insights settings." + Set-DefaultTenantMyAnalyticsFeatureConfig -Feature "Dashboard" -IsEnabled $VivaInsightsWebExperience | Out-Null + Set-DefaultTenantMyAnalyticsFeatureConfig -Feature "Digest-email" -IsEnabled $VivaInsightsDigestEmail | Out-Null + Set-DefaultTenantMyAnalyticsFeatureConfig -Feature "Add-In" -IsEnabled $VivaInsightsOutlookAddInAndInlineSuggestions | Out-Null + Set-DefaultTenantMyAnalyticsFeatureConfig -Feature "Scheduled-send" -IsEnabled $VivaInsightsScheduleSendSuggestions | Out-Null } function Test-TargetResource @@ -214,6 +289,26 @@ function Test-TargetResource [System.Boolean] $M365WebEnableUsersToOpenFilesFrom3PStorage, + [Parameter()] + [System.Boolean] + $MicrosoftVivaBriefingEmail, + + [Parameter()] + [System.Boolean] + $VivaInsightsWebExperience, + + [Parameter()] + [System.Boolean] + $VivaInsightsDigestEmail, + + [Parameter()] + [System.Boolean] + $VivaInsightsOutlookAddInAndInlineSuggestions, + + [Parameter()] + [System.Boolean] + $VivaInsightsScheduleSendSuggestions, + [Parameter()] [ValidateSet('Present', 'Absent')] [System.String] diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.schema.mof b/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.schema.mof index ebec69934e..e50c01e0c9 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.schema.mof +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.schema.mof @@ -4,6 +4,11 @@ class MSFT_O365OrgSettings : OMI_BaseResource [Key, Description("Specifies the resource is a single instance, the value must be 'Yes'"), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance; [Write, Description("Allow Cortana in windows 10 (version 1909 and earlier), and the Cortana app on iOS and Android, to access Microsoft-hosted data on behalf of people in your organization.")] Boolean CortanaEnabled; [Write, Description("Let users open files stored in third-party storage services in Microsoft 365 on the Web.")] Boolean M365WebEnableUsersToOpenFilesFrom3PStorage; + [Write, Description("Specifies whether or not to let people in your organization receive Briefing email from Microsoft Viva.")] Boolean MicrosoftVivaBriefingEmail; + [Write, Description("Specifies whether or not to allow users to have access to use the Viva Insights web experience.")] Boolean VivaInsightsWebExperience; + [Write, Description("Specifies whether or not to allow users to have access to use the Viva Insights digest email feature.")] Boolean VivaInsightsDigestEmail; + [Write, Description("Specifies whether or not to allow users to have access to use the Viva Insights Outlook add-in and inline suggestions.")] Boolean VivaInsightsOutlookAddInAndInlineSuggestions; + [Write, Description("Specifies whether or not to allow users to have access to use the Viva Insights schedule send suggestions feature.")] Boolean VivaInsightsScheduleSendSuggestions; [Write, Description("Since there is only one setting availble, this must be set to 'Present'"), ValueMap{"Present"}, Values{"Present"}] String Ensure; [Write, Description("Credentials of the Global Admin"), EmbeddedInstance("MSFT_Credential")] string Credential; [Write, Description("Id of the Azure Active Directory application to authenticate with.")] String ApplicationId; diff --git a/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 b/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 index 599ee0d958..1a5d3caaae 100644 --- a/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 +++ b/Modules/Microsoft365DSC/Dependencies/Manifest.psd1 @@ -6,7 +6,7 @@ }, @{ ModuleName = 'ExchangeOnlineManagement' - RequiredVersion = '3.1.0' + RequiredVersion = '3.2.0' }, @{ ModuleName = 'Microsoft.Graph.Applications' From 5a94092f5fde8a5e2614c11c958bfdcf845b309b Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Mon, 27 Mar 2023 12:38:35 -0400 Subject: [PATCH 02/12] Fixes Unit Tests --- .../Microsoft365DSC.O365OrgSettings.Tests.ps1 | 78 +++++++++++++++++-- 1 file changed, 70 insertions(+), 8 deletions(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 index f51be24747..27b1e7f1fd 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 @@ -38,16 +38,27 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-MgServicePrincipal -MockWith { } + + Mock -CommandName Set-DefaultTenantBriefingConfig -MockWith { + } + + Mock -CommandName Set-DefaultTenantMyAnalyticsFeatureConfig -MockWith { + } } # Test contexts Context -Name 'When Org Settings are already in the Desired State' -Fixture { BeforeAll { $testParams = @{ - IsSingleInstance = 'Yes' - M365WebEnableUsersToOpenFilesFrom3PStorage = $False; - Ensure = 'Present' - Credential = $Credential + IsSingleInstance = 'Yes' + M365WebEnableUsersToOpenFilesFrom3PStorage = $False + MicrosoftVivaBriefingEmail = $True + VivaInsightsWebExperience = $true + VivaInsightsDigestEmail = $true + VivaInsightsOutlookAddInAndInlineSuggestions = $true + VivaInsightsScheduleSendSuggestions = $true + Ensure = 'Present' + Credential = $Credential } Mock -CommandName Get-MgServicePrincipal -MockWith { @@ -55,6 +66,21 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { AccountEnabled = $False } } + + Mock -CommandName Get-DefaultTenantBriefingConfig -MockWith { + return @{ + PrivacyMode = 'opt-in' + } + } + + Mock -CommandName Get-DefaultTenantMyAnalyticsFeatureConfig -MockWith { + return @{ + IsDashboardEnabled = $true + IsDigestEmailEnabled = $true + IsAddInEnabled = $true + IsScheduleSendEnabled = $true + } + } } It 'Should return Present from the Get method' { @@ -71,10 +97,15 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Context -Name 'When Org Settings NOT in the Desired State' -Fixture { BeforeAll { $testParams = @{ - IsSingleInstance = 'Yes' - M365WebEnableUsersToOpenFilesFrom3PStorage = $True; - Ensure = 'Present' - Credential = $Credential + IsSingleInstance = 'Yes' + M365WebEnableUsersToOpenFilesFrom3PStorage = $True + MicrosoftVivaBriefingEmail = $True + VivaInsightsWebExperience = $true + VivaInsightsDigestEmail = $true + VivaInsightsOutlookAddInAndInlineSuggestions = $true + VivaInsightsScheduleSendSuggestions = $true + Ensure = 'Present' + Credential = $Credential } Mock -CommandName Get-MgServicePrincipal -MockWith { @@ -82,6 +113,21 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { AccountEnabled = $False } } + + Mock -CommandName Get-DefaultTenantBriefingConfig -MockWith { + return @{ + PrivacyMode = 'opt-in' + } + } + + Mock -CommandName Get-DefaultTenantMyAnalyticsFeatureConfig -MockWith { + return @{ + IsDashboardEnabled = $true + IsDigestEmailEnabled = $true + IsAddInEnabled = $true + IsScheduleSendEnabled = $true + } + } } It 'Should return Present from the Get method' { @@ -113,6 +159,22 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { AccountEnabled = $False } } + + Mock -CommandName Get-DefaultTenantBriefingConfig -MockWith { + return @{ + PrivacyMode = 'opt-in' + } + } + + Mock -CommandName Get-DefaultTenantMyAnalyticsFeatureConfig -MockWith { + return @{ + IsDashboardEnabled = $true + IsDigestEmailEnabled = $true + IsAddInEnabled = $true + IsScheduleSendEnabled = $true + } + } + $result = Export-TargetResource @testParams $result | Should -Not -BeNullOrEmpty } From eaa8ea6950af1a8f41b3ef8c0449c552076bdc2e Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 19 Apr 2023 15:57:04 -0400 Subject: [PATCH 03/12] Fix Example --- .../Resources/O365OrgSettings/1-ConfigureOrgSettings.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/Modules/Microsoft365DSC/Examples/Resources/O365OrgSettings/1-ConfigureOrgSettings.ps1 b/Modules/Microsoft365DSC/Examples/Resources/O365OrgSettings/1-ConfigureOrgSettings.ps1 index 2dc5aa8956..e96b1ac798 100644 --- a/Modules/Microsoft365DSC/Examples/Resources/O365OrgSettings/1-ConfigureOrgSettings.ps1 +++ b/Modules/Microsoft365DSC/Examples/Resources/O365OrgSettings/1-ConfigureOrgSettings.ps1 @@ -18,7 +18,6 @@ Configuration Example O365OrgSettings 'O365OrgSettings' { Credential = $Credscredential; - Ensure = "Present"; IsSingleInstance = "Yes"; M365WebEnableUsersToOpenFilesFrom3PStorage = $False; } From 9d43ecb661e2e7eb1d363d42fd7e3e3247e4ad52 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 19 Apr 2023 16:21:14 -0400 Subject: [PATCH 04/12] Update Microsoft365.psm1 --- Tests/Unit/Stubs/Microsoft365.psm1 | 1055 ++-------------------------- 1 file changed, 57 insertions(+), 998 deletions(-) diff --git a/Tests/Unit/Stubs/Microsoft365.psm1 b/Tests/Unit/Stubs/Microsoft365.psm1 index bbb8c82229..a16e55c022 100644 --- a/Tests/Unit/Stubs/Microsoft365.psm1 +++ b/Tests/Unit/Stubs/Microsoft365.psm1 @@ -143,31 +143,10 @@ function Get-AdminAuditLogConfig ) } -function Get-AdministrativeUnit -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object] - $Identity - ) -} function Get-AntiPhishPolicy { [CmdletBinding()] param( - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Impersonation, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Advanced, - [Parameter()] [System.Object] $Identity, @@ -220,15 +199,6 @@ function Get-ApplicationAccessPolicy $Identity ) } -function Get-AtpPolicyForO365 -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Object] - $Identity - ) -} function Get-AuditConfig { [CmdletBinding()] @@ -1154,50 +1124,6 @@ function Get-RoleGroupMember $ResultSize ) } -function Get-SafeAttachmentPolicy -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Object] - $Identity - ) -} -function Get-SafeAttachmentRule -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Object] - $Identity, - - [Parameter()] - [System.Object] - $State - ) -} -function Get-SafeLinksPolicy -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Object] - $Identity - ) -} -function Get-SafeLinksRule -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Object] - $Identity, - - [Parameter()] - [System.Object] - $State - ) -} function Get-ServicePrincipal { [CmdletBinding()] @@ -1515,21 +1441,9 @@ function New-AntiPhishPolicy [System.Management.Automation.SwitchParameter] $MakeDefault, - [Parameter()] - [System.Object] - $DmarcRejectAction, - - [Parameter()] - [System.Int32] - $PhishThresholdLevel, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - [Parameter()] [System.Boolean] - $EnableTargetedDomainsProtection, + $EnableUnauthenticatedSender, [Parameter()] [System.Boolean] @@ -1547,129 +1461,37 @@ function New-AntiPhishPolicy [System.String] $Name, - [Parameter()] - [System.Object] - $TargetedDomainsToProtect, - [Parameter()] [System.Boolean] $EnableSpoofIntelligence, - [Parameter()] - [System.Boolean] - $EnableSimilarUsersSafetyTips, - - [Parameter()] - [System.Object] - $ExcludedDomains, - - [Parameter()] - [System.Object] - $MailboxIntelligenceProtectionAction, - - [Parameter()] - [System.Object] - $TargetedDomainActionRecipients, - [Parameter()] [System.Object] $DmarcQuarantineAction, - [Parameter()] - [System.Boolean] - $EnableMailboxIntelligence, - - [Parameter()] - [System.String] - $TargetedDomainQuarantineTag, - - [Parameter()] - [System.String] - $SimilarUsersSafetyTipsCustomText, - - [Parameter()] - [System.Object] - $ImpersonationProtectionState, - - [Parameter()] - [System.Object] - $TargetedDomainProtectionAction, - - [Parameter()] - [System.String] - $AdminDisplayName, - [Parameter()] [System.Object] - $TargetedUsersToProtect, - - [Parameter()] - [System.Object] - $TargetedUserProtectionAction, + $AuthenticationFailAction, [Parameter()] [System.Object] $RecommendedPolicyType, [Parameter()] - [System.Object] - $MailboxIntelligenceProtectionActionRecipients, - - [Parameter()] - [System.String] - $MailboxIntelligenceQuarantineTag, - - [Parameter()] - [System.String] - $UnusualCharactersSafetyTipsCustomText, - - [Parameter()] - [System.Boolean] - $EnableSimilarDomainsSafetyTips, + [System.Management.Automation.SwitchParameter] + $Confirm, [Parameter()] [System.String] $SpoofQuarantineTag, - [Parameter()] - [System.Boolean] - $EnableUnauthenticatedSender, - - [Parameter()] - [System.String] - $PolicyTag, - - [Parameter()] - [System.String] - $TargetedUserQuarantineTag, - - [Parameter()] - [System.Boolean] - $EnableOrganizationDomainsProtection, - - [Parameter()] - [System.Boolean] - $EnableMailboxIntelligenceProtection, - - [Parameter()] - [System.Boolean] - $EnableUnusualCharactersSafetyTips, - - [Parameter()] - [System.Boolean] - $EnableTargetedUserProtection, - - [Parameter()] - [System.Object] - $AuthenticationFailAction, - [Parameter()] [System.Object] - $TargetedUserActionRecipients, + $DmarcRejectAction, [Parameter()] - [System.Object] - $ExcludedSenders + [System.String] + $AdminDisplayName ) } function New-AntiPhishRule @@ -1999,35 +1821,6 @@ function New-DataClassification $ClassificationRuleCollectionIdentity ) } -function New-DataEncryptionPolicy -{ - [CmdletBinding()] - param( - [Parameter()] - [System.String] - $Description, - - [Parameter()] - [System.String] - $Name, - - [Parameter()] - [System.Object] - $DomainController, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object] - $AzureKeyIDs, - - [Parameter()] - [System.Boolean] - $Enabled - ) -} function New-DistributionGroup { [CmdletBinding()] @@ -3621,63 +3414,6 @@ function New-OfflineAddressBook $AddressLists ) } -function New-OMEConfiguration -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Double] - $ExternalMailExpiryInDays, - - [Parameter()] - [System.String] - $ReadButtonText, - - [Parameter()] - [System.String] - $PortalText, - - [Parameter()] - [System.Byte[]] - $Image, - - [Parameter()] - [System.String] - $IntroductionText, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.String] - $BackgroundColor, - - [Parameter()] - [System.String] - $DisclaimerText, - - [Parameter()] - [System.String] - $PrivacyStatementUrl, - - [Parameter()] - [System.Boolean] - $SocialIdSignIn, - - [Parameter()] - [System.String] - $EmailText, - - [Parameter()] - [System.Boolean] - $OTPEnabled, - - [Parameter()] - [System.Object] - $Identity - ) -} function New-OnPremisesOrganization { [CmdletBinding()] @@ -4136,257 +3872,25 @@ function New-RoleGroup $Force ) } -function New-SafeAttachmentPolicy +function New-SharingPolicy { [CmdletBinding()] param( [Parameter()] - [System.Object] - $Action, + [System.String] + $Name, [Parameter()] - [System.Object] - $RecommendedPolicyType, + [System.Management.Automation.SwitchParameter] + $Confirm, [Parameter()] - [System.Boolean] - $Redirect, + [System.Object] + $Domains, [Parameter()] - [System.String] - $Name, - - [Parameter()] - [System.String] - $AdminDisplayName, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $MakeBuiltInProtection, - - [Parameter()] - [System.Boolean] - $Enable, - - [Parameter()] - [System.Object] - $RedirectAddress, - - [Parameter()] - [System.String] - $QuarantineTag, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Boolean] - $ActionOnError - ) -} -function New-SafeAttachmentRule -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Int32] - $Priority, - - [Parameter()] - [System.String] - $Name, - - [Parameter()] - [System.Object[]] - $SentToMemberOf, - - [Parameter()] - [System.Object[]] - $SentTo, - - [Parameter()] - [System.String] - $Comments, - - [Parameter()] - [System.Object[]] - $RecipientDomainIs, - - [Parameter()] - [System.Object] - $SafeAttachmentPolicy, - - [Parameter()] - [System.Object[]] - $ExceptIfRecipientDomainIs, - - [Parameter()] - [System.Object[]] - $ExceptIfSentTo, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object[]] - $ExceptIfSentToMemberOf, - - [Parameter()] - [System.Boolean] - $Enabled - ) -} -function New-SafeLinksPolicy -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Boolean] - $EnableOrganizationBranding, - - [Parameter()] - [System.String] - $AdminDisplayName, - - [Parameter()] - [System.Boolean] - $UseTranslatedNotificationText, - - [Parameter()] - [System.String] - $Name, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $MakeBuiltInProtection, - - [Parameter()] - [System.Object] - $DoNotRewriteUrls, - - [Parameter()] - [System.Boolean] - $EnableSafeLinksForTeams, - - [Parameter()] - [System.Boolean] - $DisableUrlRewrite, - - [Parameter()] - [System.Boolean] - $EnableSafeLinksForOffice, - - [Parameter()] - [System.Boolean] - $TrackClicks, - - [Parameter()] - [System.Boolean] - $AllowClickThrough, - - [Parameter()] - [System.Object] - $RecommendedPolicyType, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.String] - $CustomNotificationText, - - [Parameter()] - [System.Boolean] - $DeliverMessageAfterScan, - - [Parameter()] - [System.Boolean] - $EnableSafeLinksForEmail, - - [Parameter()] - [System.Boolean] - $ScanUrls, - - [Parameter()] - [System.Boolean] - $EnableForInternalSenders - ) -} -function New-SafeLinksRule -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Int32] - $Priority, - - [Parameter()] - [System.String] - $Name, - - [Parameter()] - [System.Object[]] - $SentToMemberOf, - - [Parameter()] - [System.Object[]] - $SentTo, - - [Parameter()] - [System.String] - $Comments, - - [Parameter()] - [System.Object[]] - $RecipientDomainIs, - - [Parameter()] - [System.Object[]] - $ExceptIfRecipientDomainIs, - - [Parameter()] - [System.Object] - $SafeLinksPolicy, - - [Parameter()] - [System.Object[]] - $ExceptIfSentTo, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object[]] - $ExceptIfSentToMemberOf, - - [Parameter()] - [System.Boolean] - $Enabled - ) -} -function New-SharingPolicy -{ - [CmdletBinding()] - param( - [Parameter()] - [System.String] - $Name, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object] - $Domains, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Default, + [System.Management.Automation.SwitchParameter] + $Default, [Parameter()] [System.Boolean] @@ -5609,19 +5113,6 @@ function Remove-OfflineAddressBook $Identity ) } -function Remove-OMEConfiguration -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object] - $Identity - ) -} function Remove-OnPremisesOrganization { [CmdletBinding()] @@ -5764,66 +5255,6 @@ function Remove-RoleGroup $BypassSecurityGroupManagerCheck ) } -function Remove-SafeAttachmentPolicy -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Force, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object] - $Identity - ) -} -function Remove-SafeAttachmentRule -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object] - $Identity - ) -} -function Remove-SafeLinksPolicy -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Force, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object] - $Identity - ) -} -function Remove-SafeLinksRule -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object] - $Identity - ) -} function Remove-SharingPolicy { [CmdletBinding()] @@ -6059,53 +5490,13 @@ function Set-AntiPhishPolicy { [CmdletBinding()] param( - [Parameter()] - [System.Boolean] - $EnableFirstContactSafetyTips, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $MakeDefault, - - [Parameter()] - [System.Object] - $DmarcRejectAction, - - [Parameter()] - [System.Int32] - $PhishThresholdLevel, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Boolean] - $EnableTargetedDomainsProtection, - - [Parameter()] - [System.Object] - $Identity, - [Parameter()] [System.Boolean] $HonorDmarcPolicy, [Parameter()] [System.Boolean] - $Enabled, - - [Parameter()] - [System.Boolean] - $EnableViaTag, - - [Parameter()] - [System.Object] - $MailboxIntelligenceProtectionAction, - - [Parameter()] - [System.Object] - $TargetedDomainsToProtect, + $EnableUnauthenticatedSender, [Parameter()] [System.Boolean] @@ -6113,91 +5504,31 @@ function Set-AntiPhishPolicy [Parameter()] [System.Boolean] - $EnableSimilarUsersSafetyTips, - - [Parameter()] - [System.Object] - $ExcludedDomains, - - [Parameter()] - [System.String] - $PolicyTag, - - [Parameter()] - [System.Object] - $TargetedDomainActionRecipients, - - [Parameter()] - [System.Object] - $DmarcQuarantineAction, - - [Parameter()] - [System.Boolean] - $EnableMailboxIntelligence, - - [Parameter()] - [System.String] - $TargetedDomainQuarantineTag, - - [Parameter()] - [System.Object] - $ImpersonationProtectionState, - - [Parameter()] - [System.Object] - $TargetedDomainProtectionAction, + $EnableFirstContactSafetyTips, [Parameter()] [System.String] $AdminDisplayName, - [Parameter()] - [System.Object] - $TargetedUsersToProtect, - - [Parameter()] - [System.Object] - $TargetedUserProtectionAction, - - [Parameter()] - [System.Object] - $MailboxIntelligenceProtectionActionRecipients, - - [Parameter()] - [System.String] - $MailboxIntelligenceQuarantineTag, - - [Parameter()] - [System.Boolean] - $EnableSimilarDomainsSafetyTips, - [Parameter()] [System.String] $SpoofQuarantineTag, [Parameter()] - [System.Boolean] - $EnableUnauthenticatedSender, - - [Parameter()] - [System.String] - $TargetedUserQuarantineTag, - - [Parameter()] - [System.Boolean] - $EnableOrganizationDomainsProtection, + [System.Management.Automation.SwitchParameter] + $Confirm, [Parameter()] [System.Boolean] - $EnableMailboxIntelligenceProtection, + $EnableViaTag, [Parameter()] - [System.Boolean] - $EnableUnusualCharactersSafetyTips, + [System.Object] + $Identity, [Parameter()] [System.Boolean] - $EnableTargetedUserProtection, + $Enabled, [Parameter()] [System.Object] @@ -6205,11 +5536,15 @@ function Set-AntiPhishPolicy [Parameter()] [System.Object] - $TargetedUserActionRecipients, + $DmarcQuarantineAction, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $MakeDefault, [Parameter()] [System.Object] - $ExcludedSenders + $DmarcRejectAction ) } function Set-AntiPhishRule @@ -6319,35 +5654,6 @@ function Set-ApplicationAccessPolicy $Identity ) } -function Set-AtpPolicyForO365 -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Boolean] - $AllowSafeDocsOpen, - - [Parameter()] - [System.Object] - $BlockUrls, - - [Parameter()] - [System.Boolean] - $EnableATPForSPOTeamsODB, - - [Parameter()] - [System.Object] - $Identity, - - [Parameter()] - [System.Boolean] - $EnableSafeDocs, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm - ) -} function Set-AuthenticationPolicy { [CmdletBinding()] @@ -6710,18 +6016,6 @@ function Set-DataEncryptionPolicy { [CmdletBinding()] param( - [Parameter()] - [System.String] - $Description, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Force, - - [Parameter()] - [System.String] - $Name, - [Parameter()] [System.Object] $DomainController, @@ -6734,10 +6028,6 @@ function Set-DataEncryptionPolicy [System.Management.Automation.SwitchParameter] $Confirm, - [Parameter()] - [System.Object] - $Identity, - [Parameter()] [System.String] $PermanentDataPurgeReason, @@ -6752,7 +6042,7 @@ function Set-DataEncryptionPolicy [Parameter()] [System.Management.Automation.SwitchParameter] - $Refresh + $Force ) } function Set-DistributionGroup @@ -7714,6 +7004,10 @@ function Set-IRMConfiguration { [CmdletBinding()] param( + [Parameter()] + [System.Uri] + $RMSOnlineKeySharingLocation, + [Parameter()] [System.Object] $Identity, @@ -7722,10 +7016,6 @@ function Set-IRMConfiguration [System.Object] $TransportDecryptionSetting, - [Parameter()] - [System.Uri] - $RMSOnlineKeySharingLocation, - [Parameter()] [System.Management.Automation.SwitchParameter] $Force, @@ -7736,7 +7026,7 @@ function Set-IRMConfiguration [Parameter()] [System.Boolean] - $EnablePortalTrackingLogs, + $EnablePdfEncryption, [Parameter()] [System.Boolean] @@ -7762,10 +7052,6 @@ function Set-IRMConfiguration [System.Boolean] $JournalReportDecryptionEnabled, - [Parameter()] - [System.Boolean] - $EnablePdfEncryption, - [Parameter()] [System.Management.Automation.SwitchParameter] $Confirm, @@ -8112,10 +7398,6 @@ function Set-Mailbox [System.String] $CustomAttribute6, - [Parameter()] - [System.Object] - $DataEncryptionPolicy, - [Parameter()] [System.Object] $ExtensionCustomAttribute4, @@ -9159,8 +8441,8 @@ function Set-OMEConfiguration [CmdletBinding()] param( [Parameter()] - [System.Double] - $ExternalMailExpiryInDays, + [System.String] + $IntroductionText, [Parameter()] [System.String] @@ -9175,8 +8457,8 @@ function Set-OMEConfiguration $Image, [Parameter()] - [System.String] - $IntroductionText, + [System.Boolean] + $OTPEnabled, [Parameter()] [System.Management.Automation.SwitchParameter] @@ -9202,10 +8484,6 @@ function Set-OMEConfiguration [System.String] $EmailText, - [Parameter()] - [System.Boolean] - $OTPEnabled, - [Parameter()] [System.Object] $Identity @@ -9333,6 +8611,10 @@ function Set-OrganizationConfig [System.Boolean] $ElcProcessingDisabled, + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + [Parameter()] [System.Boolean] $UnblockUnsafeSenderPromptEnabled, @@ -9422,8 +8704,8 @@ function Set-OrganizationConfig $OutlookMobileGCCRestrictionsEnabled, [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, + [System.Uri] + $SiteMailboxCreationURL, [Parameter()] [System.Boolean] @@ -9433,10 +8715,6 @@ function Set-OrganizationConfig [System.Boolean] $BookingsSmsMicrosoftEnabled, - [Parameter()] - [System.Object] - $DefaultAuthenticationPolicy, - [Parameter()] [System.Boolean] $WebPushNotificationsDisabled, @@ -9497,10 +8775,6 @@ function Set-OrganizationConfig [System.Object] $DistributionGroupNameBlockedWordsList, - [Parameter()] - [System.Int32] - $RequiredCharsetCoverage, - [Parameter()] [System.Boolean] $AsyncSendEnabled, @@ -9517,6 +8791,10 @@ function Set-OrganizationConfig [System.Boolean] $ActivityBasedAuthenticationTimeoutWithSingleSignOnEnabled, + [Parameter()] + [System.Boolean] + $BookingsPaymentsEnabled, + [Parameter()] [System.Boolean] $WorkspaceTenantEnabled, @@ -9550,8 +8828,8 @@ function Set-OrganizationConfig $CalendarVersionStoreEnabled, [Parameter()] - [System.Boolean] - $BookingsPaymentsEnabled, + [System.Int32] + $RequiredCharsetCoverage, [Parameter()] [System.Object] @@ -9617,6 +8895,10 @@ function Set-OrganizationConfig [System.Boolean] $ConnectorsActionableMessagesEnabled, + [Parameter()] + [System.Object] + $DefaultAuthenticationPolicy, + [Parameter()] [System.Boolean] $MailTipsMailboxSourcedTipsEnabled, @@ -9725,14 +9007,6 @@ function Set-OrganizationConfig [System.Object] $EwsBlockList, - [Parameter()] - [System.Boolean] - $CustomerLockboxEnabled, - - [Parameter()] - [System.Uri] - $SiteMailboxCreationURL, - [Parameter()] [System.Int32] $ByteEncoderTypeFor7BitCharsets, @@ -10705,222 +9979,6 @@ function Set-RoleGroup $ManagedBy ) } -function Set-SafeAttachmentPolicy -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Object] - $Action, - - [Parameter()] - [System.Boolean] - $Redirect, - - [Parameter()] - [System.String] - $AdminDisplayName, - - [Parameter()] - [System.Boolean] - $Enable, - - [Parameter()] - [System.Object] - $RedirectAddress, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object] - $Identity, - - [Parameter()] - [System.String] - $QuarantineTag, - - [Parameter()] - [System.Boolean] - $ActionOnError - ) -} -function Set-SafeAttachmentRule -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Int32] - $Priority, - - [Parameter()] - [System.String] - $Name, - - [Parameter()] - [System.Object[]] - $SentToMemberOf, - - [Parameter()] - [System.Object[]] - $SentTo, - - [Parameter()] - [System.String] - $Comments, - - [Parameter()] - [System.Object[]] - $RecipientDomainIs, - - [Parameter()] - [System.Object] - $Identity, - - [Parameter()] - [System.Object] - $SafeAttachmentPolicy, - - [Parameter()] - [System.Object[]] - $ExceptIfRecipientDomainIs, - - [Parameter()] - [System.Object[]] - $ExceptIfSentTo, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object[]] - $ExceptIfSentToMemberOf - ) -} -function Set-SafeLinksPolicy -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Boolean] - $EnableOrganizationBranding, - - [Parameter()] - [System.Object] - $Identity, - - [Parameter()] - [System.String] - $AdminDisplayName, - - [Parameter()] - [System.Boolean] - $UseTranslatedNotificationText, - - [Parameter()] - [System.Boolean] - $DisableUrlRewrite, - - [Parameter()] - [System.Object] - $DoNotRewriteUrls, - - [Parameter()] - [System.Boolean] - $EnableSafeLinksForTeams, - - [Parameter()] - [System.Boolean] - $EnableSafeLinksForOffice, - - [Parameter()] - [System.Boolean] - $TrackClicks, - - [Parameter()] - [System.Boolean] - $AllowClickThrough, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.String] - $CustomNotificationText, - - [Parameter()] - [System.Boolean] - $DeliverMessageAfterScan, - - [Parameter()] - [System.Boolean] - $EnableSafeLinksForEmail, - - [Parameter()] - [System.Boolean] - $ScanUrls, - - [Parameter()] - [System.Boolean] - $EnableForInternalSenders - ) -} -function Set-SafeLinksRule -{ - [CmdletBinding()] - param( - [Parameter()] - [System.Int32] - $Priority, - - [Parameter()] - [System.String] - $Name, - - [Parameter()] - [System.Object[]] - $SentToMemberOf, - - [Parameter()] - [System.Object[]] - $SentTo, - - [Parameter()] - [System.String] - $Comments, - - [Parameter()] - [System.Object[]] - $RecipientDomainIs, - - [Parameter()] - [System.Object] - $Identity, - - [Parameter()] - [System.Object[]] - $ExceptIfRecipientDomainIs, - - [Parameter()] - [System.Object] - $SafeLinksPolicy, - - [Parameter()] - [System.Object[]] - $ExceptIfSentTo, - - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - - [Parameter()] - [System.Object[]] - $ExceptIfSentToMemberOf - ) -} function Set-SharingPolicy { [CmdletBinding()] @@ -12221,6 +11279,7 @@ function Update-RoleGroupMember } #endregion + #region MicrosoftGraph function Get-MgApplication { From a0718234d28fc64eb14e48847515163212942ce8 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 19 Apr 2023 16:39:18 -0400 Subject: [PATCH 05/12] Updates --- .../Modules/M365DSCStubsUtility.psm1 | 3 +- Tests/Unit/Stubs/Microsoft365.psm1 | 59 +++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 index 238b81d440..31ee0a0775 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 @@ -48,7 +48,8 @@ function New-M365DSCStubFiles if ($null -eq $Workloads) { $workloads = @( - @{Name = 'ExchangeOnline'; ModuleName = 'ExchangeOnlineManagement'; CommandName = 'Get-Mailbox' }, + @{Name = 'ExchangeOnline'; ModuleName = 'ExchangeOnlineManagement';}, # This is the main EXO module with new cmdlets. + @{Name = 'ExchangeOnline'; ModuleName = 'ExchangeOnlineManagement'; CommandName = 'Get-Mailbox' }, # This is the EXO Proxy @{Name = 'MicrosoftGraph'; ModuleName = 'Microsoft.Graph.Applications'; }, @{Name = 'MicrosoftGraph'; ModuleName = 'Microsoft.Graph.Authentication'; }, @{Name = 'MicrosoftGraph'; ModuleName = 'Microsoft.Graph.DeviceManagement'; }, diff --git a/Tests/Unit/Stubs/Microsoft365.psm1 b/Tests/Unit/Stubs/Microsoft365.psm1 index a16e55c022..99d7200103 100644 --- a/Tests/Unit/Stubs/Microsoft365.psm1 +++ b/Tests/Unit/Stubs/Microsoft365.psm1 @@ -1,3 +1,62 @@ +#region ExchangeOnline +function Get-DefaultTenantBriefingConfig +{ + [CmdletBinding()] + param( + [Parameter()] + [Microsoft.Exchange.Management.RestApiClient.Unlimited`1[System.UInt32]] + $ResultSize + ) +} +function Get-DefaultTenantMyAnalyticsFeatureConfig +{ + [CmdletBinding()] + param( + [Parameter()] + [Microsoft.Exchange.Management.RestApiClient.Unlimited`1[System.UInt32]] + $ResultSize + ) +} +function Set-DefaultTenantBriefingConfig +{ + [CmdletBinding()] + param( + [Parameter()] + [System.String] + $PrivacyMode, + + [Parameter()] + [Microsoft.Exchange.Management.RestApiClient.Unlimited`1[System.UInt32]] + $ResultSize + ) +} +function Set-DefaultTenantMyAnalyticsFeatureConfig +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Nullable`1[System.Double]] + $SamplingRate, + + [Parameter()] + [System.String] + $PrivacyMode, + + [Parameter()] + [System.String] + $Feature, + + [Parameter()] + [System.Boolean] + $IsEnabled, + + [Parameter()] + [Microsoft.Exchange.Management.RestApiClient.Unlimited`1[System.UInt32]] + $ResultSize + ) +} +#endregion + #region ExchangeOnline function Add-AvailabilityAddressSpace { From 2b4c574bda134a4880e7856e8c910eb520644a57 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 20 Apr 2023 07:53:22 -0400 Subject: [PATCH 06/12] Update Microsoft365.psm1 --- Tests/Unit/Stubs/Microsoft365.psm1 | 1038 ++++++++++++++++++++++++++-- 1 file changed, 983 insertions(+), 55 deletions(-) diff --git a/Tests/Unit/Stubs/Microsoft365.psm1 b/Tests/Unit/Stubs/Microsoft365.psm1 index 99d7200103..76ec250472 100644 --- a/Tests/Unit/Stubs/Microsoft365.psm1 +++ b/Tests/Unit/Stubs/Microsoft365.psm1 @@ -206,6 +206,14 @@ function Get-AntiPhishPolicy { [CmdletBinding()] param( + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Impersonation, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Advanced, + [Parameter()] [System.Object] $Identity, @@ -258,6 +266,15 @@ function Get-ApplicationAccessPolicy $Identity ) } +function Get-AtpPolicyForO365 +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Object] + $Identity + ) +} function Get-AuditConfig { [CmdletBinding()] @@ -1183,6 +1200,50 @@ function Get-RoleGroupMember $ResultSize ) } +function Get-SafeAttachmentPolicy +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Object] + $Identity + ) +} +function Get-SafeAttachmentRule +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Object] + $Identity, + + [Parameter()] + [System.Object] + $State + ) +} +function Get-SafeLinksPolicy +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Object] + $Identity + ) +} +function Get-SafeLinksRule +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Object] + $Identity, + + [Parameter()] + [System.Object] + $State + ) +} function Get-ServicePrincipal { [CmdletBinding()] @@ -1500,9 +1561,21 @@ function New-AntiPhishPolicy [System.Management.Automation.SwitchParameter] $MakeDefault, + [Parameter()] + [System.Object] + $DmarcRejectAction, + + [Parameter()] + [System.Int32] + $PhishThresholdLevel, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + [Parameter()] [System.Boolean] - $EnableUnauthenticatedSender, + $EnableTargetedDomainsProtection, [Parameter()] [System.Boolean] @@ -1520,37 +1593,129 @@ function New-AntiPhishPolicy [System.String] $Name, + [Parameter()] + [System.Object] + $TargetedDomainsToProtect, + [Parameter()] [System.Boolean] $EnableSpoofIntelligence, + [Parameter()] + [System.Boolean] + $EnableSimilarUsersSafetyTips, + + [Parameter()] + [System.Object] + $ExcludedDomains, + + [Parameter()] + [System.Object] + $MailboxIntelligenceProtectionAction, + + [Parameter()] + [System.Object] + $TargetedDomainActionRecipients, + [Parameter()] [System.Object] $DmarcQuarantineAction, + [Parameter()] + [System.Boolean] + $EnableMailboxIntelligence, + + [Parameter()] + [System.String] + $TargetedDomainQuarantineTag, + + [Parameter()] + [System.String] + $SimilarUsersSafetyTipsCustomText, + [Parameter()] [System.Object] - $AuthenticationFailAction, + $ImpersonationProtectionState, + + [Parameter()] + [System.Object] + $TargetedDomainProtectionAction, + + [Parameter()] + [System.String] + $AdminDisplayName, + + [Parameter()] + [System.Object] + $TargetedUsersToProtect, + + [Parameter()] + [System.Object] + $TargetedUserProtectionAction, [Parameter()] [System.Object] $RecommendedPolicyType, [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, + [System.Object] + $MailboxIntelligenceProtectionActionRecipients, + + [Parameter()] + [System.String] + $MailboxIntelligenceQuarantineTag, + + [Parameter()] + [System.String] + $UnusualCharactersSafetyTipsCustomText, + + [Parameter()] + [System.Boolean] + $EnableSimilarDomainsSafetyTips, [Parameter()] [System.String] $SpoofQuarantineTag, [Parameter()] - [System.Object] - $DmarcRejectAction, + [System.Boolean] + $EnableUnauthenticatedSender, [Parameter()] [System.String] - $AdminDisplayName + $PolicyTag, + + [Parameter()] + [System.String] + $TargetedUserQuarantineTag, + + [Parameter()] + [System.Boolean] + $EnableOrganizationDomainsProtection, + + [Parameter()] + [System.Boolean] + $EnableMailboxIntelligenceProtection, + + [Parameter()] + [System.Boolean] + $EnableUnusualCharactersSafetyTips, + + [Parameter()] + [System.Boolean] + $EnableTargetedUserProtection, + + [Parameter()] + [System.Object] + $AuthenticationFailAction, + + [Parameter()] + [System.Object] + $TargetedUserActionRecipients, + + [Parameter()] + [System.Object] + $ExcludedSenders ) } function New-AntiPhishRule @@ -1880,6 +2045,35 @@ function New-DataClassification $ClassificationRuleCollectionIdentity ) } +function New-DataEncryptionPolicy +{ + [CmdletBinding()] + param( + [Parameter()] + [System.String] + $Description, + + [Parameter()] + [System.String] + $Name, + + [Parameter()] + [System.Object] + $DomainController, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Object] + $AzureKeyIDs, + + [Parameter()] + [System.Boolean] + $Enabled + ) +} function New-DistributionGroup { [CmdletBinding()] @@ -3473,6 +3667,63 @@ function New-OfflineAddressBook $AddressLists ) } +function New-OMEConfiguration +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Double] + $ExternalMailExpiryInDays, + + [Parameter()] + [System.String] + $ReadButtonText, + + [Parameter()] + [System.String] + $PortalText, + + [Parameter()] + [System.Byte[]] + $Image, + + [Parameter()] + [System.String] + $IntroductionText, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.String] + $BackgroundColor, + + [Parameter()] + [System.String] + $DisclaimerText, + + [Parameter()] + [System.String] + $PrivacyStatementUrl, + + [Parameter()] + [System.Boolean] + $SocialIdSignIn, + + [Parameter()] + [System.String] + $EmailText, + + [Parameter()] + [System.Boolean] + $OTPEnabled, + + [Parameter()] + [System.Object] + $Identity + ) +} function New-OnPremisesOrganization { [CmdletBinding()] @@ -3931,29 +4182,261 @@ function New-RoleGroup $Force ) } -function New-SharingPolicy +function New-SafeAttachmentPolicy { [CmdletBinding()] param( + [Parameter()] + [System.Object] + $Action, + + [Parameter()] + [System.Object] + $RecommendedPolicyType, + + [Parameter()] + [System.Boolean] + $Redirect, + [Parameter()] [System.String] $Name, + [Parameter()] + [System.String] + $AdminDisplayName, + [Parameter()] [System.Management.Automation.SwitchParameter] - $Confirm, + $MakeBuiltInProtection, + + [Parameter()] + [System.Boolean] + $Enable, [Parameter()] [System.Object] - $Domains, + $RedirectAddress, + + [Parameter()] + [System.String] + $QuarantineTag, [Parameter()] [System.Management.Automation.SwitchParameter] - $Default, + $Confirm, [Parameter()] [System.Boolean] - $Enabled + $ActionOnError + ) +} +function New-SafeAttachmentRule +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Int32] + $Priority, + + [Parameter()] + [System.String] + $Name, + + [Parameter()] + [System.Object[]] + $SentToMemberOf, + + [Parameter()] + [System.Object[]] + $SentTo, + + [Parameter()] + [System.String] + $Comments, + + [Parameter()] + [System.Object[]] + $RecipientDomainIs, + + [Parameter()] + [System.Object] + $SafeAttachmentPolicy, + + [Parameter()] + [System.Object[]] + $ExceptIfRecipientDomainIs, + + [Parameter()] + [System.Object[]] + $ExceptIfSentTo, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Object[]] + $ExceptIfSentToMemberOf, + + [Parameter()] + [System.Boolean] + $Enabled + ) +} +function New-SafeLinksPolicy +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Boolean] + $EnableOrganizationBranding, + + [Parameter()] + [System.String] + $AdminDisplayName, + + [Parameter()] + [System.Boolean] + $UseTranslatedNotificationText, + + [Parameter()] + [System.String] + $Name, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $MakeBuiltInProtection, + + [Parameter()] + [System.Object] + $DoNotRewriteUrls, + + [Parameter()] + [System.Boolean] + $EnableSafeLinksForTeams, + + [Parameter()] + [System.Boolean] + $DisableUrlRewrite, + + [Parameter()] + [System.Boolean] + $EnableSafeLinksForOffice, + + [Parameter()] + [System.Boolean] + $TrackClicks, + + [Parameter()] + [System.Boolean] + $AllowClickThrough, + + [Parameter()] + [System.Object] + $RecommendedPolicyType, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.String] + $CustomNotificationText, + + [Parameter()] + [System.Boolean] + $DeliverMessageAfterScan, + + [Parameter()] + [System.Boolean] + $EnableSafeLinksForEmail, + + [Parameter()] + [System.Boolean] + $ScanUrls, + + [Parameter()] + [System.Boolean] + $EnableForInternalSenders + ) +} +function New-SafeLinksRule +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Int32] + $Priority, + + [Parameter()] + [System.String] + $Name, + + [Parameter()] + [System.Object[]] + $SentToMemberOf, + + [Parameter()] + [System.Object[]] + $SentTo, + + [Parameter()] + [System.String] + $Comments, + + [Parameter()] + [System.Object[]] + $RecipientDomainIs, + + [Parameter()] + [System.Object[]] + $ExceptIfRecipientDomainIs, + + [Parameter()] + [System.Object] + $SafeLinksPolicy, + + [Parameter()] + [System.Object[]] + $ExceptIfSentTo, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Object[]] + $ExceptIfSentToMemberOf, + + [Parameter()] + [System.Boolean] + $Enabled + ) +} +function New-SharingPolicy +{ + [CmdletBinding()] + param( + [Parameter()] + [System.String] + $Name, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Object] + $Domains, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Default, + + [Parameter()] + [System.Boolean] + $Enabled ) } function New-TransportRule @@ -5172,6 +5655,19 @@ function Remove-OfflineAddressBook $Identity ) } +function Remove-OMEConfiguration +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Object] + $Identity + ) +} function Remove-OnPremisesOrganization { [CmdletBinding()] @@ -5314,6 +5810,66 @@ function Remove-RoleGroup $BypassSecurityGroupManagerCheck ) } +function Remove-SafeAttachmentPolicy +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Force, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Object] + $Identity + ) +} +function Remove-SafeAttachmentRule +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Object] + $Identity + ) +} +function Remove-SafeLinksPolicy +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Force, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Object] + $Identity + ) +} +function Remove-SafeLinksRule +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Object] + $Identity + ) +} function Remove-SharingPolicy { [CmdletBinding()] @@ -5549,13 +6105,53 @@ function Set-AntiPhishPolicy { [CmdletBinding()] param( + [Parameter()] + [System.Boolean] + $EnableFirstContactSafetyTips, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $MakeDefault, + + [Parameter()] + [System.Object] + $DmarcRejectAction, + + [Parameter()] + [System.Int32] + $PhishThresholdLevel, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Boolean] + $EnableTargetedDomainsProtection, + + [Parameter()] + [System.Object] + $Identity, + [Parameter()] [System.Boolean] $HonorDmarcPolicy, [Parameter()] [System.Boolean] - $EnableUnauthenticatedSender, + $Enabled, + + [Parameter()] + [System.Boolean] + $EnableViaTag, + + [Parameter()] + [System.Object] + $MailboxIntelligenceProtectionAction, + + [Parameter()] + [System.Object] + $TargetedDomainsToProtect, [Parameter()] [System.Boolean] @@ -5563,47 +6159,103 @@ function Set-AntiPhishPolicy [Parameter()] [System.Boolean] - $EnableFirstContactSafetyTips, + $EnableSimilarUsersSafetyTips, + + [Parameter()] + [System.Object] + $ExcludedDomains, + + [Parameter()] + [System.String] + $PolicyTag, + + [Parameter()] + [System.Object] + $TargetedDomainActionRecipients, + + [Parameter()] + [System.Object] + $DmarcQuarantineAction, + + [Parameter()] + [System.Boolean] + $EnableMailboxIntelligence, + + [Parameter()] + [System.String] + $TargetedDomainQuarantineTag, + + [Parameter()] + [System.Object] + $ImpersonationProtectionState, + + [Parameter()] + [System.Object] + $TargetedDomainProtectionAction, [Parameter()] [System.String] $AdminDisplayName, + [Parameter()] + [System.Object] + $TargetedUsersToProtect, + + [Parameter()] + [System.Object] + $TargetedUserProtectionAction, + + [Parameter()] + [System.Object] + $MailboxIntelligenceProtectionActionRecipients, + + [Parameter()] + [System.String] + $MailboxIntelligenceQuarantineTag, + + [Parameter()] + [System.Boolean] + $EnableSimilarDomainsSafetyTips, + [Parameter()] [System.String] $SpoofQuarantineTag, [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, + [System.Boolean] + $EnableUnauthenticatedSender, + + [Parameter()] + [System.String] + $TargetedUserQuarantineTag, [Parameter()] [System.Boolean] - $EnableViaTag, + $EnableOrganizationDomainsProtection, [Parameter()] - [System.Object] - $Identity, + [System.Boolean] + $EnableMailboxIntelligenceProtection, [Parameter()] [System.Boolean] - $Enabled, + $EnableUnusualCharactersSafetyTips, [Parameter()] - [System.Object] - $AuthenticationFailAction, + [System.Boolean] + $EnableTargetedUserProtection, [Parameter()] [System.Object] - $DmarcQuarantineAction, + $AuthenticationFailAction, [Parameter()] - [System.Management.Automation.SwitchParameter] - $MakeDefault, + [System.Object] + $TargetedUserActionRecipients, [Parameter()] [System.Object] - $DmarcRejectAction + $ExcludedSenders ) } function Set-AntiPhishRule @@ -5713,6 +6365,35 @@ function Set-ApplicationAccessPolicy $Identity ) } +function Set-AtpPolicyForO365 +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Boolean] + $AllowSafeDocsOpen, + + [Parameter()] + [System.Object] + $BlockUrls, + + [Parameter()] + [System.Boolean] + $EnableATPForSPOTeamsODB, + + [Parameter()] + [System.Object] + $Identity, + + [Parameter()] + [System.Boolean] + $EnableSafeDocs, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm + ) +} function Set-AuthenticationPolicy { [CmdletBinding()] @@ -6075,6 +6756,18 @@ function Set-DataEncryptionPolicy { [CmdletBinding()] param( + [Parameter()] + [System.String] + $Description, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Force, + + [Parameter()] + [System.String] + $Name, + [Parameter()] [System.Object] $DomainController, @@ -6087,6 +6780,10 @@ function Set-DataEncryptionPolicy [System.Management.Automation.SwitchParameter] $Confirm, + [Parameter()] + [System.Object] + $Identity, + [Parameter()] [System.String] $PermanentDataPurgeReason, @@ -6101,7 +6798,7 @@ function Set-DataEncryptionPolicy [Parameter()] [System.Management.Automation.SwitchParameter] - $Force + $Refresh ) } function Set-DistributionGroup @@ -7061,12 +7758,8 @@ function Set-IntraOrganizationConnector } function Set-IRMConfiguration { - [CmdletBinding()] - param( - [Parameter()] - [System.Uri] - $RMSOnlineKeySharingLocation, - + [CmdletBinding()] + param( [Parameter()] [System.Object] $Identity, @@ -7075,6 +7768,10 @@ function Set-IRMConfiguration [System.Object] $TransportDecryptionSetting, + [Parameter()] + [System.Uri] + $RMSOnlineKeySharingLocation, + [Parameter()] [System.Management.Automation.SwitchParameter] $Force, @@ -7085,7 +7782,7 @@ function Set-IRMConfiguration [Parameter()] [System.Boolean] - $EnablePdfEncryption, + $EnablePortalTrackingLogs, [Parameter()] [System.Boolean] @@ -7111,6 +7808,10 @@ function Set-IRMConfiguration [System.Boolean] $JournalReportDecryptionEnabled, + [Parameter()] + [System.Boolean] + $EnablePdfEncryption, + [Parameter()] [System.Management.Automation.SwitchParameter] $Confirm, @@ -7457,6 +8158,10 @@ function Set-Mailbox [System.String] $CustomAttribute6, + [Parameter()] + [System.Object] + $DataEncryptionPolicy, + [Parameter()] [System.Object] $ExtensionCustomAttribute4, @@ -8500,8 +9205,8 @@ function Set-OMEConfiguration [CmdletBinding()] param( [Parameter()] - [System.String] - $IntroductionText, + [System.Double] + $ExternalMailExpiryInDays, [Parameter()] [System.String] @@ -8516,8 +9221,8 @@ function Set-OMEConfiguration $Image, [Parameter()] - [System.Boolean] - $OTPEnabled, + [System.String] + $IntroductionText, [Parameter()] [System.Management.Automation.SwitchParameter] @@ -8543,6 +9248,10 @@ function Set-OMEConfiguration [System.String] $EmailText, + [Parameter()] + [System.Boolean] + $OTPEnabled, + [Parameter()] [System.Object] $Identity @@ -8670,10 +9379,6 @@ function Set-OrganizationConfig [System.Boolean] $ElcProcessingDisabled, - [Parameter()] - [System.Management.Automation.SwitchParameter] - $Confirm, - [Parameter()] [System.Boolean] $UnblockUnsafeSenderPromptEnabled, @@ -8763,8 +9468,8 @@ function Set-OrganizationConfig $OutlookMobileGCCRestrictionsEnabled, [Parameter()] - [System.Uri] - $SiteMailboxCreationURL, + [System.Management.Automation.SwitchParameter] + $Confirm, [Parameter()] [System.Boolean] @@ -8774,6 +9479,10 @@ function Set-OrganizationConfig [System.Boolean] $BookingsSmsMicrosoftEnabled, + [Parameter()] + [System.Object] + $DefaultAuthenticationPolicy, + [Parameter()] [System.Boolean] $WebPushNotificationsDisabled, @@ -8834,6 +9543,10 @@ function Set-OrganizationConfig [System.Object] $DistributionGroupNameBlockedWordsList, + [Parameter()] + [System.Int32] + $RequiredCharsetCoverage, + [Parameter()] [System.Boolean] $AsyncSendEnabled, @@ -8850,10 +9563,6 @@ function Set-OrganizationConfig [System.Boolean] $ActivityBasedAuthenticationTimeoutWithSingleSignOnEnabled, - [Parameter()] - [System.Boolean] - $BookingsPaymentsEnabled, - [Parameter()] [System.Boolean] $WorkspaceTenantEnabled, @@ -8887,8 +9596,8 @@ function Set-OrganizationConfig $CalendarVersionStoreEnabled, [Parameter()] - [System.Int32] - $RequiredCharsetCoverage, + [System.Boolean] + $BookingsPaymentsEnabled, [Parameter()] [System.Object] @@ -8954,10 +9663,6 @@ function Set-OrganizationConfig [System.Boolean] $ConnectorsActionableMessagesEnabled, - [Parameter()] - [System.Object] - $DefaultAuthenticationPolicy, - [Parameter()] [System.Boolean] $MailTipsMailboxSourcedTipsEnabled, @@ -9066,6 +9771,14 @@ function Set-OrganizationConfig [System.Object] $EwsBlockList, + [Parameter()] + [System.Boolean] + $CustomerLockboxEnabled, + + [Parameter()] + [System.Uri] + $SiteMailboxCreationURL, + [Parameter()] [System.Int32] $ByteEncoderTypeFor7BitCharsets, @@ -10038,6 +10751,222 @@ function Set-RoleGroup $ManagedBy ) } +function Set-SafeAttachmentPolicy +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Object] + $Action, + + [Parameter()] + [System.Boolean] + $Redirect, + + [Parameter()] + [System.String] + $AdminDisplayName, + + [Parameter()] + [System.Boolean] + $Enable, + + [Parameter()] + [System.Object] + $RedirectAddress, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Object] + $Identity, + + [Parameter()] + [System.String] + $QuarantineTag, + + [Parameter()] + [System.Boolean] + $ActionOnError + ) +} +function Set-SafeAttachmentRule +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Int32] + $Priority, + + [Parameter()] + [System.String] + $Name, + + [Parameter()] + [System.Object[]] + $SentToMemberOf, + + [Parameter()] + [System.Object[]] + $SentTo, + + [Parameter()] + [System.String] + $Comments, + + [Parameter()] + [System.Object[]] + $RecipientDomainIs, + + [Parameter()] + [System.Object] + $Identity, + + [Parameter()] + [System.Object] + $SafeAttachmentPolicy, + + [Parameter()] + [System.Object[]] + $ExceptIfRecipientDomainIs, + + [Parameter()] + [System.Object[]] + $ExceptIfSentTo, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Object[]] + $ExceptIfSentToMemberOf + ) +} +function Set-SafeLinksPolicy +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Boolean] + $EnableOrganizationBranding, + + [Parameter()] + [System.Object] + $Identity, + + [Parameter()] + [System.String] + $AdminDisplayName, + + [Parameter()] + [System.Boolean] + $UseTranslatedNotificationText, + + [Parameter()] + [System.Boolean] + $DisableUrlRewrite, + + [Parameter()] + [System.Object] + $DoNotRewriteUrls, + + [Parameter()] + [System.Boolean] + $EnableSafeLinksForTeams, + + [Parameter()] + [System.Boolean] + $EnableSafeLinksForOffice, + + [Parameter()] + [System.Boolean] + $TrackClicks, + + [Parameter()] + [System.Boolean] + $AllowClickThrough, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.String] + $CustomNotificationText, + + [Parameter()] + [System.Boolean] + $DeliverMessageAfterScan, + + [Parameter()] + [System.Boolean] + $EnableSafeLinksForEmail, + + [Parameter()] + [System.Boolean] + $ScanUrls, + + [Parameter()] + [System.Boolean] + $EnableForInternalSenders + ) +} +function Set-SafeLinksRule +{ + [CmdletBinding()] + param( + [Parameter()] + [System.Int32] + $Priority, + + [Parameter()] + [System.String] + $Name, + + [Parameter()] + [System.Object[]] + $SentToMemberOf, + + [Parameter()] + [System.Object[]] + $SentTo, + + [Parameter()] + [System.String] + $Comments, + + [Parameter()] + [System.Object[]] + $RecipientDomainIs, + + [Parameter()] + [System.Object] + $Identity, + + [Parameter()] + [System.Object[]] + $ExceptIfRecipientDomainIs, + + [Parameter()] + [System.Object] + $SafeLinksPolicy, + + [Parameter()] + [System.Object[]] + $ExceptIfSentTo, + + [Parameter()] + [System.Management.Automation.SwitchParameter] + $Confirm, + + [Parameter()] + [System.Object[]] + $ExceptIfSentToMemberOf + ) +} function Set-SharingPolicy { [CmdletBinding()] @@ -11338,7 +12267,6 @@ function Update-RoleGroupMember } #endregion - #region MicrosoftGraph function Get-MgApplication { From 88be6741b3b3e2772798b9e65271a9538b0d512e Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 20 Apr 2023 08:15:21 -0400 Subject: [PATCH 07/12] Update M365DSCStubsUtility.psm1 --- .../Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 index 31ee0a0775..308588d182 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 @@ -208,20 +208,15 @@ function New-M365DSCStubFiles { $ParamType = 'PSObject' } - elseif ($ParamType.StartsWith('Microsoft.Teams.') -or ` - $ParamType.StartsWith("System.Management.Automation.PSListModifier``1[Microsoft.")) - { - $ParamType = 'PSObject' - } elseif ($ParamType.StartsWith('Microsoft.Rtc.')) { $ParamType = 'PSObject' } - elseif ($ParamType.StartsWith('Microsoft.SharePoint.') -or ` - $ParamType.StartsWith('Microsoft.Online') -or ` + elseif ($ParamType.StartsWith('Microsoft..') -or ` $ParamType.StartsWith('PnP.') -or ` $ParamType.StartsWith("System.Nullable``1[Microsoft.") -or ` - $ParamType.StartsWith("System.Nullable``1[PnP.")) + $ParamType.StartsWith("System.Nullable``1[PnP.") -or ` + $ParamType.StartsWith("System.Management.Automation.PSListModifier``1[Microsoft.")) { $ParamType = 'PSObject' } From da05e85207e77d58883ba607a3504e403e3242e8 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Thu, 20 Apr 2023 08:33:58 -0400 Subject: [PATCH 08/12] Updates --- Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 | 2 +- Tests/Unit/Stubs/Microsoft365.psm1 | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 b/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 index 308588d182..0f130945e3 100644 --- a/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 +++ b/Modules/Microsoft365DSC/Modules/M365DSCStubsUtility.psm1 @@ -212,7 +212,7 @@ function New-M365DSCStubFiles { $ParamType = 'PSObject' } - elseif ($ParamType.StartsWith('Microsoft..') -or ` + elseif ($ParamType.StartsWith('Microsoft.') -or ` $ParamType.StartsWith('PnP.') -or ` $ParamType.StartsWith("System.Nullable``1[Microsoft.") -or ` $ParamType.StartsWith("System.Nullable``1[PnP.") -or ` diff --git a/Tests/Unit/Stubs/Microsoft365.psm1 b/Tests/Unit/Stubs/Microsoft365.psm1 index 76ec250472..6afc5fc237 100644 --- a/Tests/Unit/Stubs/Microsoft365.psm1 +++ b/Tests/Unit/Stubs/Microsoft365.psm1 @@ -4,7 +4,7 @@ function Get-DefaultTenantBriefingConfig [CmdletBinding()] param( [Parameter()] - [Microsoft.Exchange.Management.RestApiClient.Unlimited`1[System.UInt32]] + [PSObject] $ResultSize ) } @@ -13,7 +13,7 @@ function Get-DefaultTenantMyAnalyticsFeatureConfig [CmdletBinding()] param( [Parameter()] - [Microsoft.Exchange.Management.RestApiClient.Unlimited`1[System.UInt32]] + [PSObject] $ResultSize ) } @@ -26,7 +26,7 @@ function Set-DefaultTenantBriefingConfig $PrivacyMode, [Parameter()] - [Microsoft.Exchange.Management.RestApiClient.Unlimited`1[System.UInt32]] + [PSObject] $ResultSize ) } @@ -51,7 +51,7 @@ function Set-DefaultTenantMyAnalyticsFeatureConfig $IsEnabled, [Parameter()] - [Microsoft.Exchange.Management.RestApiClient.Unlimited`1[System.UInt32]] + [PSObject] $ResultSize ) } From 882a76dcb6564f0ae4edbf1174858d989553214a Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 21 Jun 2023 07:34:04 -0400 Subject: [PATCH 09/12] Update Microsoft365DSC.O365OrgSettings.Tests.ps1 --- .../Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 index 6bcbd5279f..74a6248f13 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 @@ -139,9 +139,6 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { VivaInsightsScheduleSendSuggestions = $true Ensure = 'Present' Credential = $Credential - IsSingleInstance = 'Yes' - M365WebEnableUsersToOpenFilesFrom3PStorage = $True; - Credential = $Credential } Mock -CommandName Get-MgServicePrincipal -MockWith { From 851acefc8627ba2f53ebd1c8ec006c2d5f6fe990 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 21 Jun 2023 07:40:14 -0400 Subject: [PATCH 10/12] Update MSFT_O365OrgSettings.psm1 --- .../DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 index fd221c0401..b81eaed5c9 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 @@ -192,6 +192,7 @@ function Get-TargetResource Managedidentity = $ManagedIdentity.IsPresent } } + catch { New-M365DSCLogEntry -Message 'Error retrieving data:' ` -Exception $_ ` From da607be929363c42cecb7023dbea53353e9aaa33 Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 21 Jun 2023 09:44:16 -0400 Subject: [PATCH 11/12] Fixes --- .../MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 | 4 +++- .../Microsoft365DSC.O365OrgSettings.Tests.ps1 | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 index b81eaed5c9..4e158ab843 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 @@ -130,7 +130,7 @@ function Get-TargetResource # Microsoft Viva Briefing Email $vivaBriefingEmailValue = $false $currentBriefingConfig = Get-DefaultTenantBriefingConfig - if ($currentBriefingConfig.PrivacyMode -eq 'opt-in') + if ($currentBriefingConfig.IsEnabledByDefault -eq 'opt-in') { $vivaBriefingEmailValue = $true } @@ -180,6 +180,8 @@ function Get-TargetResource InstallationOptionsUpdateChannel = $installationOptions.updateChannel InstallationOptionsAppsForWindows = $appsForWindowsValue InstallationOptionsAppsForMac = $appsForMacValue + MicrosoftVivaBriefingEmail = $vivaBriefingEmailValue + M365WebEnableUsersToOpenFilesFrom3PStorage = $M365WebEnableUsersToOpenFilesFrom3PStorageValue VivaInsightsWebExperience = $currentVivaInsightsSettings.IsDashboardEnabled VivaInsightsDigestEmail = $currentVivaInsightsSettings.IsDigestEmailEnabled VivaInsightsOutlookAddInAndInlineSuggestions = $currentVivaInsightsSettings.IsAddInEnabled diff --git a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 index 74a6248f13..f64f1caad3 100644 --- a/Tests/Unit/Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 +++ b/Tests/Unit/Microsoft365DSC/Microsoft365DSC.O365OrgSettings.Tests.ps1 @@ -102,7 +102,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-DefaultTenantBriefingConfig -MockWith { return @{ - PrivacyMode = 'opt-in' + IsEnabledByDefault = 'opt-in' } } @@ -149,7 +149,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-DefaultTenantBriefingConfig -MockWith { return @{ - PrivacyMode = 'opt-in' + IsEnabledByDefault = 'opt-in' } } @@ -194,7 +194,7 @@ Describe -Name $Global:DscHelper.DescribeHeader -Fixture { Mock -CommandName Get-DefaultTenantBriefingConfig -MockWith { return @{ - PrivacyMode = 'opt-in' + IsEnabledByDefault = 'opt-in' } } From 5ab29e3cacbba563ab4c8e6aa12efb1f3823086a Mon Sep 17 00:00:00 2001 From: Nik Charlebois Date: Wed, 21 Jun 2023 10:23:23 -0400 Subject: [PATCH 12/12] Update MSFT_O365OrgSettings.psm1 --- .../DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 index 4e158ab843..a1599c4ae3 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_O365OrgSettings/MSFT_O365OrgSettings.psm1 @@ -181,7 +181,7 @@ function Get-TargetResource InstallationOptionsAppsForWindows = $appsForWindowsValue InstallationOptionsAppsForMac = $appsForMacValue MicrosoftVivaBriefingEmail = $vivaBriefingEmailValue - M365WebEnableUsersToOpenFilesFrom3PStorage = $M365WebEnableUsersToOpenFilesFrom3PStorageValue + M365WebEnableUsersToOpenFilesFrom3PStorage = $M365WebEnableUsersToOpenFilesFrom3PStorageValue.AccountEnabled VivaInsightsWebExperience = $currentVivaInsightsSettings.IsDashboardEnabled VivaInsightsDigestEmail = $currentVivaInsightsSettings.IsDigestEmailEnabled VivaInsightsOutlookAddInAndInlineSuggestions = $currentVivaInsightsSettings.IsAddInEnabled