Skip to content

Commit

Permalink
Merge pull request #3674 from NikCharlebois/Fixes-#3673
Browse files Browse the repository at this point in the history
Fixes #3673
  • Loading branch information
NikCharlebois authored Sep 11, 2023
2 parents 89f2a46 + d0b3c5c commit 6bdbe24
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 48 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
* IntuneAppProtectionPolicyAndroid
* Added support for 'RequireClass3Biometrics' parameter
* Added support for 'RequirePinAfterBiometricChange' parameter
* O365OrgSettings
* Fixes an issue where the wrong Graph URLs were being called for sovereign
clouds.
FIXES [#3673](https://github.com/microsoft/Microsoft365DSC/issues/3673)
* DEPENDENCIES
* Updated ExchangeOnlineManagement to version 3.3.0.
* Updated Microsoft.Graph modules to version 2.5.0.
* Added dependency on Microsoft.Graph.Beta.Reports.
* MISC
* Improved error logging for methods installing or updating modules.
FIXES [#3660](https://github.com/microsoft/Microsoft365DSC/issues/3660)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1126,44 +1126,6 @@ function Set-M365DSCO365OrgSettingsPlannerConfig
$Uri
}

function Get-M365DSCOrgSettingsAdminCenterReport
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param()
$VerbosePreference = 'SilentlyContinue'

try
{
$url = 'https://graph.microsoft.com/beta/admin/reportSettings'
$results = Invoke-MgGraphRequest -Method GET -Uri $url -ErrorAction Stop
return $results
}
catch
{
Write-Verbose -Message "Not able to retrieve Office 365 Report Settings. Please ensure correct permissions have been granted."
return $null
}
}

function Update-M365DSCOrgSettingsAdminCenterReport
{
[CmdletBinding()]
[OutputType([Void])]
param(
[Parameter(Mandatory = $true)]
[System.Boolean]
$DisplayConcealedNames
)
$VerbosePreference = 'SilentlyContinue'
$url = 'https://graph.microsoft.com/beta/admin/reportSettings'
$body = @{
"@odata.context" ="https://graph.microsoft.com/beta/$metadata#admin/reportSettings/$entity"
displayConcealedNames = $DisplayConcealedNames
}
Invoke-MgGraphRequest -Method PATCH -Uri $url -Body $body | Out-Null
}

