Skip to content

Commit

Permalink
Merge pull request #5763 from microsoft/Dev
Browse files Browse the repository at this point in the history
Release 1.25.212
  • Loading branch information
NikCharlebois authored Feb 12, 2025
2 parents c3b77a5 + 0155d91 commit e81ac9f
Show file tree
Hide file tree
Showing 492 changed files with 2,985 additions and 4,650 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/Validation Checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Validation Checks
on: [push, pull_request]

jobs:
# This workflow contains a single job called "build"
UnitTests:
# The type of runner that the job will run on
runs-on: windows-latest

permissions: write-all

# Only when run from the main repo
if: github.repository == 'microsoft/Microsoft365DSC'

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repository
uses: actions/checkout@v3

- name: Ensure No Hardcoded Graph Endpoints
shell: pwsh
run: |
$resources = Get-ChildItem './Modules/Microsoft365DSC/DSCResources/*.psm1' -Recurse
foreach ($resource in $resources)
{
$content = Get-Content $resource.FullName -Raw
$foundPosition = $content.IndexOf('https://graph.microsoft.com', 0)
if ($foundPosition -ge 0)
{
throw "Resource {$($Resource.Name)} contains hardcoded Graph references."
}
}
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
# Change log for Microsoft365DSC
# UNRELEASED

