Skip to content

Commit

Permalink
Merge pull request #5565 from FabienTschanz/fix/reset-only-required-w…
Browse files Browse the repository at this point in the history
…orkloads

Reset only necessary authentication context
  • Loading branch information
NikCharlebois authored Dec 17, 2024
2 parents 52335bc + 1b95a62 commit a1ac29e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Fixed the Fabric web request to use basic parsing.
* Fixed an issue where the export does not convert tenant name into
generic $OrganizationName variable correctly.
* Reset only necessary authentication context.
* M365DSCUtil
* Update `Get-M365DSCWorkloadsListFromResourceNames` function for more input types.
FIXES [#5525](https://github.com/microsoft/Microsoft365DSC/issues/5525)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ function Set-TargetResource
Write-Verbose -Message 'Waiting for 20 seconds for new permissions to be effective.'
Start-Sleep 20
Write-Verbose -Message 'Disconnecting from Exchange Online'
Reset-MSCloudLoginConnectionProfileContext
Reset-MSCloudLoginConnectionProfileContext -Workload ExchangeOnline
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function Get-TargetResource
if ((Get-MSCloudLoginConnectionProfile -Workload SecurityComplianceCenter).Connected -and `
(Get-MSCloudLoginConnectionProfile -Workload ExchangeOnline).Connected)
{
Reset-MSCloudLoginConnectionProfileContext
Reset-MSCloudLoginConnectionProfileContext -Workload ExchangeOnline
}
$ConnectionMode = New-M365DSCConnection -Workload 'ExchangeOnline' `
-InboundParameters $PSBoundParameters
Expand Down
2 changes: 1 addition & 1 deletion Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ function Export-M365DSCConfiguration
try
{
Disconnect-MgGraph -ErrorAction Stop | Out-Null
Reset-MSCloudLoginConnectionProfileContext
Reset-MSCloudLoginConnectionProfileContext -Workload 'MicrosoftGraph'
}
catch
{
Expand Down

0 comments on commit a1ac29e

Please sign in to comment.