diff --git a/CHANGELOG.md b/CHANGELOG.md index c91884078e..304794d71d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,8 @@ * Added the logic to handle filters in the Export logic flow. * EXOManagementRoleAssignment * Changed logic to detect drift. +* EXOServicePrincipal + * Removed ObjectID from the return of the Get-TargetResource method. * EXOTeamsProtectionPolicy * Initial release FIXES [#5296](https://github.com/microsoft/Microsoft365DSC/issues/5296) diff --git a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOServicePrincipal/MSFT_EXOServicePrincipal.psm1 b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOServicePrincipal/MSFT_EXOServicePrincipal.psm1 index 22da7246e7..d888c04fd0 100644 --- a/Modules/Microsoft365DSC/DSCResources/MSFT_EXOServicePrincipal/MSFT_EXOServicePrincipal.psm1 +++ b/Modules/Microsoft365DSC/DSCResources/MSFT_EXOServicePrincipal/MSFT_EXOServicePrincipal.psm1 @@ -94,7 +94,6 @@ function Get-TargetResource AppName = $servicePrincipal.AppDisplayName DisplayName = $instance.DisplayName AppId = $instance.AppId - ObjectId = $instance.ObjectId Ensure = 'Present' Credential = $Credential ApplicationId = $ApplicationId @@ -195,7 +194,6 @@ function Set-TargetResource elseif ($Ensure -eq 'Present' -and $currentInstance.Ensure -eq 'Present') { $setParameters.Remove('AppId') - $setParameters.Remove('ObjectId') Set-ServicePrincipal -DisplayName $DisplayName -Identity $servicePrincipal.Id } # REMOVE @@ -354,6 +352,11 @@ function Export-TargetResource } foreach ($config in $Script:exportedInstances) { + if ($null -ne $Global:M365DSCExportResourceInstancesCount) + { + $Global:M365DSCExportResourceInstancesCount++ + } + $servicePrincipal = Get-MgServicePrincipal -ServicePrincipalId $config.Identity $displayedKey = $servicePrincipal.AppDisplayName