Skip to content

Commit

Permalink
Merge pull request #5845 from NikCharlebois/Release-1.25.226.1
Browse files Browse the repository at this point in the history
Release 1.25.226.1
  • Loading branch information
NikCharlebois authored Feb 26, 2025
2 parents ba50750 + 302826b commit 5d2f321
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 76 deletions.
12 changes: 9 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Change log for Microsoft365DSC

# UNRELEASED
# 1.25.226.1

* AADConditionalAccessPolicy
* Fixed an issue where `TermsOfUse` was not passed as an array, causing failures in GCC-High environments.
* Fixed an issue where `TermsOfUse` was not passed as an array, causing failures in GCC-High environments.
FIXES [#5742](https://github.com/microsoft/Microsoft365DSC/issues/5742)
* Added verbose to the Get-TargetResource function to print out the retrieved
policies from calling the cmdlet.
* AADPasswordRuleSettings
* Updated schema to only accept values 'Enforced' and 'Audit' for parameter BannedPasswordCheckOnPremisesMode
* IntuneDeviceCompliancePolicyWindows10
* Fixes the handling of the `DeviceCompliancePolicyScript` property.
* Fixes the handling of the `DeviceCompliancePolicyScript` property.
FIXES [#5510](https://github.com/microsoft/Microsoft365DSC/issues/5510)
* O365OrgSettings
* Added support for the AllowPlannerCopilot setting.
* PPTenantSettings
* Corrected issue in the resource schema. The description was a multi-line
string, which is not allowed.
Expand All @@ -25,6 +29,8 @@
* Apply ordering during export.
* TeamsUser
* Apply ordering during export.
* DEPENDENCIES
* Updated MSCloudLoginAssistant to version 1.1.39.

# 1.25.219.3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,16 @@ function Get-TargetResource
try
{
$Policy = Get-MgBetaIdentityConditionalAccessPolicy -ConditionalAccessPolicyId $Id -ErrorAction Stop
$jsonPolicy = ConvertTo-Json $Policy -ErrorAction SilentlyContinue
Write-Verbose -Message "Retrieved policy:`r`n$($jsonPolicy)"
}
catch
{
Write-Verbose -Message "Couldn't find existing policy by ID {$Id}"
$Policy = Get-MgBetaIdentityConditionalAccessPolicy -Filter "DisplayName eq '$DisplayName'"
$jsonPolicy = ConvertTo-Json $Policy -ErrorAction SilentlyContinue
Write-Verbose -Message "Retrieved policy:`r`n$($jsonPolicy)"

if ($Policy.Length -gt 1)
{
throw "Duplicate CA Policies named $DisplayName exist in tenant"
Expand All @@ -303,6 +308,9 @@ function Get-TargetResource
Write-Verbose -Message 'Id was NOT specified'
## Can retreive multiple CA Policies since displayname is not unique
$Policy = Get-MgBetaIdentityConditionalAccessPolicy -Filter "DisplayName eq '$DisplayName'"
$jsonPolicy = ConvertTo-Json $Policy -ErrorAction SilentlyContinue
Write-Verbose -Message "Retrieved policy:`r`n$($jsonPolicy)"

if ($Policy.Length -gt 1)
{
throw "Duplicate CA Policies named $DisplayName exist in tenant"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ function Get-TargetResource
[System.Boolean]
$PlannerAllowCalendarSharing,

[Parameter()]
[System.Boolean]
$AllowPlannerCopilot,

[Parameter()]
[System.Boolean]
$MicrosoftVivaBriefingEmail,
Expand Down Expand Up @@ -221,6 +225,7 @@ function Get-TargetResource
{
$results += @{
PlannerAllowCalendarSharing = $PlannerSettings.allowCalendarSharing
AllowPlannerCopilot = $PlannerSettings.allowPlannerCopilot
}
}

Expand All @@ -234,61 +239,6 @@ function Get-TargetResource
}
}

# DEPRECATED - Microsoft Viva Briefing Email
<#
$vivaBriefingEmailValue = $false
try
{
$currentBriefingConfig = Get-DefaultTenantBriefingConfig -ErrorAction Stop -Verbose:$false
if ($currentBriefingConfig.IsEnabledByDefault -eq 'opt-in')
{
$vivaBriefingEmailValue = $true
}
}
catch
{
if ($_.Exception.Message -like "*Unexpected character encountered while parsing value*")
{
$vivaBriefingEmailValue = $true
}
elseif ($_.Exception.Message -like "*A task was canceled*")
{
$retries = 1
$errorContent = $null
while ($retries -le 5)
{
try
{
Start-Sleep -Seconds 2
$currentBriefingConfig = Get-DefaultTenantBriefingConfig -ErrorAction Stop -Verbose:$false
}
catch
{
$errorContent = $_
$retries++
}
}
if ($null -eq $currentBriefingConfig)
{
throw $errorContent
}
else
{
if ($currentBriefingConfig.IsEnabledByDefault -eq 'opt-in')
{
$vivaBriefingEmailValue = $true
}
}
}
else
{
throw $_
}
}
$results += @{
MicrosoftVivaBriefingEmail = $vivaBriefingEmailValue
}#>

# Viva Insights settings
$currentVivaInsightsSettings = Get-DefaultTenantMyAnalyticsFeatureConfig -Verbose:$false
if ($null -ne $currentVivaInsightsSettings)
Expand Down Expand Up @@ -484,6 +434,10 @@ function Set-TargetResource
[System.Boolean]
$PlannerAllowCalendarSharing,

[Parameter()]
[System.Boolean]
$AllowPlannerCopilot,

[Parameter()]
[System.Boolean]
$MicrosoftVivaBriefingEmail,
Expand Down Expand Up @@ -599,11 +553,14 @@ function Set-TargetResource
Update-MgServicePrincipal -ServicePrincipalId $($M365WebEnableUsersToOpenFilesFrom3PStorageValue.Id) `
-AccountEnabled:$M365WebEnableUsersToOpenFilesFrom3PStorage
}
if ($PSBoundParameters.ContainsKey('PlannerAllowCalendarSharing') -and `
($PlannerAllowCalendarSharing -ne $currentValues.PlannerAllowCalendarSharing))
if (($PSBoundParameters.ContainsKey('PlannerAllowCalendarSharing') -and `
($PlannerAllowCalendarSharing -ne $currentValues.PlannerAllowCalendarSharing)) -or `
($PSBoundParameters.ContainsKey('AllowPlannerCopilot') -and `
($AllowPlannerCopilot -ne $currentValues.AllowPlannerCopilot)))
{
Write-Verbose -Message "Updating the Planner Allow Calendar Sharing setting to {$PlannerAllowCalendarSharing}"
Set-M365DSCO365OrgSettingsPlannerConfig -AllowCalendarSharing $PlannerAllowCalendarSharing
Set-M365DSCO365OrgSettingsPlannerConfig -AllowCalendarSharing $PlannerAllowCalendarSharing `
-AllowPlannerCopilot $AllowPlannerCopilot
}

if ($PSBoundParameters.ContainsKey('CortanaEnabled') -and `
Expand Down Expand Up @@ -916,6 +873,10 @@ function Test-TargetResource
[System.Boolean]
$PlannerAllowCalendarSharing,

[Parameter()]
[System.Boolean]
$AllowPlannerCopilot,

[Parameter()]
[System.Boolean]
$MicrosoftVivaBriefingEmail,
Expand Down Expand Up @@ -1131,7 +1092,6 @@ function Get-M365DSCO365OrgSettingsPlannerConfig
{
[CmdletBinding()]
param()
$VerbosePreference = 'SilentlyContinue'

try
{
Expand All @@ -1140,7 +1100,7 @@ function Get-M365DSCO365OrgSettingsPlannerConfig
$results = Invoke-RestMethod -ContentType 'application/json;odata.metadata=full' `
-Headers @{'Accept' = 'application/json'; 'Authorization' = (Get-MSCloudLoginConnectionProfile -Workload Tasks).AccessToken; 'Accept-Charset' = 'UTF-8'; 'OData-Version' = '4.0;NetFx'; 'OData-MaxVersion' = '4.0;NetFx' } `
-Method GET `
$Uri -ErrorAction Stop
-Uri $Uri -ErrorAction Stop
return $results
}
catch
Expand All @@ -1167,23 +1127,37 @@ function Set-M365DSCO365OrgSettingsPlannerConfig
{
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[Parameter()]
[System.Boolean]
$AllowCalendarSharing
$AllowCalendarSharing,

[Parameter()]
[System.Boolean]
$AllowPlannerCopilot
)
$VerbosePreference = 'SilentlyContinue'

$flags = @{
allowCalendarSharing = $AllowCalendarSharing
$flags = @{}

if ($null -ne $AllowCalendarSharing)
{
$flags.Add('allowCalendarSharing', $AllowCalendarSharing)
}
if ($null -ne $AllowPlannerCopilot)
{
$flags.Add('allowPlannerCopilot', $AllowPlannerCopilot)
}

$requestBody = $flags | ConvertTo-Json
$Uri = (Get-MSCloudLoginConnectionProfile -Workload Tasks).HostUrl + '/taskAPI/tenantAdminSettings/Settings'
$results = Invoke-RestMethod -ContentType 'application/json;odata.metadata=full' `
-Headers @{'Accept' = 'application/json'; 'Authorization' = (Get-MSCloudLoginConnectionProfile -Workload Tasks).AccessToken; 'Accept-Charset' = 'UTF-8'; 'OData-Version' = '4.0;NetFx'; 'OData-MaxVersion' = '4.0;NetFx' } `
-Method PATCH `
-Body $requestBody `
$Uri
if ($flags.Keys.Count -gt 0)
{
$requestBody = $flags | ConvertTo-Json
Write-Verbose -Message "Updating Planner settings with values:`r`n$($requestBody)"
$Uri = (Get-MSCloudLoginConnectionProfile -Workload Tasks).HostUrl + '/taskAPI/tenantAdminSettings/Settings'
$results = Invoke-RestMethod -ContentType 'application/json;odata.metadata=full' `
-Headers @{'Accept' = 'application/json'; 'Authorization' = (Get-MSCloudLoginConnectionProfile -Workload Tasks).AccessToken; 'Accept-Charset' = 'UTF-8'; 'OData-Version' = '4.0;NetFx'; 'OData-MaxVersion' = '4.0;NetFx' } `
-Method PATCH `
-Body $requestBody `
-Uri $Uri
}
}

function Get-M365DSCOrgSettingsInstallationOptions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class MSFT_O365OrgSettings : OMI_BaseResource
[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("Allow Planner users to publish their plans and assigned tasks to Outlook or other calendars through iCalendar feeds.")] Boolean PlannerAllowCalendarSharing;
[Write, Description("Enables Copilot for Planner.")] Boolean AllowPlannerCopilot;
[Write, Description("To Do - Allow external users to join.")] Boolean ToDoIsExternalJoinEnabled;
[Write, Description("To Do - Allow sharing with external users.")] Boolean ToDoIsExternalShareEnabled;
[Write, Description("To Do - Allow your users to receive push notifications.")] Boolean ToDoIsPushNotificationEnabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
"resourceName": "O365OrgSettings",
"description": "",
"permissions": {
"ProjectWorkManagement": {
"application":{
"read": [
{
"name": "OrgSettings-Planner.Read.All"
}
],
"update": [
{
"name": "OrgSettings-Planner.ReadWrite.All"
}
]
}
},
"graph": {
"delegated": {
"read": [
Expand Down
2 changes: 1 addition & 1 deletion Modules/Microsoft365DSC/Dependencies/Manifest.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
},
@{
ModuleName = "MSCloudLoginAssistant"
RequiredVersion = "1.1.38"
RequiredVersion = "1.1.39"
},
@{
ModuleName = 'PnP.PowerShell'
Expand Down

0 comments on commit 5d2f321

Please sign in to comment.