* AADGroupEligibilitySchedule
* FIXES [#5741] Missing -All variable which prevented enumeration of more than 100 Groups

# 1.25.212.1

* AADApplication
* Changing the AuthenticationBehaviors parameters to string to allow
for null values.
* AADCrossTenantAccessPolicyConfigurationDefault
* Fixes an issue with CIM class export.
* AADCrossTenantAccessPolicyConfigurationPartner
* Fixes an issue with CIM class export.
FIXES [#5711](https://github.com/microsoft/Microsoft365DSC/issues/5711)
* EXORetentionPolicyTag
* Initial release.
* EXOSmtpDaneInbound
* Updated authentication properties to align with MOF definition.
FIXES [#5709](https://github.com/microsoft/Microsoft365DSC/issues/5709)
* MISC
* PowerPlatform resource revamp to use direct REST API calls.
* Simplify export behavior for all resources and complex objects.
* DEPENDENCIES
* Removed dependency on Microsoft.PowerApps.Administration.PowerShell.
* Updated DSCParser to version 2.0.0.15.
* Updated MSCloudLoginAssistant to version 1.1.37.
* Updated ReverseDSC to version 2.0.0.25.

# 1.25.205.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,8 +823,6 @@ function Export-TargetResource

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results
if ($null -ne $Results.ScopeValue)
{
$complexMapping = @(
Expand Down Expand Up @@ -959,19 +957,8 @@ function Export-TargetResource
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
-Results $Results `
-Credential $Credential
if ($Results.ScopeValue)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'ScopeValue' -IsCIMArray:$False
}
if ($Results.SettingsValue)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'SettingsValue' -IsCIMArray:$False
}
if ($Results.StageSettings)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'StageSettings' -IsCIMArray:$True
}
-Credential $Credential `
-NoEscape @('ScopeValue', 'SettingsValue', 'StageSettings')

$dscContent += $currentDSCBlock
Save-M365DSCPartialExport -Content $currentDSCBlock `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,6 @@ function Export-TargetResource

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results

$currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName `
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,6 @@ function Export-TargetResource

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results

$currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName `
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,6 @@ function Export-TargetResource

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results

if ($null -ne $Results.Reviewers)
{
$complexMapping = @(
Expand Down Expand Up @@ -516,11 +513,8 @@ function Export-TargetResource
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
-Results $Results `
-Credential $Credential
if ($Results.Reviewers)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'Reviewers' -IsCIMArray:$True
}
-Credential $Credential `
-NoEscape @('Reviewers')
$dscContent += $currentDSCBlock
Save-M365DSCPartialExport -Content $currentDSCBlock `
-FileName $Global:PartialExportFileName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,6 @@ function Export-TargetResource

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params

if ($null -ne $Results.ScopedRoleMembers)
{
$complexMapping = @(
Expand Down Expand Up @@ -1120,25 +1119,13 @@ function Export-TargetResource
}
}

$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results

$currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName `
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
-Results $Results `
-Credential $Credential

if ($null -ne $Results.ScopedRoleMembers)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'ScopedRoleMembers' -IsCIMArray $true
}
if ($null -ne $Results.Members)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'Members' -IsCIMArray $true
$currentDSCBlock = $currentDSCBlock.Replace("`",`"`r`n", '')
$currentDSCBlock = $currentDSCBlock.Replace(",`r`n", '').Replace("`");`r`n", ");`r`n")
}
-Credential $Credential `
-NoEscape @('Members', 'ScopedRoleMembers')

$dscContent += $currentDSCBlock
Save-M365DSCPartialExport -Content $currentDSCBlock `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,15 @@ function Get-TargetResource
$complexAuthenticationBehaviors = @{}
if ($null -ne $AADBetaApp.authenticationBehaviors.blockAzureADGraphAccess)
{
$complexAuthenticationBehaviors.Add('BlockAzureADGraphAccess', $AADBetaApp.authenticationBehaviors.blockAzureADGraphAccess)
$complexAuthenticationBehaviors.Add('BlockAzureADGraphAccess', $AADBetaApp.authenticationBehaviors.blockAzureADGraphAccess.ToString())
}
if ($null -ne $AADBetaApp.authenticationBehaviors.removeUnverifiedEmailClaim)
{
$complexAuthenticationBehaviors.Add('RemoveUnverifiedEmailClaim', $AADBetaApp.authenticationBehaviors.removeUnverifiedEmailClaim)
$complexAuthenticationBehaviors.Add('RemoveUnverifiedEmailClaim', $AADBetaApp.authenticationBehaviors.removeUnverifiedEmailClaim.ToString())
}
if ($null -ne $AADBetaApp.authenticationBehaviors.requireClientServicePrincipal)
{
$complexAuthenticationBehaviors.Add('RequireClientServicePrincipal', $AADBetaApp.authenticationBehaviors.requireClientServicePrincipal)
$complexAuthenticationBehaviors.Add('RequireClientServicePrincipal', $AADBetaApp.authenticationBehaviors.requireClientServicePrincipal.ToString())
}
if ($complexAuthenticationBehaviors.values.Where({ $null -ne $_ }).Count -eq 0)
{
Expand Down Expand Up @@ -897,10 +897,6 @@ function Set-TargetResource
$tries++
} until ($null -eq $appEntity -or $tries -le 12)
}
Write-Host "Ensure = $Ensure"
Write-Host "ApplicationTemplateId = $ApplicationTemplateId"
Write-Host "skipToUpdate = $skipToUpdate"
Write-Host "currentAADApp.Ensure = $($currentAADApp.Ensure))"
if ($Ensure -eq 'Present' -and $currentAADApp.Ensure -eq 'Absent' -and -not $skipToUpdate)
{
$currentParameters.Remove('ObjectId') | Out-Null
Expand Down Expand Up @@ -1184,8 +1180,8 @@ function Set-TargetResource
requireClientServicePrincipal = $AuthenticationBehaviors.requireClientServicePrincipal
}

Update-MgBetaApplication -ApplicationId $currentAADApp.Id `
-AuthenticationBehaviors $IAuthenticationBehaviors | Out-Null
$uri = (Get-MSCloudLoginConnectionProfile -Workload MicrosoftGraph).ResourceUrl + "beta/applications/$($currentAADApp.Id)/authenticationBehaviors"
Invoke-MgGraphRequest -Uri $uri -Method 'PATCH' -Body $IAuthenticationBehaviors
}

if ($needToUpdateKeyCredentials -and $KeyCredentials)
Expand Down Expand Up @@ -1556,8 +1552,6 @@ function Export-TargetResource
$Results = Get-TargetResource @Params
if ($Results.Ensure -eq 'Present')
{
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results

if ($Results.Permissions.Count -gt 0)
{
Expand Down Expand Up @@ -1762,49 +1756,8 @@ function Export-TargetResource
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
-Results $Results `
-Credential $Credential

if ($Results.Api)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'Api' -IsCIMArray:$False
}

if ($null -ne $Results.Permissions)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock `
-ParameterName 'Permissions' `
-IsCIMArray:$True
}

if ($Results.OptionalClaims)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'OptionalClaims' -IsCIMArray:$False
}

if ($Results.OnPremisesPublishing)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'OnPremisesPublishing' -IsCIMArray:$False
}

if ($Results.AuthenticationBehaviors)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'AuthenticationBehaviors' -IsCIMArray:$False
}

if ($Results.KeyCredentials)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'KeyCredentials' -IsCIMArray:$True
}

if ($Results.PasswordCredentials)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'PasswordCredentials' -IsCIMArray:$True
}

