Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXOServicePrincipal - Removed ObjectID From Get-TargetResource #5507

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down