diff --git a/CHANGELOG.md b/CHANGELOG.md index f65de7a463..42f4f58bae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,14 +2,15 @@ # UNRELEASED +* AADOrganizationCertificateBasedAuthConfiguration + * Fixed the primary key of the resource. + FIXES [#5523](https://github.com/microsoft/Microsoft365DSC/issues/5523) * DefenderDeviceAuthenticatedScanDefinition * Fixed the Data Type export. * MISC * DEFENDER * Added support for the UseBasicParsing paramter for REST calls. -# 1.24.1218.1 - * AADApplication * Added support for Oauth2PermissionScopes. * Fixes comparison issue for permissions. diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_AADOrganizationCertificateBasedAuthConfiguration/MSFT_AADOrganizationCertificateBasedAuthConfiguration.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_AADOrganizationCertificateBasedAuthConfiguration/MSFT_AADOrganizationCertificateBasedAuthConfiguration.psm1 index 109cc8b9a6..8a5b4423f2 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_AADOrganizationCertificateBasedAuthConfiguration/MSFT_AADOrganizationCertificateBasedAuthConfiguration.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_AADOrganizationCertificateBasedAuthConfiguration/MSFT_AADOrganizationCertificateBasedAuthConfiguration.psm1 @@ -9,7 +9,7 @@ function Get-TargetResource [Microsoft.Management.Infrastructure.CimInstance[]] $CertificateAuthorities, - [Parameter()] + [Parameter(Mandatory = $true)] [System.String] $OrganizationId, #endregion @@ -141,7 +141,7 @@ function Set-TargetResource [Microsoft.Management.Infrastructure.CimInstance[]] $CertificateAuthorities, - [Parameter()] + [Parameter(Mandatory = $true)] [System.String] $OrganizationId, #endregion @@ -225,7 +225,13 @@ function Set-TargetResource certificateAuthorities = $createCertAuthorities } - $policy = Invoke-MgGraphRequest -Uri ((Get-MSCloudLoginConnectionProfile -Workload MicrosoftGraph).ResourceUrl + "beta/organization/$OrganizationId/certificateBasedAuthConfiguration/") -Method POST -Body $params + $uri = ((Get-MSCloudLoginConnectionProfile -Workload MicrosoftGraph).ResourceUrl + ` + "beta/organization/$OrganizationId/certificateBasedAuthConfiguration/") + + Write-Verbose -Message "Creating with Parameters:`r`n$(ConvertTo-Json $params -Depth 10)" + Invoke-MgGraphRequest -Uri $uri ` + -Method 'POST' ` + -Body $params } } @@ -240,7 +246,7 @@ function Test-TargetResource [Microsoft.Management.Infrastructure.CimInstance[]] $CertificateAuthorities, - [Parameter()] + [Parameter(Mandatory = $true)] [System.String] $OrganizationId, #endregion @@ -417,6 +423,10 @@ function Export-TargetResource } foreach ($config in $getValue) { + if ($null -ne $Global:M365DSCExportResourceInstancesCount) + { + $Global:M365DSCExportResourceInstancesCount++ + } $displayedKey = "CertificateBasedAuthConfigurations for $($getValue.DisplayName)" Write-Host " |---[$i/$($getValue.Count)] $displayedKey" -NoNewline $params = @{