Skip to content

Commit

Permalink
Revert "O365OrgSettings - Added Support for CustomerLockboxEnabled"
Browse files Browse the repository at this point in the history
  • Loading branch information
NikCharlebois authored Sep 16, 2024
1 parent e2d05ef commit 6510831
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 26 deletions.
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
* IntuneDeviceConfigurationSharedMultiDevicePolicyWindows10
* Add missing `AccessTokens` parameter to `Export-TargetResource`
FIXES [#5034](https://github.com/microsoft/Microsoft365DSC/issues/5034)
* O365OrgSettings
* Added support for the CustomerLockboxEnabled property.
* SCRoleGroup
* Fixes an issue with creation without specifying Displayname
* Fixes an issue with Drifts because of returned Role format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ function Get-TargetResource
[System.Boolean]
$AppsAndServicesIsOfficeStoreEnabled,

[Parameter()]
[System.Boolean]
$CustomerLockboxEnabled,

[Parameter()]
[System.Boolean]
$AppsAndServicesIsAppAndServicesTrialEnabled,
Expand Down Expand Up @@ -239,6 +235,61 @@ function Get-TargetResource
}
}

# DEPRECATED - Microsoft Viva Briefing Email
<#
$vivaBriefingEmailValue = $false
try
{
$currentBriefingConfig = Get-DefaultTenantBriefingConfig -ErrorAction Stop -Verbose:$false
if ($currentBriefingConfig.IsEnabledByDefault -eq 'opt-in')
{
$vivaBriefingEmailValue = $true
}
}
catch
{
if ($_.Exception.Message -like "*Unexpected character encountered while parsing value*")
{
$vivaBriefingEmailValue = $true
}
elseif ($_.Exception.Message -like "*A task was canceled*")
{
$retries = 1
$errorContent = $null
while ($retries -le 5)
{
try
{
Start-Sleep -Seconds 2
$currentBriefingConfig = Get-DefaultTenantBriefingConfig -ErrorAction Stop -Verbose:$false
}
catch
{
$errorContent = $_
$retries++
}
}
if ($null -eq $currentBriefingConfig)
{
throw $errorContent
}
else
{
if ($currentBriefingConfig.IsEnabledByDefault -eq 'opt-in')
{
$vivaBriefingEmailValue = $true
}
}
}
else
{
throw $_
}
}
$results += @{
MicrosoftVivaBriefingEmail = $vivaBriefingEmailValue
}#>

# Viva Insights settings
$currentVivaInsightsSettings = Get-DefaultTenantMyAnalyticsFeatureConfig -Verbose:$false
if ($null -ne $currentVivaInsightsSettings)
Expand All @@ -254,11 +305,11 @@ function Get-TargetResource
$MRODeviceManagerService = 'ebe0c285-db95-403f-a1a3-a793bd6d7767'
try
{
$servicePrincipal = Get-MgServicePrincipal -Filter "appid eq '$MRODeviceManagerService'"
$servicePrincipal = Get-MgServicePrincipal -Filter "appid eq 'ebe0c285-db95-403f-a1a3-a793bd6d7767'"
if ($null -eq $servicePrincipal)
{
Write-Verbose -Message "Registering the MRO Device Manager Service Principal"
New-MgServicePrincipal -AppId $MRODeviceManagerService -ErrorAction Stop | Out-Null
New-MgServicePrincipal -AppId 'ebe0c285-db95-403f-a1a3-a793bd6d7767' -ErrorAction Stop | Out-Null
}
}
catch
Expand Down Expand Up @@ -350,9 +401,6 @@ function Get-TargetResource
}
}

$OrganizationConfig = Get-OrganizationConfig
$results.Add('CustomerLockboxEnabled', $OrganizationConfig.CustomerLockboxEnabled)

return $results
}
catch
Expand Down Expand Up @@ -389,10 +437,6 @@ function Set-TargetResource
[System.Boolean]
$AppsAndServicesIsAppAndServicesTrialEnabled,

