Skip to content

Commit

Permalink
Merge pull request #3860 from NikCharlebois/Fixes-#3842
Browse files Browse the repository at this point in the history
Fixes #3842
  • Loading branch information
NikCharlebois authored Nov 1, 2023
2 parents 1386a84 + 8940515 commit 52e53a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change log for Microsoft365DSC

# UNRELEASED

* O365OrgSettings
* Force register the Office on the Web ServicePrincipal is it is not present.
FIXES [#3842](https://github.com/microsoft/Microsoft365DSC/issues/3842)

# 1.23.1101.1

* AADRoleEligibilityScheduleRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,14 @@ function Get-TargetResource
try
{
$OfficeOnlineId = 'c1f33bc0-bdb4-4248-ba9b-096807ddb43e'
$M365WebEnableUsersToOpenFilesFrom3PStorageValue = Get-MgServicePrincipal -Filter "appId eq '$OfficeOnlineId'" -Property 'AccountEnabled'
$M365WebEnableUsersToOpenFilesFrom3PStorageValue = Get-MgServicePrincipal -Filter "appId eq '$OfficeOnlineId'" -Property 'AccountEnabled' -ErrorAction SilentlyContinue
if ($null -eq $M365WebEnableUsersToOpenFilesFrom3PStorageValue)
{
Write-Verbose -Message "Registering the Office on the web Service Principal"
New-MgServicePrincipal -AppId 'c1f33bc0-bdb4-4248-ba9b-096807ddb43e' -ErrorAction Stop | Out-Null
$M365WebEnableUsersToOpenFilesFrom3PStorageValue = Get-MgServicePrincipal -Filter "appId eq '$OfficeOnlineId'" -Property 'AccountEnabled' -ErrorAction SilentlyContinue
}

if ($null -ne $M365WebEnableUsersToOpenFilesFrom3PStorageValue)
{
$results += @{
Expand Down

0 comments on commit 52e53a1

Please sign in to comment.