function Get-M365DSCOrgSettingsInstallationOptions
{
[CmdletBinding()]
Expand All @@ -1177,7 +1139,7 @@ function Get-M365DSCOrgSettingsInstallationOptions

try
{
$url = 'https://graph.microsoft.com/beta/admin/microsoft365Apps/installationOptions'
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/admin/microsoft365Apps/installationOptions'
$results = Invoke-MgGraphRequest -Method GET -Uri $url
return $results
}
Expand Down Expand Up @@ -1205,7 +1167,7 @@ function Update-M365DSCOrgSettingsInstallationOptions

try
{
$url = 'https://graph.microsoft.com/beta/admin/microsoft365Apps/installationOptions'
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/admin/microsoft365Apps/installationOptions'
Invoke-MgGraphRequest -Method PATCH -Uri $url -Body $Options | Out-Null
}
catch
Expand All @@ -1232,7 +1194,7 @@ function Get-M365DSCOrgSettingsForms

try
{
$url = 'https://graph.microsoft.com/beta/admin/forms/settings'
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/admin/forms/settings'
$results = Invoke-MgGraphRequest -Method GET -Uri $url -ErrorAction Stop
return $results
}
Expand All @@ -1257,7 +1219,7 @@ function Update-M365DSCOrgSettingsForms
try
{
Write-Verbose -Message "Updating Forms Settings"
$url = 'https://graph.microsoft.com/beta/admin/forms/settings'
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/admin/forms/settings'
Invoke-MgGraphRequest -Method PATCH -Uri $url -Body $Options | Out-Null
}
catch
Expand All @@ -1279,7 +1241,7 @@ function Get-M365DSCOrgSettingsDynamicsCustomerVoice

try
{
$url = 'https://graph.microsoft.com/beta/admin/dynamics/customerVoice'
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/admin/dynamics/customerVoice'
$results = Invoke-MgGraphRequest -Method GET -Uri $url -ErrorAction Stop
return $results
}
Expand All @@ -1303,7 +1265,7 @@ function Update-M365DSCOrgSettingsDynamicsCustomerVoice

try
{
$url = 'https://graph.microsoft.com/beta/admin/dynamics/customerVoice'
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/admin/dynamics/customerVoice'
Invoke-MgGraphRequest -Method PATCH -Uri $url -Body $Options | Out-Null
}
catch
Expand All @@ -1325,7 +1287,7 @@ function Get-M365DSCOrgSettingsAppsAndServices

try
{
$url = 'https://graph.microsoft.com/beta/admin/appsAndServices/settings'
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/admin/appsAndServices/settings'
$results = Invoke-MgGraphRequest -Method GET -Uri $url -ErrorAction Stop
return $results
}
Expand All @@ -1349,7 +1311,7 @@ function Update-M365DSCOrgSettingsAppsAndServices

try
{
$url = 'https://graph.microsoft.com/beta/admin/appsAndServices/settings'
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/admin/appsAndServices/settings'
Invoke-MgGraphRequest -Method PATCH -Uri $url -Body $Options | Out-Null
}
catch
Expand All @@ -1370,7 +1332,7 @@ function Get-M365DSCOrgSettingsToDo

try
{
$url = 'https://graph.microsoft.com/beta/admin/todo/settings'
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/admin/todo/settings'
$results = Invoke-MgGraphRequest -Method GET -Uri $url -ErrorAction Stop
return $results
}
Expand All @@ -1394,7 +1356,7 @@ function Update-M365DSCOrgSettingsToDo

try
{
$url = 'https://graph.microsoft.com/beta/admin/todo/settings'
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/admin/todo/settings'
Invoke-MgGraphRequest -Method PATCH -Uri $url -Body $Options | Out-Null
}
catch
Expand All @@ -1408,4 +1370,42 @@ function Update-M365DSCOrgSettingsToDo
}
}

function Get-M365DSCOrgSettingsAdminCenterReport
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param()
$VerbosePreference = 'SilentlyContinue'

try
{
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/admin/reportSettings'
$results = Invoke-MgGraphRequest -Method GET -Uri $url -ErrorAction Stop
return $results
}
catch
{
Write-Verbose -Message "Not able to retrieve Office 365 Report Settings. Please ensure correct permissions have been granted."
return $null
}
}

function Update-M365DSCOrgSettingsAdminCenterReport
{
[CmdletBinding()]
[OutputType([Void])]
param(
[Parameter(Mandatory = $true)]
[System.Boolean]
$DisplayConcealedNames
)
$VerbosePreference = 'SilentlyContinue'
$url = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/admin/reportSettings'
$body = @{
"@odata.context" = $Global:MSCloudLoginConnectionProfile.MicrosoftGraoh.ResourceUrl + 'beta/$metadata#admin/reportSettings/$entity'
displayConcealedNames = $DisplayConcealedNames
}
Invoke-MgGraphRequest -Method PATCH -Uri $url -Body $body | Out-Null
}

Export-ModuleMember -Function *-TargetResource
4 changes: 4 additions & 0 deletions Modules/Microsoft365DSC/Dependencies/Manifest.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
ModuleName = 'Microsoft.Graph.Beta.Identity.SignIns'
RequiredVersion = '2.5.0'
},
@{
ModuleName = 'Microsoft.Graph.Beta.Reports'
RequiredVersion = '2.5.0'
},
@{
ModuleName = 'Microsoft.Graph.Beta.Teams'
RequiredVersion = '2.5.0'
Expand Down

0 comments on commit 6bdbe24

Please sign in to comment.