[Parameter()]
[System.Boolean]
$CustomerLockboxEnabled,

[Parameter()]
[System.Boolean]
$DynamicsCustomerVoiceIsRestrictedSurveyAccessEnabled,
Expand Down Expand Up @@ -582,6 +626,14 @@ function Set-TargetResource
{
Write-Verbose -Message "DEPRECATED - The MicrosoftVivaBriefingEmail parameter is deprecated and will be ignored."
}
#$briefingValue = 'opt-out'

<# DEPRECATED
if ($currentValues.MicrosoftVivaBriefingEmail -and $MicrosoftVivaBriefingEmail -ne $currentValues.MicrosoftVivaBriefingEmail)
{
Write-Verbose -Message "Updating Microsoft Viva Briefing Email settings."
Set-DefaultTenantBriefingConfig -IsEnabledByDefault $briefingValue -Verbose:$false | Out-Null
}#>

# Viva Insights
if ($PSBoundParameters.ContainsKey('VivaInsightsWebExperience') -and `
Expand Down Expand Up @@ -792,12 +844,6 @@ function Set-TargetResource
Write-Verbose -Message "Updating the To Do settings with values:$(Convert-M365DscHashtableToString -Hashtable $ToDoParametersToUpdate)"
Update-M365DSCOrgSettingsToDo -Options $ToDoParametersToUpdate
}

# Customer Lockbox
if ($PSBoundParameters.ContainsKey('CustomerLockboxEnabled'))
{
Set-OrganizationConfig -CustomerLockboxEnabled $CustomerLockboxEnabled | Out-Null
}
}

function Test-TargetResource
Expand All @@ -823,10 +869,6 @@ function Test-TargetResource
[System.Boolean]
$AppsAndServicesIsAppAndServicesTrialEnabled,

[Parameter()]
[System.Boolean]
$CustomerLockboxEnabled,

[Parameter()]
[System.Boolean]
$DynamicsCustomerVoiceIsRestrictedSurveyAccessEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class MSFT_O365OrgSettings : OMI_BaseResource
[Write, Description("To Do - Allow sharing with external users.")] Boolean ToDoIsExternalShareEnabled;
[Write, Description("To Do - Allow your users to receive push notifications.")] Boolean ToDoIsPushNotificationEnabled;
[Write, Description("Controls whether or not the Admin Center reports will conceale user, group and site names.")] Boolean AdminCenterReportDisplayConcealedNames;
[Write, Description("Determines if the customer lockbox should require approval for all data access requests or not.")] Boolean CustomerLockboxEnabled;
[Write, Description("Defines how often you want your users to get feature updates for Microsoft 365 apps installed on devices running Windows"), ValueMap{"current","monthlyEnterprise","semiAnnual"}, Values{"current","monthlyEnterprise","semiAnnual"}] String InstallationOptionsUpdateChannel;
[Write, Description("Defines the apps users can install on Windows and mobile devices."), ValueMap{"isVisioEnabled","isSkypeForBusinessEnabled","isProjectEnabled","isMicrosoft365AppsEnabled"}, Values{"isVisioEnabled","isSkypeForBusinessEnabled","isProjectEnabled","isMicrosoft365AppsEnabled"}] String InstallationOptionsAppsForWindows[];
[Write, Description("Defines the apps users can install on Mac devices."), ValueMap{"isSkypeForBusinessEnabled","isMicrosoft365AppsEnabled"}, Values{"isSkypeForBusinessEnabled","isMicrosoft365AppsEnabled"}] String InstallationOptionsAppsForMac[];
Expand Down
1 change: 1 addition & 0 deletions Modules/Microsoft365DSC/Modules/M365DSCUtil.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,7 @@ function New-M365DSCConnection
[System.Boolean]
$SkipModuleReload = $false
)
$verbosepreference = 'Continue'
$Global:MaximumFunctionCount = 32767
if ($Workload -eq 'MicrosoftTeams')
{
Expand Down

0 comments on commit 6510831

Please sign in to comment.