Skip to content

Commit

Permalink
Merge pull request #5507 from NikCharlebois/AADIdentityAPIConnector
Browse files Browse the repository at this point in the history
EXOServicePrincipal - Removed ObjectID From Get-TargetResource
  • Loading branch information
NikCharlebois authored Dec 4, 2024
2 parents b38e9e1 + 560d144 commit a3c4f63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* Added $confirm flag to the Set-TargetResource function for PowerShell 7 compatibility.
* 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

0 comments on commit a3c4f63

Please sign in to comment.