if ($Results.AppRoles)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'AppRoles' -IsCIMArray:$True
}
-Credential $Credential `
-NoEscape @('Api', 'Permissions', 'OptionalClaims', 'OnPremisesPublishing', 'AuthenticationBehaviors', 'KeyCredentials', 'PasswordCredentials', 'AppRoles')

$dscContent.Append($currentDSCBlock) | Out-Null
Save-M365DSCPartialExport -Content $currentDSCBlock `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ class MSFT_MicrosoftGraphApiApplication
[ClassVersion("1.0.0")]
class MSFT_MicrosoftGraphAuthenticationBehaviors
{
[Write, Description("If false, allows the app to have extended access to Azure AD Graph until June 30, 2025 when Azure AD Graph is fully retired. For more information on Azure AD retirement updates, see June 2024 update on Azure AD Graph API retirement.")] Boolean BlockAzureADGraphAccess;
[Write, Description("If true, removes the email claim from tokens sent to an application when the email address's domain can't be verified.")] Boolean RemoveUnverifiedEmailClaim;
[Write, Description("If true, requires multitenant applications to have a service principal in the resource tenant as part of authorization checks before they're granted access tokens. This property is only modifiable for multitenant resource applications that rely on access from clients without a service principal and had this behavior as set to false by Microsoft. Tenant administrators should respond to security advisories sent through Azure Health Service events and the Microsoft 365 message center.")] Boolean RequireClientServicePrincipal;
[Write, Description("If false, allows the app to have extended access to Azure AD Graph until June 30, 2025 when Azure AD Graph is fully retired. For more information on Azure AD retirement updates, see June 2024 update on Azure AD Graph API retirement.")] String BlockAzureADGraphAccess;
[Write, Description("If true, removes the email claim from tokens sent to an application when the email address's domain can't be verified.")] String RemoveUnverifiedEmailClaim;
[Write, Description("If true, requires multitenant applications to have a service principal in the resource tenant as part of authorization checks before they're granted access tokens. This property is only modifiable for multitenant resource applications that rely on access from clients without a service principal and had this behavior as set to false by Microsoft. Tenant administrators should respond to security advisories sent through Azure Health Service events and the Microsoft 365 message center.")] String RequireClientServicePrincipal;
};

[ClassVersion("1.0.0")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,6 @@ function Export-TargetResource

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results

$currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName `
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,6 @@ function Export-TargetResource

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results

$currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName `
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,10 @@ function Export-TargetResource
ManagedIdentity = $ManagedIdentity.IsPresent
AccessTokens = $AccessTokens
}
$Results = Get-TargetResource @Params

$Results = Get-TargetResource @Params
if ($Results -is [System.Collections.Hashtable] -and $Results.Count -gt 1)
{
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode -Results $Results
$currentDSCBlock = Get-M365DSCExportContentForResource -ResourceName $ResourceName -ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
-Results $Results `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,6 @@ function Export-TargetResource

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results
if ($null -ne $Results.RegistrationEnforcement)
{
$complexMapping = @(
Expand Down Expand Up @@ -755,20 +753,9 @@ function Export-TargetResource
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
-Results $Results `
-Credential $Credential
if ($Results.RegistrationEnforcement)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'RegistrationEnforcement' -IsCIMArray:$False
}
if ($Results.SystemCredentialPreferences)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'SystemCredentialPreferences' -IsCIMArray:$False
}
-Credential $Credential `
-NoEscape @('RegistrationEnforcement', 'ReportSuspiciousActivitySettings', 'SystemCredentialPreferences')

if ($Results.ReportSuspiciousActivitySettings)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'ReportSuspiciousActivitySettings' -IsCIMArray:$False
}
$dscContent += $currentDSCBlock
Save-M365DSCPartialExport -Content $currentDSCBlock `
-FileName $Global:PartialExportFileName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -928,8 +928,6 @@ function Export-TargetResource

$Script:exportedInstance = $config
$Results = Get-TargetResource @Params
$Results = Update-M365DSCExportAuthenticationResults -ConnectionMode $ConnectionMode `
-Results $Results
if ($null -ne $Results.FeatureSettings)
{
$complexMapping = @(
Expand Down Expand Up @@ -1016,19 +1014,9 @@ function Export-TargetResource
-ConnectionMode $ConnectionMode `
-ModulePath $PSScriptRoot `
-Results $Results `
-Credential $Credential
if ($Results.FeatureSettings)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'FeatureSettings' -IsCIMArray:$False
}
if ($Results.ExcludeTargets)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'ExcludeTargets' -IsCIMArray:$True
}
if ($Results.IncludeTargets)
{
$currentDSCBlock = Convert-DSCStringParamToVariable -DSCBlock $currentDSCBlock -ParameterName 'IncludeTargets' -IsCIMArray:$True
}
-Credential $Credential `
-NoEscape @('FeatureSettings', 'ExcludeTargets', 'IncludeTargets')

$currentDSCBlock = Remove-M365DSCCimInstanceTrailingCharacterFromExport -DSCBlock $currentDSCBlock

# FIX #3645
Expand Down
Loading

0 comments on commit e81ac9f

Please sign in to comment.